Show Table of Contents
14.3. Multihomed servers
Remoting can create servers bound to multiple interfaces. One application of this facility would be binding a server to one interface that faces the internet and another that faces a LAN. For example, the preceding POJO example can be modified by (1) adding POJOs
<!-- Beans homes1 and homes2 are used to construct a multihome Remoting server. -->
<bean name="homes1" class="java.lang.StringBuffer">
<constructor>
<parameter class="java.lang.String">
<value-factory bean="ServiceBindingManager" method="getStringBinding">
<parameter>JBMConnector:bindingHome1</parameter>
<parameter>${host}:${port}</parameter>
</value-factory>
</parameter>
</constructor>
</bean>
<bean name="homes2" class="java.lang.StringBuffer">
<constructor factoryMethod="append">
<factory bean="homes1"/>
<parameter>
<value-factory bean="ServiceBindingManager" method="getStringBinding">
<parameter>JBMConnector:bindingHome2</parameter>
<parameter>!${host}:${port}</parameter>
</value-factory>
</parameter>
</constructor>
</bean>
which results in a StringBuffer with a value something like (according to the ServiceBindingManager configuration values for JBMConnector:bindingHome1 and JBMConnector:bindingHome2) "external.acme.com:5555!internal.acme.com:4444", and (2) replacing the "serverBindAddress" and "serverBindPort" parameters with
<entry>
<key>homes</key>
<value><value-factory bean="homes2" method="toString"/></value>
</entry>
which transforms the StringBuffer into the String "external.acme.com:5555!internal.acme.com:4444" and injects it into the JBMConnector. The resulting InvokerLocator will look like
bisocket://multihome/?homes=external.acme.com:5555!internal.acme.com:
4444&marshaller=org.jboss.jms.wireformat.JMSWireFormat&
unmarshaller=org.jboss.jms.wireformat.JMSWireFormat

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.