I'm adding a simple service to bindings.xml that can convert ServiceBindingManager
values into system properties.
| <!-- Conversion of selected bindings into system properties -->
| <bean name="SystemPropertyBinder"
| class="org.jboss.services.binding.SystemPropertyBinder">
|
| <constructor>
| <parameter>
| <set>
| <!-- JBM's remoting connector -->
| <bean
class="org.jboss.services.binding.SystemPropertyBinding">
| <constructor>
|
<parameter>jboss.messaging.connector.bisocket.port</parameter>
| <parameter class="int">
| <value-factory bean="ServiceBindingManager"
method="getIntBinding"
|
parameter="jboss.messaging:service=Connector,transport=bisocket"/>
| </parameter>
| </constructor>
| </bean>
| </set>
| </parameter>
| </constructor>
|
| </bean>
|
|
This is to support the JBM usage discussed at
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169967#.... I
imagine it might be useful for some other cases as well; perhaps JGroups configurations
where users want strictly defined ports rather than letting JGroups find an available
port. JGroups uses custom parsing of its protocol stack configurations, so system
properties are the only mechanism for passing in dynamic values.
Downside to this approach is the consuming service no longer has an explicit dependency on
the SBM (which is also the upside ;-) ). But, the Naming service depends on SBM, so SBM
is always going to deploy very early. If services using this system property approach are
careful and understand their dependency relationships, this should be safe enough.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170426#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...