/** * Has the object changed since last replication * and is not in a locked state * @return boolean */ @Override public boolean isDirty() { return getDeltaRequest().getSize()>0; }
/** * Has the object changed since last replication * and is not in a locked state * @return boolean */ @Override public boolean isDirty() { return getDeltaRequest().getSize()>0; }
/** * Has the object changed since last replication * and is not in a locked state * @return boolean */ @Override public boolean isDirty() { return getDeltaRequest().getSize()>0; }
/** * Load Deltarequest from external node * Load the Class at container classloader * @see DeltaRequest#readExternal(java.io.ObjectInput) * @param session * @param data message data * @return The request * @throws ClassNotFoundException * @throws IOException */ protected DeltaRequest deserializeDeltaRequest(DeltaSession session, byte[] data) throws ClassNotFoundException, IOException { try { session.lock(); ReplicationStream ois = getReplicationStream(data); session.getDeltaRequest().readExternal(ois); ois.close(); return session.getDeltaRequest(); }finally { session.unlock(); } }
/** * Returns a diff and sets the dirty map to false * @return byte[] * @throws IOException */ @Override public byte[] getDiff() throws IOException { try{ lock(); return getDeltaRequest().serialize(); }finally{ unlock(); } }
/** * Returns a diff and sets the dirty map to false * @return byte[] * @throws IOException */ @Override public byte[] getDiff() throws IOException { try{ lock(); return getDeltaRequest().serialize(); }finally{ unlock(); } }
/** * Returns a diff and sets the dirty map to false * @return a serialized view of the difference * @throws IOException IO error serializing */ @Override public byte[] getDiff() throws IOException { lock(); try { return getDeltaRequest().serialize(); } finally{ unlock(); } }
/** * Applies a diff to an existing object. * @param diff byte[] * @param offset int * @param length int * @throws IOException */ @Override public void applyDiff(byte[] diff, int offset, int length) throws IOException, ClassNotFoundException { try { lock(); ReplicationStream stream = ( (ClusterManager) getManager()).getReplicationStream(diff, offset, length); ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); try { ClassLoader[] loaders = getClassLoaders(); if (loaders != null && loaders.length > 0) Thread.currentThread().setContextClassLoader(loaders[0]); getDeltaRequest().readExternal(stream); getDeltaRequest().execute(this, ((ClusterManager)getManager()).isNotifyListenersOnReplication()); } finally { Thread.currentThread().setContextClassLoader(contextLoader); } }finally { unlock(); } }
/** * Load Deltarequest from external node * Load the Class at container classloader * @see DeltaRequest#readExternal(java.io.ObjectInput) * @param session Corresponding session * @param data message data * @return The request * @throws ClassNotFoundException Serialization error * @throws IOException IO error with serialization */ protected DeltaRequest deserializeDeltaRequest(DeltaSession session, byte[] data) throws ClassNotFoundException, IOException { session.lock(); try { ReplicationStream ois = getReplicationStream(data); session.getDeltaRequest().readExternal(ois); ois.close(); return session.getDeltaRequest(); } finally { session.unlock(); } }
/** * Load Deltarequest from external node * Load the Class at container classloader * @see DeltaRequest#readExternal(java.io.ObjectInput) * @param session * @param data message data * @return The request * @throws ClassNotFoundException * @throws IOException */ protected DeltaRequest deserializeDeltaRequest(DeltaSession session, byte[] data) throws ClassNotFoundException, IOException { try { session.lock(); ReplicationStream ois = getReplicationStream(data); session.getDeltaRequest().readExternal(ois); ois.close(); return session.getDeltaRequest(); }finally { session.unlock(); } }
/** * Applies a diff to an existing object. * @param diff Serialized diff data * @param offset Array offset * @param length Array length * @throws IOException IO error deserializing */ @Override public void applyDiff(byte[] diff, int offset, int length) throws IOException, ClassNotFoundException { lock(); try (ObjectInputStream stream = ((ClusterManager) getManager()).getReplicationStream(diff, offset, length)) { ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); try { ClassLoader[] loaders = getClassLoaders(); if (loaders != null && loaders.length > 0) Thread.currentThread().setContextClassLoader(loaders[0]); getDeltaRequest().readExternal(stream); getDeltaRequest().execute(this, ((ClusterManager)getManager()).isNotifyListenersOnReplication()); } finally { Thread.currentThread().setContextClassLoader(contextLoader); } } finally { unlock(); } }
/** * Applies a diff to an existing object. * @param diff byte[] * @param offset int * @param length int * @throws IOException */ @Override public void applyDiff(byte[] diff, int offset, int length) throws IOException, ClassNotFoundException { try { lock(); ReplicationStream stream = ( (ClusterManager) getManager()).getReplicationStream(diff, offset, length); ClassLoader contextLoader = Thread.currentThread().getContextClassLoader(); try { ClassLoader[] loaders = getClassLoaders(); if (loaders != null && loaders.length > 0) Thread.currentThread().setContextClassLoader(loaders[0]); getDeltaRequest().readExternal(stream); getDeltaRequest().execute(this, ((ClusterManager)getManager()).isNotifyListenersOnReplication()); } finally { Thread.currentThread().setContextClassLoader(contextLoader); } }finally { unlock(); } }
DeltaRequest deltaRequest = session.getDeltaRequest(); session.lock(); SessionMessage msg = null;
DeltaRequest deltaRequest = session.getDeltaRequest(); session.lock(); SessionMessage msg = null;
DeltaRequest deltaRequest = session.getDeltaRequest(); session.lock(); if (deltaRequest.getSize() > 0) {