+1 on not restricting to String if where we can get around it.
+10 on better documenting the limitation.
I think the String limitation for Region comes from the old o.j.c.marshall.Region. This
limitation was added because the Fqn was used in the marshalling code by a message
recipient to determine what classloader to use to deserialize the message. That led to a
chicken-or-egg problem: if one of the objects in the Fqn itself required the classloader,
you were out of luck.
Solving that problem didn't really require use of String only. It just requires that
no classes not visible to TreeCacheMarshaller.class.getClassLoader() be used in the Region
Fqn. That's significantly less restrictive and can be documented.
JGroups partial state transfer adds a new problem in that the JGroups API requires use of
String instead of Object as the identifier of the partial state. It would be nice if that
were changed in a later release., although as an API change it would probably take a while
to work its way into JBC.
For now, can we think of a way to use a String as a substitute for the Region Fqn in the
partial state transfer call? E.g. restrict the components of a Region Fqn to
String/Number/Enum, all of which can be fairly safely converted to a String. Or hopefully
something more elegant than that :-)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983895#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...