- 1. Classification
- 2. Calling Existing EJBs
- 3. Processor EJB Encapsulation
- 3.1. Overview
- 3.2. Usage
- 3.3. Deployment Descriptors
|
|
OPS User Guide
|
EJB Support
1. ClassificationOPS provides EJB support in two different areas:
2. Calling Existing EJBsRegular EJBs (typically implementing business logic) can be called from a pipeline using the Delegation processor. For instance, this could be used in a Web application to call a credit card validation service available in an EJB session bean to validate a number entered by a user on a Web page. The Delegation processor can not only call EJB session beans, but also Web services and JavaBeans. Please see the Delegation processor documentation for more information about how to call existing EJBs. 3. Processor EJB Encapsulation3.1. OverviewWhen code is encapsulated inside an EJB, the EJB container will provide a number of features to the developer almost hassle-free (i.e. with no coding involved), including:
With Processor EJB Encapsulation, OPS processors can benefit from the same advantages provided to EJB components by the application server. 3.2. UsageIn the pipeline language, the attribute
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"> <p:processor name="oxf:sql" delegation="ejb"> <p:input name="config">...</p:input> <p:input name="data">...</p:input> <p:output name="data" id="result-set"/> </p:processor> <p:processor name="oxf:xslt"> <p:input name="config">...</p:input> <p:input name="data" ref="result-set">...</p:input> <p:output name="data" id="result-set"/> </p:processor> </p:config>
In the above example we first execute some SQL
using the SQL processor and then transform the
returned data via the XSLT processor. Since we have a
The figure below illustrates a scenario where the Proxy Service EJB is deployed on a remote server. 3.3. Deployment DescriptorsTo find the Proxy Service EJB, the pipeline
processor must be able to lookup the name
<ejb-ref> <ejb-ref-name>ejb/oxf/proxy</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>org.orbeon.oxf.proxy.ProxyServiceHome</home> <remote>org.orbeon.oxf.proxy.ProxyService</remote> </ejb-ref>
Depending on the application server, additional configuration will be needed. For instance, on WebLogic, the WAR's weblogic.xml descriptor might look like this:
<weblogic-web-app> <reference-descriptor> <ejb-reference-description> <ejb-ref-name>ejb/oxf/proxy</ejb-ref-name> <jndi-name>org/orbeon/oxf/ProxyService</jndi-name> </ejb-reference-description> </reference-descriptor> </weblogic-web-app>
|