要将 Jakarta Enterprise Beans 客户端连接到集群的 Jakarta Enterprise Beans 应用,您需要扩展独立 Jakarta Enterprise Beans 客户端或服务器内 Jakarta Enterprise Beans 客户端中的现有配置,以包含集群连接配置。适用于独立 Jakarta Enterprise Beans 客户端的 jboss-ejb-client.properties,甚至是用于服务器端应用的 jboss-ejb-client.xml 文件,必须扩展为包含群集配置。
注意
Jakarta Enterprise Beans 客户端是在远程服务器上使用 Jakarta 企业 Bean 的任何程序。当 Jakarta Enterprise Beans 客户端调用远程服务器本身在服务器内部 时,客户端就位于服务器内。换句话说,调用另一 JBoss EAP 实例的 JBoss EAP 实例将被视为服务器内客户端。
<jboss-ejb-client xmlns:xsi="urn:jboss:ejb-client:1.2" xsi:noNamespaceSchemaLocation="jboss-ejb-client_1_2.xsd">
<client-context>
<ejb-receivers>
<!-- this is the connection to access the app-one -->
<remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection-1" />
<!-- this is the connection to access the app-two -->
<remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection-2" />
</ejb-receivers>
<!-- If an outbound connection connects to a cluster,
a list of members is provided after successful connection.
To connect to this node this cluster element must be defined. -->
<clusters>
<!-- cluster of remote-ejb-connection-1 -->
<cluster name="ejb" security-realm="ejb-security-realm-1" username="quickuser1">
<connection-creation-options>
<property name="org.xnio.Options.SSL_ENABLED" value="false" />
<property name="org.xnio.Options.SASL_POLICY_NOANONYMOUS" value="false" />
</connection-creation-options>
</cluster>
</clusters>
</client-context>
</jboss-ejb-client>
<jboss-ejb-client xmlns:xsi="urn:jboss:ejb-client:1.2" xsi:noNamespaceSchemaLocation="jboss-ejb-client_1_2.xsd">
<client-context>
<ejb-receivers>
<!-- this is the connection to access the app-one -->
<remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection-1" />
<!-- this is the connection to access the app-two -->
<remoting-ejb-receiver outbound-connection-ref="remote-ejb-connection-2" />
</ejb-receivers>
<!-- If an outbound connection connects to a cluster,
a list of members is provided after successful connection.
To connect to this node this cluster element must be defined. -->
<clusters>
<!-- cluster of remote-ejb-connection-1 -->
<cluster name="ejb" security-realm="ejb-security-realm-1" username="quickuser1">
<connection-creation-options>
<property name="org.xnio.Options.SSL_ENABLED" value="false" />
<property name="org.xnio.Options.SASL_POLICY_NOANONYMOUS" value="false" />
</connection-creation-options>
</cluster>
</clusters>
</client-context>
</jboss-ejb-client>
Copy to ClipboardCopied!Toggle word wrapToggle overflow