public Object getNewInstance(ApplicatorObjectManager objectManager, DNA dna) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); Assert.assertEquals(3, cursor.getActionCount()); cursor.next(encoding); PhysicalAction a = cursor.getPhysicalAction(); String className = (String) a.getObject(); cursor.next(encoding); a = cursor.getPhysicalAction(); Class target = (Class) a.getObject(); cursor.next(encoding); a = cursor.getPhysicalAction(); Object propertyNames = a.getObject(); propertyNames = objectManager.lookupObject((ObjectID) propertyNames); return create(target, className, propertyNames); }
@Override public LogicalAction getLogicalAction() { if (returnedEvictionCompleted) { return EVICTION_COMPLETED; } else { return removeCursor.getLogicalAction(); } }
@Override public Object getNewInstance(ClientObjectManager objectManager, DNA dna) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); Assert.assertEquals(1, cursor.getActionCount()); cursor.next(encoding); LiteralAction a = (LiteralAction) cursor.getAction(); Object value = a.getObject(); return value; } }
@Override public Object getNewInstance(ApplicatorObjectManager objectManager, DNA dna) { try { final DNACursor cursor = dna.getCursor(); Assert.assertTrue("DNA missing physical action", cursor.next()); PhysicalAction physicalAction = cursor.getPhysicalAction(); final Object lockType = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); Object lockStrategy = objectManager.lookupObject((ObjectID) physicalAction.getObject()); /* * This trickery is necessary to avoid getting an instance of class loaded by the wrong classloader. Otherwise we * get ClassCastExceptions when we try and store the result in the ConcurrentDistributedMap instance. */ Class cdmClazz = objectManager.getClassFor(CDM_DSO, LoaderDescription.fromString(dna .getDefiningLoaderDescription())); final Method newCDM = cdmClazz.getMethod("newCDM", NEW_CDM_ARGS); newCDM.setAccessible(true); return newCDM.invoke(null, lockType, lockStrategy); } catch (final Exception e) { throw new RuntimeException(e); } }
@Override public void hydrate(final ClientObjectManager objectManager, final TCObject tco, final DNA dna, final Object po) throws IOException, ClassNotFoundException { final DNACursor cursor = dna.getCursor(); while (cursor.next(this.encoding)) { final LogicalAction action = cursor.getLogicalAction(); final int method = action.getMethod(); final Object[] params = action.getParameters(); apply(objectManager, po, method, params); } }
@Override public boolean next() throws IOException { if (removeCursor.next()) { return true; } else if (!returnedEvictionCompleted) { returnedEvictionCompleted = true; return true; } else { return false; } }
@Override public PhysicalAction getPhysicalAction() { return (index < actions.size() ? (PhysicalAction) actions.get(index) : cursor.getPhysicalAction()); }
@Override public Object getAction() { return (index < actions.size() ? actions.get(index) : cursor.getAction()); }
@Override public int getActionCount() { return returnedEvictionCompleted ? 0 : removeCursor.getActionCount() + 1; }
Assert.assertTrue("DNA missing physical action", cursor.next()); PhysicalAction physicalAction = cursor.getPhysicalAction(); final Object lockType = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object lockStrategy = objectManager.lookupObject((ObjectID) physicalAction.getObject()); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object maxTTISeconds = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object maxTTLSeconds = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object targetMaxInMemoryCount = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object targetMaxTotalCount = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); final Object invalidateOnChange = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next());
@Override public void hydrate(final ClientObjectManager objectManager, final TCObject tco, final DNA dna, final Object po) throws IOException, ClassNotFoundException { final DNACursor cursor = dna.getCursor(); while (cursor.next(this.encoding)) { final LogicalAction action = cursor.getLogicalAction(); final int method = action.getMethod(); final Object[] params = action.getParameters(); apply(objectManager, po, method, params); } }
@Override public Object getNewInstance(ClientObjectManager objectManager, DNA dna) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); Assert.assertEquals(1, cursor.getActionCount()); cursor.next(encoding); LiteralAction a = (LiteralAction) cursor.getAction(); Object value = a.getObject(); return value; } }
@Override public PhysicalAction getPhysicalAction() { return (index < actions.size() ? (PhysicalAction) actions.get(index) : cursor.getPhysicalAction()); }
@Override public Object getAction() { return (index < actions.size() ? actions.get(index) : cursor.getAction()); }
@Override public int getActionCount() { return cursor.getActionCount(); }
@Override public Object getNewInstance(ApplicatorObjectManager objectManager, DNA dna) { try { final DNACursor cursor = dna.getCursor(); Assert.assertTrue("DNA missing physical action", cursor.next()); PhysicalAction physicalAction = cursor.getPhysicalAction(); final Object lockType = physicalAction.getObject(); Assert.assertTrue("DNA missing physical action", cursor.next()); physicalAction = cursor.getPhysicalAction(); Object lockStrategy = objectManager.lookupObject((ObjectID) physicalAction.getObject()); /* * This trickery is necessary to avoid getting an instance of class loaded by the wrong classloader. Otherwise we * get ClassCastExceptions when we try and store the result in the ConcurrentDistributedMap instance. */ Class cdmClazz = objectManager.getClassFor(CDM_DSO, LoaderDescription.fromString(dna .getDefiningLoaderDescription())); final Method newCDM = cdmClazz.getMethod("newCDM", NEW_CDM_ARGS); newCDM.setAccessible(true); return newCDM.invoke(null, lockType, lockStrategy); } catch (final Exception e) { throw new RuntimeException(e); } }
@Override public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object pojo) throws IOException, ClassNotFoundException { Set set = (Set) pojo; DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { LogicalAction action = cursor.getLogicalAction(); int method = action.getMethod(); Object[] params = action.getParameters(); apply(objectManager, set, method, params); } }
public Object getNewInstance(ClientObjectManager objectManager, DNA dna) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); Assert.assertEquals(8, cursor.getActionCount()); cursor.next(encoding); PhysicalAction a = cursor.getPhysicalAction(); Class persistenceClass = (Class) a.getObject(); cursor.next(encoding); a = cursor.getPhysicalAction(); String entityName = (String) a.getObject(); cursor.next(encoding); a = cursor.getPhysicalAction(); Object[] interfacesObj = (Object[]) a.getObject(); Class[] interfaces = new Class[interfacesObj.length]; System.arraycopy(interfacesObj, 0, interfaces, 0, interfacesObj.length); cursor.next(encoding); a = cursor.getPhysicalAction(); Serializable id = (Serializable) a.getObject(); cursor.next(encoding); a = cursor.getPhysicalAction(); ObjectID targetId = (ObjectID) a.getObject(); Object target = objectManager.lookupObject(targetId); cursor.next(encoding); a = cursor.getPhysicalAction(); ObjectID getIdentifierId = (ObjectID) a.getObject();