public Relay.Target create(UID uid, MessageAddress source, Object content, Relay.Token owner) { // The content is the relayed object, just cast back to a DefenseCondition DefenseCondition dc = (DefenseCondition) content; dc.setLocal(false); Logger logger = Logging.getLogger(getClass()); logger.debug( "*** Created DefenseCondition Relay of type: " + dc.getClass().getName() + "*********************"); return dc; }
/** * Update with new content. * * @return true if the update changed the Relay. The LP should publishChange the Relay. This * implementation returns true only if the new value differs from the current value. */ public int updateContent(Object content, Relay.Token token) { /* removed as unnecessary sjf 8/29/2003 if (token != owner) { Logger logger = Logging.getLogger(getClass()); if (logger.isInfoEnabled()) { logger.info( "Ignoring \"Not owner\" bug in \"updateContent()\","+ " possibly a rehydration bug (token="+ token+", owner="+owner+")"); } } */ DefenseCondition newDC = (DefenseCondition) content; if (getValue().compareTo(newDC.getValue()) != 0) { setValue(newDC.getValue()); return Relay.CONTENT_CHANGE; } return Relay.NO_CHANGE; }