David Jencks wrote:
On Oct 22, 2005, at 7:05 PM, Sachin Patel wrote:
Is there a way to load a "loaded configuration's" gbeans' without
starting the configuration? I'm basically wanting query a gbean's
persistent attribute value on a loaded but not started configuration.
Looking through the code the configuration's gbeans are loaded only
after its containing configuration is started
kernel.startGBean(configName);
kernel.invoke(configName, "loadGBeans", new Object[] {attributeStore},
new String[] {ManageableAttributeStore.class.getName()});
This makes sense, but I'm wondering if there is an alternate way to
get the gbeans attribute values on an already deployed and serialized
configuration.
I don't think we can do better at this point. There is no limit on the
complexity of attribute values, and the only restriction other than
serializablitly is that classes used must be loadable by the
configuration's classloader. This classloader is only available when
the configuration gbean is started.
If you're willing to use the kernel methods directly rather than the
methods on ConfigurationManager (I recommend sticking to using the
ConfigurationManager) you could pass your own ManageableAttributeStore
in that gets all the gbean datas and return an empty list. This would
result in you getting the gbean datas and no gbeans getting loaded.
Why do you want to avoid loading the gbeans?
Well I was looking into the shutdown script a little this weekend and we
need to be able to shutdown the correct kernel if multiple server
instances are running. In order to do so we need to get the correct
port number from the RMIRegistry gbean in order to be able to connect to
and shutdown the correct kernel. So I launched a temp kernel and loaded
the RMINamingConfiguration. From there, starting that configuration
fails since the RMIRegistry gbean's port number is already in use. So I
was looking a way to bypass starting the configuration and to just be
able to load that particular gbean and get its "port" attribute. From
there I can put togather the correct uri, create a kernel delegate and
shut it down.
thanks
david jencks
???
Sachin