private void writeLogicalAction(final DNAWriter dnaWriter, final LogicalAction action) { dnaWriter.addLogicalAction(action.getMethod(), action.getParameters()); }
@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 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); } }
@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 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); } }
@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); } } }
@Override public void apply(final ObjectID objectID, final DNACursor cursor, final ApplyTransactionInfo applyInfo) throws IOException { int eventCount = 0; while (cursor.next()) { final Object action = cursor.getAction(); if (action instanceof PhysicalAction) { final PhysicalAction physicalAction = (PhysicalAction)action; applyPhysicalAction(physicalAction, objectID, applyInfo); } else { // LogicalAction // notify subscribers about the mutation operation eventCount++; final LogicalAction logicalAction = (LogicalAction)action; final int method = logicalAction.getMethod(); final Object[] params = logicalAction.getParameters(); applyLogicalAction(objectID, applyInfo, method, params); } } if (eventCount != 0) { getOperationEventBus().post(Events.writeOperationCountChangeEvent(applyInfo.getServerTransactionID().getSourceID(), eventCount)); } }
public void hydrate(ClientObjectManager objectManager, TCObject 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); } } }
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); } } }
@Override public void apply(final ObjectID objectID, final DNACursor cursor, final ApplyTransactionInfo applyInfo) throws IOException { boolean broadcast = false; int eventCount = 0; while (cursor.next()) { final Object action = cursor.getAction(); if (action instanceof PhysicalAction) { applyPhysicalAction((PhysicalAction)action, objectID, applyInfo); } else { // LogicalAction eventCount++; final LogicalAction logicalAction = (LogicalAction)action; final int method = logicalAction.getMethod(); final Object[] params = logicalAction.getParameters(); applyLogicalAction(objectID, applyInfo, method, params); //TODO: requires refactoring, we should call super.apply() instead if (method == SerializationUtil.CLEAR || method == SerializationUtil.CLEAR_LOCAL_CACHE || method == SerializationUtil.DESTROY || method == SerializationUtil.SET_LAST_ACCESSED_TIME) { // clear needs to be broadcasted so local caches can be cleared elsewhere broadcast = true; } } } if (eventCount != 0) { getOperationEventBus().post(Events.writeOperationCountChangeEvent(applyInfo.getServerTransactionID().getSourceID(), eventCount)); } if (!broadcast) { applyInfo.ignoreBroadcastFor(objectID); } }
@Override public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object po) throws IOException, ClassNotFoundException { List list = (List) po; 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) { try { params[i] = objectManager.lookupObject((ObjectID) param); } catch (AbortedOperationException e) { throw new TCRuntimeException(e); } } } try { apply(list, method, params); } catch (IndexOutOfBoundsException ioobe) { logger.error("Error applying update to " + po, ioobe); } } }
@Override public void hydrate(ClientObjectManager objectManager, TCObject tcObject, DNA dna, Object po) throws IOException, ClassNotFoundException { List list = (List) po; 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) { try { params[i] = objectManager.lookupObject((ObjectID) param); } catch (AbortedOperationException e) { throw new TCRuntimeException(e); } } } try { apply(list, method, params); } catch (IndexOutOfBoundsException ioobe) { logger.error("Error applying update to " + po, ioobe); } } }
Object[] params = logicalAction.getParameters();
Object[] params = logicalAction.getParameters();
Object[] params = logicalAction.getParameters();