Introduction
This paper provides a brief introduction to the integration of Java Enterprise Edition with SCA, with pointers to more detailed information that is provided on other pages.
SCA integrates with the Enterprise Java Beans (EJB) technology on different levels - at a binding level and at a component level.
At the binding level, using the EJB Session Bean binding [1] it is possible to consume existing EJB session beans from an SCA service component. It is also possible to expose an SCA service component as an EJB session bean. An overview of the EJB Session Bean binding is in the following section.
At the component level, the session bean programming model can be used as a service component implementation. In this case, the individual service components can take advantage of the facilities provided by SCA including wiring via multiple protocols, declarative policy and assembly into heterogeneous composites. The detail of how SCA integrates with the Java EE component implementation model and application assembly is described in the Java EE integration white paper [2].
EJB Session Bean binding
Bindings describe the exposure and consumption of service components through a particular access method. This section describes how to consume an EJB session bean and how to expose an SCA service component as an EJB session bean.
Exposing a Service Component as an EJB Session Bean requires including a <service> declaration of the form:
<service name="JobBank"> <interface.java interface="com.app.jobbank.JobBankService"/> <binding.ejb location="corbaname:rir:host:port#ejb/JobBankServiceHome" homeInterface="com.app.jobbank.JobBankServiceHome" ejb-link-name="jobbankEJB.jar#JobBankComponent"/> </service>
This has the effect that an EJB client can use the exposed service component like a regular EJB session bean.
The binding definition covers various use-cases of EJB session bean exposure and consumption, which in turn depend on the capabilities of the specific SCA runtime.
While the ejb-link-name attribute provides session bean identification within the Java EE enterprise application, the location attribute provides identification for references from outside of the enterprise application, using a corbaname style syntax.
The specified service interface serves as the session bean business interface. If it is a remotable interface, the service declaration implies a remotable session bean representation. Otherwise, the interface is considered a local business interface.
Given a <reference> declaration of the form
<reference name="CandidateCheck"> <interface.java interface="com.app.jobbank.CandidateCheck"/> <binding.ejb location="corbaname:rir:host:555#ejb/CandidateCheckHome"/> </reference >
an SCA reference may be satisfied by an EJB session bean that is hosted outside of the SCA application, while
<reference name="CandidateCheck"> <interface.java interface="com.app.jobbank.CandidateCheck"/> <binding.ejb ejb-link-name="CandidateCheck"/> </reference >
points to a session bean that is co-located within the same SCA application that contains the reference declaration.
References
- [EJB Session Bean Binding]
- Java EE Integration White Paper