@Override public void setValue(String fieldName, Object obj) { try { final TransparentAccess ta = (TransparentAccess) getPeerObject(); if (ta == null) { throw new AssertionError(); } final TCField field = getTCClass().getField(fieldName); if (field == null) { // logger.warn("Data for field:" + fieldName + " was recieved but that field does not exist in class:"); return; } if (obj instanceof ObjectID) { // no references should ever be cleared, as no references itself throw new AssertionError(); } else { ta.__tc_setfield(field.getName(), obj); } } catch (final Exception e) { // TODO: More elegant exception handling. throw new com.tc.object.dna.api.DNAException(e); } }
@Override public void setValue(String fieldName, Object obj) { try { final TransparentAccess ta = (TransparentAccess) getPeerObject(); if (ta == null) { throw new AssertionError(); } final TCField field = getTCClass().getField(fieldName); if (field == null) { // logger.warn("Data for field:" + fieldName + " was recieved but that field does not exist in class:"); return; } if (obj instanceof ObjectID) { // no references should ever be cleared, as no references itself throw new AssertionError(); } else { ta.__tc_setfield(field.getName(), obj); } } catch (final Exception e) { // TODO: More elegant exception handling. throw new com.tc.object.dna.api.DNAException(e); } }
/** * Reconstitutes the object using the data in the DNA strand. XXX: We may need to signal (via a different signature or * args) that the hydration is intended to initialize the object from scratch or if it's a delta. We must avoid * creating a new instance of the peer object if the strand is just a delta.<br> * <p> * TODO:: Split into two interface, peer is null if not new. * * @throws ClassNotFoundException */ @Override public void hydrate(final DNA from, final boolean force, final WeakReference peer) throws ClassNotFoundException { synchronized (getResolveLock()) { if (peer != null) { setPeerObject(peer); } final Object po = getPeerObject(); if (po == null) { return; } try { this.tcClazz.hydrate(this, from, po, force); } catch (final ClassNotFoundException e) { logger.warn("Re-throwing Exception: ", e); throw e; } catch (final IOException e) { logger.warn("Re-throwing Exception: ", e); throw new DNAException(e); } } }
/** * Reconstitutes the object using the data in the DNA strand. XXX: We may need to signal (via a different signature or * args) that the hydration is intended to initialize the object from scratch or if it's a delta. We must avoid * creating a new instance of the peer object if the strand is just a delta.<br> * <p> * TODO:: Split into two interface, peer is null if not new. * * @throws ClassNotFoundException */ @Override public void hydrate(final DNA from, final boolean force, final WeakReference peer) throws ClassNotFoundException { synchronized (getResolveLock()) { if (peer != null) { setPeerObject(peer); } final Object po = getPeerObject(); if (po == null) { return; } try { getTCClass().hydrate(this, from, po, force); } catch (final IOException ioe) { LOGGER.warn(ioe); throw new DNAException(ioe); } } }
/** * Reconstitutes the object using the data in the DNA strand. XXX: We may need to signal (via a different signature or * args) that the hydration is intended to initialize the object from scratch or if it's a delta. We must avoid * creating a new instance of the peer object if the strand is just a delta.<br> * <p> * TODO:: Split into two interface, peer is null if not new. * * @throws ClassNotFoundException */ @Override public void hydrate(final DNA from, final boolean force, final WeakReference peer) throws ClassNotFoundException { synchronized (getResolveLock()) { if (peer != null) { setPeerObject(peer); } final Object po = getPeerObject(); if (po == null) { return; } try { this.tcClazz.hydrate(this, from, po, force); } catch (final ClassNotFoundException e) { logger.warn("Re-throwing Exception: ", e); throw e; } catch (final IOException e) { logger.warn("Re-throwing Exception: ", e); throw new DNAException(e); } } }
this.state.apply(this.id, cursor, applyInfo); } catch (final IOException e) { throw new DNAException(e);
@Override public void setValue(final String fieldName, final Object obj) { try { final TransparentAccess ta = (TransparentAccess) getPeerObject(); if (ta == null) { // Object was GC'd so return which should lead to a re-retrieve return; } clearReference(fieldName); final TCField field = getTCClass().getField(fieldName); if (field == null) { logger.warn("Data for field:" + fieldName + " was recieved but that field does not exist in class:"); return; } if (obj instanceof ObjectID) { setReference(fieldName, (ObjectID) obj); ta.__tc_setfield(field.getName(), null); } else { // clean this up ta.__tc_setfield(field.getName(), obj); } } catch (final Exception e) { logger.error("Error setting field [" + fieldName + "] to value of type " + typeOf(obj) + " on instance of " + getTCClass().getPeerClass().getName() + " that has fields: " + fieldDesc()); // TODO: More elegant exception handling. throw new com.tc.object.dna.api.DNAException(e); } }
@Override public void setValue(final String fieldName, final Object obj) { try { final TransparentAccess ta = (TransparentAccess) getPeerObject(); if (ta == null) { // Object was GC'd so return which should lead to a re-retrieve return; } clearReference(fieldName); final TCField field = getTCClass().getField(fieldName); if (field == null) { logger.warn("Data for field:" + fieldName + " was recieved but that field does not exist in class:"); return; } if (obj instanceof ObjectID) { setReference(fieldName, (ObjectID) obj); ta.__tc_setfield(field.getName(), null); } else { // clean this up ta.__tc_setfield(field.getName(), obj); } } catch (final Exception e) { logger.error("Error setting field [" + fieldName + "] to value of type " + typeOf(obj) + " on instance of " + getTCClass().getPeerClass().getName() + " that has fields: " + fieldDesc()); // TODO: More elegant exception handling. throw new com.tc.object.dna.api.DNAException(e); } }