Naming
Naming is used by clients of WAS applications to obtain references to objects related to those applications, such as enterprise bean (EJB) homes.
These objects are bound into a mostly hierarchical structure, referred to as a namespace. In this structure, all non-leaf objects are called contexts. Leaf objects can be contexts and other types of objects. Naming operations, such as lookups and binds, are performed on contexts. All naming operations begin with obtaining an initial context. We can view the initial context as a starting point in the namespace.
The namespace structure consists of a set of name bindings, each consisting of a name relative to a specific context and the object bound with that name. For example, the name myApp/myEJB consists of one non-leaf binding with the name myApp, which is a context. The name also includes one leaf binding with the name myEJB, relative to myApp. The object bound with the name myEJB in this example happens to be an EJB home reference. The whole name myApp/myEJB is relative to the initial context, which we can view as a starting place when performing naming operations.
We can access and manipulate the namespace through a name server. Users of a name server are referred to as naming clients. Naming clients typically use the JNDI to perform naming operations. Naming clients can also use the Common Object Request Broker (CORBA) CosNaming interface.
Use security to control access to the namespace. For more information, see Naming roles.
Typically, objects bound to the namespace are resources and objects associated with installed applications. These objects are bound by the system, and client applications perform lookup operations to obtain references to them. Occasionally, server and client applications bind objects to the namespace. An application can bind objects to transient or persistent partitions, depending on requirements.
In Java EE or Java SE environments, some JNDI operations are performed with java: URL names. Names bound under these names are bound to a completely different namespace which is local to the calling process. However, some lookups on the java: namespace may trigger indirect lookups to the name server.
Subtopics
- Namespace logical view
The namespace for the entire cell is federated among all servers in the cell. Every server process contains a name server. All name servers provide the same logical view of the cell namespace.
- Initial context support
All naming operations begin with obtaining an initial context. We can view the initial context as a starting point in the namespace. Use the initial context to perform naming operations, such as looking up and binding objects in the namespace.
- Lookup names support in deployment descriptors and thin clients
Server application objects, such as enterprise bean (EJB) homes, are bound relative to the server root context for the server in which the application is installed. Other objects, such as resources, can also be bound to a specific server root. The names used to look up these objects must be qualified so as to select the correct server root. This topic discusses what relative and qualified names are, when they can be used, and how we can construct them.
- JNDI support in WebSphere Application Server
The product includes a name server to provide shared access to Java components, and an implementation of the javax.naming JNDI package which supports user access to the name server through the JNDI naming interface.
- Configured name bindings
Administrators can configure bindings into the namespace. A configured binding is different from a programmatic binding in that the system creates the binding every time a server is started, even if the target context is in a transient partition.
- Namespace federation
Federating namespaces involves binding contexts from one namespace into another namespace.
- Naming roles
The J2EE role-based authorization concept is extended to protect the CosNaming service.
- Foreign cell bindings
If we have applications in a cell that access other applications in another cell, we can configure a foreign cell name binding for the other cell. A foreign cell name binding is a context binding that resolves to the Cell Root context of the other cell. All applications in the local cell can look up objects in the foreign cell through the foreign cell binding.
- Naming and directories: Resources for learning
Additional information and guidance on naming and directories is available on various Internet sites.
Related concepts
Namespace logical view
Related tasks
Use naming
Lookup names support in deployment descriptors and thin clients Naming roles