/** * Retrieves an object given a key. The retrieved property will not be replicated to * other nodes in the clustered scenario. * * @param key - if not found, will return null * @return Returns the property. */ public Object getPropertyNonReplicable(String key) { Object obj = properties == null ? null : properties.get(key); if ((obj == null) && (parent != null)) { obj = parent.getPropertyNonReplicable(key); } return obj; }
/** * Retrieves an object given a key. The retrieved property will not be replicated to * other nodes in the clustered scenario. * * @param key - if not found, will return null * @return Returns the property. */ public Object getPropertyNonReplicable(String key) { Object obj = properties == null ? null : properties.get(key); if ((obj == null) && (parent != null)) { obj = parent.getPropertyNonReplicable(key); } return obj; }
private static void fillProperties(UpdateStateCommand updateCmd, AbstractContext context, String[] propertyNames) throws ClusteringFault { Map diffs = context.getPropertyDifferences(); for (String key : propertyNames) { Object prop = context.getPropertyNonReplicable(key); // First check whether it is serializable if (isSerializable(prop)) { if (log.isDebugEnabled()) { log.debug("sending property =" + key + "-" + prop); } PropertyDifference diff = (PropertyDifference) diffs.get(key); if (diff != null) { diff.setValue(prop); updateCmd.addProperty(diff); // Remove the diff? diffs.remove(key); } } else { String msg = "Trying to replicate non-serializable property " + key + " in context " + context; throw new ClusteringFault(msg); } } }
private static void fillProperties(UpdateStateCommand updateCmd, AbstractContext context, String[] propertyNames) throws ClusteringFault { Map diffs = context.getPropertyDifferences(); for (String key : propertyNames) { Object prop = context.getPropertyNonReplicable(key); // First check whether it is serializable if (isSerializable(prop)) { if (log.isDebugEnabled()) { log.debug("sending property =" + key + "-" + prop); } PropertyDifference diff = (PropertyDifference) diffs.get(key); if (diff != null) { diff.setValue(prop); updateCmd.addProperty(diff); // Remove the diff? diffs.remove(key); } } else { String msg = "Trying to replicate non-serializable property " + key + " in context " + context; throw new ClusteringFault(msg); } } }
for (Iterator iter = context.getPropertyNames(); iter.hasNext();) { String key = (String) iter.next(); Object value = context.getPropertyNonReplicable(key); if (isSerializable(value)) {
for (Iterator iter = context.getPropertyNames(); iter.hasNext();) { String key = (String) iter.next(); Object value = context.getPropertyNonReplicable(key); if (isSerializable(value)) {