When discussing the initial integration of mod_cluster into the AS, it
was decided that we would keep it disabled by default - but make it as
simple as possible to enable, i.e. by uncommenting the
<!--depends>ModClusterListener</depends--> withing jbossweb's mc
The reasoning for this was that mod_cluster added unwanted overhead in
the case where it wasn't being used. As of version 1.1.0.CR1
(specifically, the completion of MODCLUSTER-103), mod_cluster's
container event handling and load balance factor calculation is
effectively bypassed if it has no proxies with which to communicate.
Consequently, I want to revisit this discussion.
I can think of a couple issues that would need to be addressed if the AS
shipped mod_cluster enabled by default:
1. If a user deletes mod_cluster.sar from their profile, jbossweb will
refuse to start since it has a dependency on the ModClusterListener bean
- the configuration of which was just deleted. This is rather annoying.
a. A potential workaround for this: move the mod_cluster jar and
configuration xml within the jbossweb service itself, rather than a
separate deploy/mod_cluster.sar. Those profiles that include jbossweb,
but do not want to include mod_cluster could include a "dummy"
ModClusterListener bean configuration - so the dependency is satisfied.
This dummy bean config should reside within jbossweb.sar. I think this
is preferable to maintaining 2 copies of the jbossweb mc configuration,
one with and one without the mod_cluster dependency.
b. Hmm - now that I think of it we may actually be able to drop the
jbossweb dependency altogether... The reason this dependency exists in
the first place is to ensure that mod_cluster sends the necessary
DISABLE-APP/STOP-APP/REMOVE-APP mcmp messages prior to shutdown of
jbossweb. In my fix for MODCLUSTER-131, mod_cluster's shutdown handling
was enhanced to react to the "jboss.tomcat.connectors.stopped" JMX
event, emitted prior to stopping the Connectors, which is the first
thing jbossweb does during shutdown. If I'm not mistaken, this may
ultimately mean that we can finally let mod_cluster depend on jbossweb,
and not the other way around. We still need mod_cluster to start before
the WebServer, but a simple dummy bean configuration should do the
<bean name="ModClusterLoader" class="java.lang.Object">
I could not use this previously because this said nothing about the
shutdown order of the two beans. But now, I think it should work.