Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0) Part Number B28221-02 |
|
|
View PDF |
You can access an enterprise bean from a variety of clients, including the following:
How you access an enterprise bean, resource, or environment variable is different depending on the type of client and how the application is assembled and deployed.
For more information, see "Configuring the Client".
When one enterprise bean (call it the source enterprise bean) accesses another enterprise bean (call it the target enterprise bean), the source enterprise bean is the client of the target enterprise bean.
If you are using EJB 3.0, with annotations and dependency injection, OC4J initializes the instance variable that corresponds to the target reference.
If you are using EJB 2.1, you must use JNDI lookup in this scenario.
A standalone Java client is a client that executes outside of OC4J, but accesses EJB resources deployed to OC4J.
Typically, a standalone Java client accesses EJB resources by making use of Java RMI calls. You must code a standalone Java client so that it honors the security and authentication requirements that OC4J enforces.
By default, OC4J is configured to assign RMI ports dynamically within a set range. In this release, you can look up an OC4J-deployed enterprise bean from a standalone Java client without specifying an exact RMI port. You do not need to configure OC4J to use exact port numbers.
If you are using EJB 3.0, note that annotations and dependency injection are not supported for a standalone Java client.
If you are using EJB 2.1, you must configure your initial context to accommodate this scenario (see "Accessing an EJB 2.1 Enterprise Bean Using RMI From a Standalone Java Client").
A servlet or JSP can access an enterprise bean.
In this release, OC4J supports annotations and resource injection in the Web tier (see "Annotations in the Web Tier").
You can use dependency injection from a servlet or JSP client for EJB 3.0 applications.
You can use JNDI lookup from a servlet or JSP client for both EJB 3.0 and EJB 2.1 applications.