|Oracle® Fusion Middleware Developing WebLogic SCA Applications for Oracle WebLogic Server
11g Release 1 (10.3.5)
Part Number E15511-04
This chapter describes how to configure EJB session bean bindings for services and references:
The EJB session bean binding can be applied to both SCA services and SCA references. Configure EJB session bean bindings in the
<binding.ejb> element in the Spring application context file for your application. For background information, see:
For general information about configuring the Spring application context configuration for a WebLogic Spring SCA application, see Chapter 6, "Configuring the Spring Application Context."
For the schema that defines the
<binding.ejb> element, see Appendix A, "WebLogic SCA Binding Schema (weblogic-sca-binding.xsd)."
Note:The EJB Binding Component implementation is based on the SCA EJB Session Bean Binding specification at
http://www.osoa.org/download/attachments/35/SCA_EJBSessionBeanBinding_V100.pdf. However, in this release of WebLogic SCA, the following features are not supported:
Stateful session bean binding (conversations are not supported)
Local EJB service binding
Local EJB reference binding
Attributes of the
binding.ejb element are as follows:
Optional. Specifies the name of the binding.
Required. For EJB bindings on references,
uri specifies the JNDI name of the target EJB. For EJB bindings on services, the
uri value is the JNDI name at which the EJB is bound.
Advanced CORBA name URIs are not supported. The following two simplified patterns are supported. Both result in the service implementation being bound to the JNDI name
Optional. Used with service bindings. Specifies the name of a WorkManager to be used for incoming invocations.
binding.ejb is configured on an SCA service, an implementation of the service interface becomes available in JNDI when the application is deployed. That service can then be invoked using the EJB programming model. For example, this allows a client to look up and invoke the service as if the underlying service were a deployed EJB. This may be useful in a situation where you want to replace an existing EJB service with an SCA implementation, without requiring clients of the legacy EJB to be updated.
Only the EJB3 programming model is supported for EJB session bean service bindings.
uri attribute of binding.ejb to specify the JNDI name. See binding.ejb Element Attributes..
All EJB service bindings are remote and can therefore be looked up and invoked remotely.
Remote service implementations are clusterable. You can configure a client timeout for service bindings. To specify a client timeout, edit the
EJBServiceDelegateImplRTD.xml file located in the
binding.ejb jar file.
EJB service bindings can optionally specify a dispatch policy. To configure a dispatch policy, set the
dispatchPolicy attribute of
<binding.ejb> to the name of the WorkManager to be used for incoming invocations. If the configured WorkManager is not found, a warning is issued at runtime and the default WorkManager is used.
binding.ejb is configured on an SCA reference, the target EJB is resolved and invoked without any knowledge of the EJB programming model. (WebLogic SCA Runtime determines the programming model of the target EJB based on whether the object returned from the JNDI lookup implements
The target EJB is resolved lazily, that is, it is resolved at runtime as necessary to service an invocation.
This allows an SCA POJO implementation to invoke a deployed EJB in the same way it invokes any other SCA reference. WebLogic SCA Runtime looks up the target EJB from JNDI and delegates any method calls to the EJB. Using
binding.ejb in this way provides the flexibility to replace an EJB service with a non-EJB service without having to update the dependent component implementation.
The EJB2 and EJB3 programming models are supported for reference bindings, as described below.
If the target EJB uses an EJB 2.x client view, the binding implementation invokes the
home.create() method to obtain the EJB's remote interface implementation. The binding implementation also translates reference interface method invocations to EJB remote interface invocations.
Methods of the reference interface are mapped to the remote interface according to the rules in Section 2.2., "Interface Mapping," in the SCA EJB Session Bean Binding specification at
If the EJB3 programming model is used, the target EJB may implement the reference interface, but it is not required to so. If it does not implement the reference interface, the rules in Section 2.2 of the SCA EJB Session Bean Binding specification apply. The EJB binding code is responsible for translating reference interface method invocations to EJB business interface invocations.