This subsection describes the types of JNDI name spaces defined in Java EE and the range that can be looked up.
The following figure shows the range of the JNDI name space.
Figure 2-4 Range of the JNDI name space
![[Figure]](figure/zu021500.gif)
- java:global
This name space is shared by all the J2EE applications. With Application Server, all the J2EE servers or EJB client applications using the same CORBA Naming Service share this name space.
- java:app
This name space is shared within a J2EE application. The name space is shared by all the components in one J2EE application (Enterprise Beans, servlets, JSPs, filters, and resource adapters).
- java:module
This name space is shared among various modules (EJB-JARs, Web applications, or resource adapters). The name space is shared by all the components in one module (Enterprise Beans, servlets, JSPs, filters, and resource adapters).
- java:comp
This name space is shared among various components (Enterprise Beans, servlets, JSPs, filters, or resource adapters). The name space is shared within one component only. However, in the case of a Web application, the name space is shared by all the servlets or JSPs in the Web application.
The name space that can be used depends on whether the component to be looked up is included in the same process, application, module, or component as the lookup source. The following table describes the relationship with the components to be looked up, and the possibility of lookup in each name space.
Table 2-9 Possibility of lookup in each name space
No. | Relationship with the component to be looked up | Name space to be looked up |
---|
Server (Process) | Application | Module | Component | java:global | java:app | java:module | java:comp |
---|
1 | Same | Same | Same | Same | Y | Y | Y | Y |
2 | Same | Same | Same | Different | Y | Y | Y | C #1 |
3 | Same | Same | Different | Different | Y | Y | N | N |
4 | Same | Different | Different | Different | Y | N | N | N |
5 | Different#2 | Different | Different | Different | Y#3 | N | N | N |
- Legend:
- Y: Can be looked up.
- C: Can be looked up depending on the component type.
- N: Cannot be looked up.
- #1
- Can be looked up in the case of components in the Web application (servlets, JSPs, or filters).
- #2
- Indicates that the server (process) is different, but the same CORBA Naming Service is used. Includes the lookup of J2EE applications in a J2EE server from the EJB client application.
- #3
- Only the automatically bound EJB references can be looked up (Application Server-specific specifications).