axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eran Chinthaka <>
Subject Re: [Axis2]Clustering: Removing/Deprecating AbstractContext#getProperties()
Date Mon, 21 May 2007 03:34:37 GMT
Hash: SHA1


How abt leaving that method, but making it immutable when you are
returning it.

One possible implementation is like this.

final Map propertiesMap = new HashMap(properties);
return propertiesMap;

The person who uses it has to pay for it as this method copies the whole
thing, but this is better than nothing.

One of the reasons why I like this is that you can see/list all the
properties in it. If you use this way

1. there won't be any API changes
2. you get what you want as there won't be any non-trackable changes to
property map so you are happy
3. viewServiceContext.jsp doesn't need any modifications so Deepal is
happy ;)


Afkham Azeez wrote:
> When it comes to replicating properties in the context hierarchy, we
> should only transmit the differences, i.e. only
> additions/updates/removals to/from the properties object should be sent
> to the group.
> However, AbstractContext#getProperties() is public. Anybody who gets
> hold of this Map can add items to it, remove items from it, or update
> items in it. This makes it impossible for us to track the changes to the
> properties Map. Also, this is bad encapsulation. Users can add any
> object as the key to this Map which will break many things. I suggest we
> remove this method(or deprecate it?) and introduce the following;
> public Iterator getPropertyNames(); // Will return only the property
> names (keys in the Map)
> public void removeProperty(String key);
> public Object getProperty(String key);
> public void setProperty(String key, Object value);
> Without such a change, we may not be able to properly handle replication
> of the properties.
> -- 
> Thanks
> Afkham Azeez
> GPG Fingerprint: 643F C2AF EB78 F886 40C9  B2A2 4AE2 C887 665E 0760

Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message