Author: davidillsley Date: Fri Oct 19 06:11:25 2007 New Revision: 586421 URL: http://svn.apache.org/viewvc?rev=586421&view=rev Log: Adding getLocalProperty to AbstractContext
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?rev=586421&r1=586420&r2=586421&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Fri Oct 19 06:11:25 2007 @@ -103,6 +103,28 @@ } /** + * 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 { + + // 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); + } + return obj; + } + + /** * Retrieves an object given a key. The retrieved property will not be replicated to * other nodes in the clustered scenario. * Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java?rev=586421&r1=586420&r2=586421&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/MessageContext.java Fri Oct 19 06:11:25 2007 @@ -861,6 +861,33 @@ /** * Retrieves a property value. The order of search is as follows: search in + * my own options and then look locally. Does not search up the hierarchy. + * + * @param name name of the property to search for + * @return the value of the property, or null if the property is not found + */ + public Object getLocalProperty(String name) { + if (LoggingControl.debugLoggingAllowed) { + checkActivateWarning("getProperty"); + } + + // search in my own options + Object obj = super.getLocalProperty(name); + if (obj != null) { + return obj; + } + + obj = options.getProperty(name); + if (obj != null) { + return obj; + } + + // tough + return null; + } + + /** + * Retrieves a property value. The order of search is as follows: search in * my own options and then look in my context hierarchy. Since its possible * that the entire hierarchy is not present, I will start at whatever level * has been set and start there. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]