Use this task to learn how to use Enterprise JavaBeans (EJB) bindings that are deployed in Service Component Architecture (SCA) applications in a cluster environment.
ejb/sca/ejbbinding/component_name/service_name
ejb/sca/ejbbinding/CompanyComponent/Company
ejb/sca/ejbbinding/component_name/service_name#fullyQualifiedServiceInterfaceNameRemote
ejb/sca/ejbbinding/CompanyComponent/Company#com.app.jobbank.CompanyRemote
The generated EJB for the composite service will be under profile_root/installedApps/cell_name/composite_name.ear/.
Callers need to include client required classes (such as remote or home) of this generated bean in their classpath (or bundle the classes in their JAR file).
Lookup and invoke of this generated service EJB from a clustered environment is the same as lookup and invoke of any EJB in a product clustered setup. Refer to "Naming considerations in clustered and cross-server environments" in the EJB 3.x application bindings overview topic.
"corbaname:iiop:host:port/NameServiceServerRoot#JNDI_name"
where JNDI_name is
the JNDI name of the target EJB.For example:
uri="corbaname:iiop:localhost:2809/NameServiceServerRoot#ejb/session/PriceQuoteSessionFacadeBean"
JNDI name syntax differs if the target EJB is an EJB 2 or EJB 3.x bean.
When the referred EJB service is in a different cell, the URI might resemble one of the following:
uri="corbaname:iiop:localhost:2809/NameServiceServerRoot#cell/clusters/cluster1/ejb/session/PriceQuoteSessionFacadeBean"
oruri="corbaname::/NameServiceServerRoot#cell/clusters/cluster1/ejb/session/PriceQuoteSessionFacadeBean"
oruri="cell/clusters/cluster1/ejb/session/PriceQuoteSessionFacadeBean"
if
the target EJB is on the same machine but on different cluster.In advanced scenarios on multiple-server environments, a simpler and more portable way to access the target EJB application from an SCA composite is to set up a namespace binding and use the namespace binding name in the URI attribute of the binding.ejb along with cell/persistent/. For example:
uri="cell/persistent/PriceQuote"
where PriceQuote is the name field in the namespace.
The namespace binding can be of type EJB or CORBA based on the advanced scenario.
If the target EJB application which the composite is trying to access is on same cell, but on a different server, node or cluster, configure an EJB namespace binding. You can do this from the administrative console:
"corbaname:iiop:host:port/NameServiceServerRoot#jndi_name"
After you configure the namespace binding, use the Name in name space field to construct the URI; for example, uri="cell/persistent/PriceQuote" where PriceQuote is the value in the Name in name space field of the binding.
An advantage of using a namespace binding is, even when the target EJB changes, the composite definition does not need to change. Only the namespace binding needs to change accordingly.