@Override public TraversedReferences getPortableObjects(final Object pojo, final TraversedReferences addTo) { return this.applicator.getPortableObjects(pojo, addTo); }
@Override public Object getNewInstanceFromNonDefaultConstructor(final DNA dna) throws IOException, ClassNotFoundException { final Object o = this.applicator.getNewInstance(this.objectManager, dna); if (o == null) { throw new AssertionError("Can't find suitable constructor for class: " + getName() + "."); } return o; }
@Override public void dehydrate(final TCObject tcObject, final DNAWriter writer, final Object pojo) { try { this.applicator.dehydrate(this.objectManager, tcObject, writer, pojo); } catch (final ConcurrentModificationException cme) { // try to log some useful stuff about the pojo in question here. // This indicates improper locking, but is certainly possible final String type = pojo == null ? "null" : pojo.getClass().getName(); final String toString = String.valueOf(pojo); final int ihc = System.identityHashCode(pojo); logger.error("Shared object (presumably new) modified during dehydrate (type " + type + ", ihc " + ihc + "): " + toString, cme); throw cme; } }
@Override public void hydrate(final TCObject tcObject, final DNA dna, final Object pojo, final boolean force) throws IOException, ClassNotFoundException { // Okay...long story here The application of the DNA used to be a synchronized(applicator) block. As best as Steve // and I could tell, the synchronization was solely a memory boundary and not a mutual exlusion mechanism. For the // time being, we have resolved that we need no synchronization here (either for memory, or exclusion). The memory // barrier aspect isn't known to be a problem and the concurrency is handled by the server (ie. we won't get // concurrent updates). At some point it would be a good idea to detect (and error out) when updates are received // from L2 but local read/writes have been made on the target TCObject final long localVersion = tcObject.getVersion(); final long dnaVersion = dna.getVersion(); if (force || (localVersion < dnaVersion)) { tcObject.setVersion(dnaVersion); this.applicator.hydrate(this.objectManager, tcObject, dna, pojo); } else if (logger.isDebugEnabled()) { logger .debug("IGNORING UPDATE, local object at version " + localVersion + ", dna update is version " + dnaVersion); } }
@Override public Object getNewInstanceFromNonDefaultConstructor(final DNA dna, PlatformService platformService) throws IOException, ClassNotFoundException { final Object o = this.applicator.getNewInstance(this.objectManager, dna, platformService); if (o == null) { throw new AssertionError("Can't find suitable constructor for class: " + getName() + "."); } return o; }
@Override public void dehydrate(final TCObject tcObject, final DNAWriter writer, final Object pojo) { try { this.applicator.dehydrate(this.objectManager, tcObject, writer, pojo); } catch (final ConcurrentModificationException cme) { // try to log some useful stuff about the pojo in question here. // This indicates improper locking, but is certainly possible final String type = pojo == null ? "null" : pojo.getClass().getName(); final String toString = String.valueOf(pojo); final int ihc = System.identityHashCode(pojo); logger.error("Shared object (presumably new) modified during dehydrate (type " + type + ", ihc " + ihc + "): " + toString, cme); throw cme; } }
@Override public void hydrate(final TCObject tcObject, final DNA dna, final Object pojo, final boolean force) throws IOException, ClassNotFoundException { // Okay...long story here The application of the DNA used to be a synchronized(applicator) block. As best as Steve // and I could tell, the synchronization was solely a memory boundary and not a mutual exlusion mechanism. For the // time being, we have resolved that we need no synchronization here (either for memory, or exclusion). The memory // barrier aspect isn't known to be a problem and the concurrency is handled by the server (ie. we won't get // concurrent updates). At some point it would be a good idea to detect (and error out) when updates are received // from L2 but local read/writes have been made on the target TCObject final long localVersion = tcObject.getVersion(); final long dnaVersion = dna.getVersion(); if (force || (localVersion < dnaVersion)) { tcObject.setVersion(dnaVersion); this.applicator.hydrate(this.objectManager, tcObject, dna, pojo); } else if (logger.isDebugEnabled()) { logger .debug("IGNORING UPDATE, local object at version " + localVersion + ", dna update is version " + dnaVersion); } }
@Override public Object getNewInstanceFromNonDefaultConstructor(final DNA dna) throws IOException, ClassNotFoundException { final Object o = this.applicator.getNewInstance(this.objectManager, dna); if (o == null) { throw new AssertionError("Can't find suitable constructor for class: " + getName() + "."); } return o; }
@Override public TraversedReferences getPortableObjects(final Object pojo, final TraversedReferences addTo) { return this.applicator.getPortableObjects(pojo, addTo); }
@Override public void dehydrate(final TCObject tcObject, final DNAWriter writer, final Object pojo) { try { this.applicator.dehydrate(this.objectManager, tcObject, writer, pojo); } catch (final ConcurrentModificationException cme) { // try to log some useful stuff about the pojo in question here. // This indicates improper locking, but is certainly possible final String type = pojo == null ? "null" : pojo.getClass().getName(); final String toString = String.valueOf(pojo); final int ihc = System.identityHashCode(pojo); logger.error("Shared object (presumably new) modified during dehydrate (type " + type + ", ihc " + ihc + "): " + toString, cme); throw cme; } }
@Override public void hydrate(final TCObject tcObject, final DNA dna, final Object pojo, final boolean force) throws IOException, ClassNotFoundException { // Okay...long story here The application of the DNA used to be a synchronized(applicator) block. As best as Steve // and I could tell, the synchronization was solely a memory boundary and not a mutual exlusion mechanism. For the // time being, we have resolved that we need no synchronization here (either for memory, or exclusion). The memory // barrier aspect isn't known to be a problem and the concurrency is handled by the server (ie. we won't get // concurrent updates). At some point it would be a good idea to detect (and error out) when updates are received // from L2 but local read/writes have been made on the target TCObject final long localVersion = tcObject.getVersion(); final long dnaVersion = dna.getVersion(); if (force || (localVersion < dnaVersion)) { tcObject.setVersion(dnaVersion); this.applicator.hydrate(this.objectManager, tcObject, dna, pojo); } else if (logger.isDebugEnabled()) { logger .debug("IGNORING UPDATE, local object at version " + localVersion + ", dna update is version " + dnaVersion); } }
@Override public TraversedReferences getPortableObjects(final Object pojo, final TraversedReferences addTo) { return this.applicator.getPortableObjects(pojo, addTo); }