
<!-- other elements omitted -->
<ejb-ref>
<description> Access to remote EJB stored on a J2EE server. </description>
<!--
The <ejb-ref-name> element identifies the JNDI path, relative to java:comp/env,
to bind the EJB to.
-->
<ejb-ref-name>ejb/MyEJBReference</ejb-ref-name>
<!-- The <ejb-ref-type> element identifies the expected bean type of the bean being bound. -->
<ejb-ref-type>Entity</ejb-ref-type>
<!-- The <home> element identifies the expected Java type of the bean’s home interface. -->
<home>com.example.EJBHomeInterface</home>
<!-- The <remote> element identifies the expected Java type of the bean’s remote interface. -->
<remote>com.example.EJBRemoteInterface</remote>
<!--
The <ejb-link> element identifies the EJB this name should refer to. It should correspond
to the <ejb-name> specified in rhino-config.xml for an external EJB.
-->
<ejb-link>external:EJBNumberOne</ejb-link>
</ejb-ref>
In the SBB implementation, the reference can then be obtained from JNDI:
//look up the EJB remote home interface
javax.naming.Context initialContext = new javax.naming.InitialContext();
Object boundObject = initialContext.lookup("java:comp/env/ejb/MyEJBReference");
com.example.EJBHomeInterface homeInterface =
(com.example.EJBHomeInterface) javax.rmi.PortableRemoteObject.narrow(
boundObject, com.example.EJBHomeInterface.class);
// The variable homeInterface is now a reference to the EJB’s remote home interface.
20.3 Sending SLEE Events from an EJB
To support sending SLEE events from EJBs hosted in a J2EE server to the Rhino SLEE, two optional components that are not
enabled by default must be installed.
The Rhino SLEE includes a J2EE Resource Adaptor that accepts connections from the J2EE server for event delivery. The
Resource Adaptor is packaged as a SLEE deployable unit located at
$RHINO_HOME/examples/j2ee/prebuilt-jars/rhino-j2ee-connector-ra.jar
.
Use the management interface (command-line or HTML) to deploy, instantiate, and activate this resource adaptor. See Chapter
5 for instructions on deploying resource adaptors.
The J2EE Resource Adaptor has a single configuration parameter: the port to listen on. To change the port number, edit
the “port” config-property element in the J2EE Resource Adaptor’s
oc-resource-adaptor-jar.xml
deployment descriptor.
The default port number is 1299. If the Rhino SLEE is using a security manager, please ensure that the resource adaptor has
sufficient permissions to listen on this port and accept connections from the J2EE server.
The Rhino SLEE includes a J2EE 1.3 Connector packaged
$RHINO_HOME/examples/j2ee/prebuilt-jars/rhino-j2ee
-connector.rar
.
The Open Cloud Rhino SLEE J2EE Connector should be configured and deployed in the J2EE server. Consult the J2EE server’s
documentation for instructions on deploying connectors.
Open Cloud Rhino 1.4.3 Administration Manual v1.1 120
Comentarios a estos manuales