Skip navigation
2005

 

Expressing dependencies between services using the <depends> tag is a very handy feature of JBoss. However, there are cases where services do not conform to the JBoss lifecycle model, or even if they do, the completion of their lifecycle methods does not express the dependency we want.

 

The typical use-case is delaying the starting of a custom service that hits a servlet, until *after* the Tomcat connectors are active, which in turn happens only after the server has completely started. This is possible using JMX notifications (i.e. subscribe to the jboss.system:type=Server, org.jboss.system.server.started notification).

 

A generalization of this technique has been added to JBoss v4.0.2 with the introduction of the BarrierController service. The service makes it easy to declaratively register and use *any* combination of notifications in the system as triggering events for the starting and stopping of a secondary Barrier MBean.

 

Then you can use the familiar <depends> tag to make your custom service depend on the Barrier, without having to worry about complex dependency issues.

 

A detailed description of the service can be found in our wiki.

 

dimitris@jboss

Filter Blog

By date: