/** * Retrieves an object given a key. Only searches at this level * i.e. getLocalProperty on MessageContext does not look in * the OperationContext properties map if a local result is not * found. * * @param key - if not found, will return null * @return Returns the property. */ public Object getLocalProperty(String key) { Object obj = properties == null ? null : properties.get(key); if ((obj == null) && (parent != null)) { // This is getLocalProperty() don't search the hierarchy. } else { if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { // Assume that a property is which is read may be updated. // i.e. The object pointed to by 'value' may be modified after it is read addPropertyDifference(key, obj, false); } } return obj; }
/** * Retrieves an object given a key. Only searches at this level * i.e. getLocalProperty on MessageContext does not look in * the OperationContext properties map if a local result is not * found. * * @param key - if not found, will return null * @return Returns the property. */ public Object getLocalProperty(String key) { Object obj = properties == null ? null : properties.get(key); if ((obj == null) && (parent != null)) { // This is getLocalProperty() don't search the hierarchy. } else { if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { // Assume that a property is which is read may be updated. // i.e. The object pointed to by 'value' may be modified after it is read addPropertyDifference(key, obj, false); } } return obj; }
/** * Remove a property. Only properties at this level will be removed. * Properties of the parents cannot be removed using this method. * * @param key */ public synchronized void removeProperty(String key) { if(properties == null){ return; } Object value = properties.get(key); if (value != null) { if (properties != null) { while (true) { try { properties.remove(key); break; } catch (ConcurrentModificationException cme) { } } } if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, value, true); } } }
/** * Remove a property. Only properties at this level will be removed. * Properties of the parents cannot be removed using this method. * * @param key */ public synchronized void removeProperty(String key) { if(properties == null){ return; } Object value = properties.get(key); if (value != null) { if (properties != null) { while (true) { try { properties.remove(key); break; } catch (ConcurrentModificationException cme) { } } } if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, value, true); } } }
/** * Retrieves an object given a key. * * @param key - if not found, will return null * @return Returns the property. */ public Object getProperty(String key) { Object obj = properties == null ? null : properties.get(key); if (obj!=null) { // Assume that a property which is read may be updated. // i.e. The object pointed to by 'value' may be modified after it is read if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, obj, false); } } else if (parent!=null) { obj = parent.getProperty(key); } return obj; }
/** * Retrieves an object given a key. * * @param key - if not found, will return null * @return Returns the property. */ public Object getProperty(String key) { Object obj = properties == null ? null : properties.get(key); if (obj!=null) { // Assume that a property which is read may be updated. // i.e. The object pointed to by 'value' may be modified after it is read if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, obj, false); } } else if (parent!=null) { obj = parent.getProperty(key); } return obj; }
/** * Store a property in this context * * @param key * @param value */ public void setProperty(String key, Object value) { initPropertiesMap(); while (true) { try { properties.put(key, value); break; } catch (ConcurrentModificationException cme) { } } if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, value, false); } if (DEBUG_ENABLED) { debugPropertySet(key, value); } }
/** * Store a property in this context * * @param key * @param value */ public void setProperty(String key, Object value) { initPropertiesMap(); while (true) { try { properties.put(key, value); break; } catch (ConcurrentModificationException cme) { } } if(!isClusteringCheckDone) { isClusteringCheckDone = true; isClusteringOn = needPropertyDifferences(); } if(isClusteringOn) { addPropertyDifference(key, value, false); } if (DEBUG_ENABLED) { debugPropertySet(key, value); } }