On Aug 25, 2005, at 5:59 PM, Aaron Mulder wrote:
On Thu, 25 Aug 2005, David Jencks wrote:
1. Use the gbean.enabled attribute extensively and include both the
jetty and tomcat servers in the main config, with possibly one of
them
disabled: extend the config db so it can save the enabled/disabled
state. Then you can turn the one you want on or off.
I wasn't aware of such an attribute.
It is not an attribute. There are two methods on the kernel to
control the enabled flag:
/**
* Is the specified GBean enabled?
* @param name the name if the GBean
* @return true if the gbean is enabled
* @throws GBeanNotFoundException if the GBean could not be found
*/
boolean isGBeanEnabled(ObjectName name) throws
GBeanNotFoundException;
/**
* Sets the eneabled status of the specified GBean. A disabled
gbean can not be started, and
* will not be started via startRecursive.
* @param name the name if the GBean
* @param enabled the new enabled status
* @throws GBeanNotFoundException if the GBean could not be found
*/
void setGBeanEnabled(ObjectName name, boolean enabled) throws
GBeanNotFoundException;
How does it work? Are
"disabled" GBeans loaded but not started? Or not even loaded?
They are loaded but can not be started. If you want to start one you
have to reenable it.
If they're loaded but not started, I'd like more detail on the
start and stop behavior. For example, what happens if you go into the
console and start the Tomcat container. Would all connectors and
valves
and tomcat realms and stuff be started, or would something have to
separately start each and every one or them? Likewise for shutdown.
Um.. not sure what you are asking. If a service is disabled and you
try to start it, you get an IllegalStateException. If you call start
recursive on a parent service the service will not be started as part
of the recursion.
-dain