@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 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 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); } }
public void hydrate(ApplicatorObjectManager objectManager, TCObjectExternal tcObject, DNA dna, Object pojo) throws IOException, ClassNotFoundException { List items = (List) pojo; DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { LogicalAction action = cursor.getLogicalAction(); int method = action.getMethod(); Object[] params = action.getParameters(); for (int i = 0, n = params.length; i < n; i++) { Object param = params[i]; if (param instanceof ObjectID) { params[i] = objectManager.lookupObject((ObjectID) param); } } try { apply(items, method, params); } catch (IndexOutOfBoundsException ioobe) { logger.error("Error applying update to " + pojo, ioobe); } } }
takeLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(PUT_LOCK_FIELD_NAME)) { putLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(CAPACITY_FIELD_NAME)) { capacity = value;
takeLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(PUT_LOCK_FIELD_NAME)) { putLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(CAPACITY_FIELD_NAME)) { capacity = value;
takeLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(PUT_LOCK_FIELD_NAME)) { putLock = objectManager.lookupObject((ObjectID) value); } else if (fieldName.equals(CAPACITY_FIELD_NAME)) { capacity = value;
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); }
final Object lockStrategy = objectManager.lookupObject((ObjectID) physicalAction.getObject());
final Object lockStrategy = objectManager.lookupObject((ObjectID) physicalAction.getObject());