[jboss-user] [JBoss Microcontainer Users] - Optional depends?

pferraro do-not-reply at jboss.com
Mon Oct 26 12:13:06 EDT 2009


Is there a way to express an optional dependency between beans?  e.g. install bean A before bean B, but only if bean A exists.
In psuedo-markup:
<bean name="A" class="...">
  |   <!-- A depends on B, if B exists -->
  |   <depends optional="true">B</depends>
  | </bean>
  | <bean name="B" class="..."/>

The "optional" aspect would be transparent if it were possible to describe the dependency within the guardian bean, instead of the dependent bean.
e.g. In pseudo-markup:
<bean name="A" class="..."/>
  | <bean name="B" class="...">
  |   <!-- A depends on B, but dependency is described in B, instead of A -->
  |   <dependent>A</dependent>
  | </bean>

The use case for this in the AS is mod_cluster, whose service bean must be installed before (and undeployed after) the WebServer bean.  Normally, this would be expressed as jbossweb depends on mod_cluster, but jbossweb should not require mod_cluster.  Thoughts?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262221#4262221

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262221



More information about the jboss-user mailing list