-
Feature Request
-
Resolution: Duplicate
-
Major
-
None
-
None
-
None
EE.5.11ORB References
Some Java EE applications will need to make use of the CORBA ORB to perform certain operations. Such applications can find an appropriate object implementing the ORB interface by looking up the JNDI name java:comp/ORB or by requesting injection of an ORB object. The container is required to provide the java:comp/ORB name for all components except applets. Any such reference to a ORB object is only valid within the component instance that performed the lookup.
The following example illustrates how an application component acquires and uses an ORB object via injection.
@Resource ORB orb;
public void method(...) {
...
// Get the POA to use when creating object references.
POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
...
}
The following example illustrates how an application component acquires and uses an ORB object using a JNDI lookup.
public void method(...) {
...
// Obtain the default initial JNDI context.
Context initCtx = new InitialContext();
// Look up the ORB object.
ORB orb = (ORB)initCtx.lookup("java:comp/ORB");
// Get the POA to use when creating object references.
POA rootPOA = (POA)orb.resolve_initial_references("RootPOA");
- duplicates
-
EJBTHREE-967 Injection of ORB doesn't work (EJB3 16.13)
- Closed