@Override public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object po) throws IOException, IllegalArgumentException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isArrayElement()) { setArrayElement(a.getArrayIndex(), a.getObject(), tcObject, po); } else if (a.isEntireArray() || a.isSubArray()) { Object array = a.getObject(); int offset = a.isEntireArray() ? 0 : a.getArrayIndex(); if (ClassUtils.isPrimitiveArray(array)) { System.arraycopy(array, 0, po, offset, Array.getLength(array)); } else { hydrateNonPrimitiveArray((Object[]) array, tcObject, po, offset); } } else { throw Assert.failure("Invalid physical action for array"); } } }
@Override public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object po) throws IOException, IllegalArgumentException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isArrayElement()) { setArrayElement(a.getArrayIndex(), a.getObject(), tcObject, po); } else if (a.isEntireArray() || a.isSubArray()) { Object array = a.getObject(); int offset = a.isEntireArray() ? 0 : a.getArrayIndex(); if (ClassUtils.isPrimitiveArray(array)) { System.arraycopy(array, 0, po, offset, Array.getLength(array)); } else { hydrateNonPrimitiveArray((Object[]) array, tcObject, po, offset); } } else { throw Assert.failure("Invalid physical action for array"); } } }
@Override public void apply(final ObjectID objectID, final DNACursor cursor, final ApplyTransactionInfo includeIDs) throws IOException { while (cursor.next()) { Object action = cursor.getAction(); if (action instanceof PhysicalAction) { final PhysicalAction pa = (PhysicalAction) action; if (pa.isEntireArray()) { this.componentObjects = (Object[]) pa.getObject(); } else { configMap.put(pa.getFieldName(), pa.getObject()); } } else { final LogicalAction logicalAction = (LogicalAction) action; final int method = logicalAction.getMethod(); final Object[] params = logicalAction.getParameters(); applyMethod(objectID, method, params); } } }
public void hydrate(final ApplicatorObjectManager objectManager, final TCObjectExternal tco, final DNA dna, final Object pojo) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isEntireArray()) { tco.setValue(VALUE_FIELD, a.getObject()); } else { tco.setValue(a.getFieldName(), a.getObject()); } } } }
public void hydrate(final ApplicatorObjectManager objectManager, final TCObjectExternal tco, final DNA dna, final Object pojo) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isEntireArray()) { tco.setValue(VALUE_FIELD, a.getObject()); } else { tco.setValue(a.getFieldName(), a.getObject()); } } } }
public void hydrate(final ApplicatorObjectManager objectManager, final TCObjectExternal tco, final DNA dna, final Object pojo) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isEntireArray()) { tco.setValue(VALUE_FIELD, a.getObject()); } else { tco.setValue(a.getFieldName(), a.getObject()); } } } }
@Override public void apply(final ObjectID objectID, final DNACursor cursor, final ApplyTransactionInfo includeIDs) throws IOException { while (cursor.next()) { final PhysicalAction pa = cursor.getPhysicalAction(); if (pa.isEntireArray()) { final Object array = pa.getObject(); if (array instanceof byte[]) { value = (byte[]) array; includeIDs.getServerEventRecorder().recordEventValue(objectID, value); } else { final String type = safeTypeName(array); logger.error("received array of type " + type + " -- ignoring it"); } } else { logger.error("received physical action: " + pa + " -- ignoring it"); } Preconditions.checkState(!cursor.next(), "Only one iteration expected"); } }
private void writePhysicalAction(final DNAWriter dnaWriter, final PhysicalAction action) { if (action.isTruePhysical()) { dnaWriter.addPhysicalAction(action.getFieldName(), action.getObject(), action.isReference()); } else if (action.isArrayElement()) { dnaWriter.addArrayElementAction(action.getArrayIndex(), action.getObject()); } else if (action.isEntireArray()) { dnaWriter.setArrayLength(Array.getLength(action.getObject())); dnaWriter.addEntireArray(action.getObject()); } else if (action.isSubArray()) { dnaWriter.addSubArrayAction(action.getArrayIndex(), action.getObject(), Array.getLength(action.getObject())); } else { throw new AssertionError("Unknown Physical Action : " + action); } }
public void hydrate(final ClientObjectManager objMgr, final TCObject tco, final DNA dna, final Object pojo) throws IOException, ClassNotFoundException { DNACursor cursor = dna.getCursor(); while (cursor.next(encoding)) { PhysicalAction a = cursor.getPhysicalAction(); if (a.isEntireArray()) { tco.setValue(VALUE_FIELD, a.getObject()); } else { tco.setValue(a.getFieldName(), a.getObject()); } } } }