JBAS-4277 notes that HAServiceMBeanSupport should be modified to take advantage of
JBAS-4106, which allows association of a classloader with the cluster's RPC handler.
HAServiceMBeanSupport is a base class intended for extension by cluster services. This
class allows extenders to invoke RPC methods on a cluster without having to register the
service as a handler, since the base class does this during startService().
To support invocation of RPC calls in the context of a scoped classloader, it's
necessary to provide a reference to the classloader when registering the handler. The
purpose of this issue is to modify HAServiceMBeanSupport to allow this registration.
One simple solution is to modify HAServiceMBeanSupport by adding
get/setRPCClassLoader(ClassLoader) to the api and implementation. This will set an
instance variable in the base class for the classloader. When the service is registered
as an RPCHandler with HAPartition, the classloader registration will be used if the
variable is non-null.
This approach should be fine if the classloader is set before startService() is called on
the base class. However services aren't required to explicitly invoke this method so
this could require services to override startService() , set the classloader, and then
invoke it on the super class.
To handle services which don't want to override startService(), the
setRPCClassLoader() method can re-register the RPC handler if it's already been
registered (i.e., by HAServiceMBeanSupport.startService). This is supported by
ClusterPartition and will result in the classloader being associated with the service as
desired.
Once the client has set the classloader, subsequent RPC calls will use the designated
classloader.
Thoughts?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065149#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...