At the end of this chapter you will be able to:
What is JNDI? The Java Naming and Directory Interface (JNDI) is an API that supports accessing naming and directory services in Java programs. The purpose of a naming service is to associate names with objects and provide a way to access objects based on their names. Objects in a naming system can range from files in a file system and names located in Domain Name System (DNS) records, to Enterprise JavaBeans (EJB) components in an application server and user profiles in an LDAP (Lightweight Directory Access Protocol) directory. As its name implies, JNDI doesn't just deal with naming services. JNDI also encompasses directory services, which are a natural extension of naming services. The primary difference between the two is that a directory service allows the association of attributes with objects, such as an email address attribute for a user object, while a naming service does not. Thus, with a directory service, you can access the attributes of objects and search for objects based on their attributes. You can use JNDI to access directory services like LDAP and Novell Directory Services (NDS) directories.
– Different services use vastly different naming schemes – Java applications will be able to navigate seamlessly across databases, files, directories, objects and networks Why JNDI?
JNDI Structure & Architecture Naming Service A naming service provides a method for mapping identifiers to entities or objects: Naming Service vocabulary: Binding: Association of an atomic name and an object Example: www.bea.com is bound to 209.10.217.38 Namespace: A set of unique names in a naming system Example: www.bea.com/products A JNDI Tree Contexts and Subcontexts A naming service associates names with objects. An association between a name and an object is called a binding, and a set of such bindings is called a context. A name in a context can be bound to another context that uses the same naming conventions; the bound context is called a subcontext. For example, in a filesystem, a directory (such as /temp) is a context that contains bindings between filenames and objects that the system can use to manipulate the files (often called file handles). If a directory contains a binding for another directory (e.g., /temp/javax), the subdirectory is a subcontext.
If the following context exists: com.bea.examples We cannot bind: com.bea.examples.ejb.SomeObject Without first creating: com.bea.examples.ejb JNDI for Administrators
Viewing the JNDI Tree Listing JNDI Contents
Startup and Shutdown Classes You can use startup and shutdown classes to configure a WebLogic Server to perform tasks when you start or gracefully shut down the server. A startup class is a Java program that is automatically loaded and executed when a WebLogic Server is started or restarted. A shutdown class is a Java program that is automatically loaded and executed when the WebLogic Server is shut down either from the Administration Console or the weblogic.admin shutdown command. To use startup or shutdown classes, you must configure and assign them to servers or clusters. You can use a startup class to:
You can use a shutdown class to:
Defining Startup/Shutdown Classes When Are Startup Classes Loaded?
Summary: In this chapter we discussed:
Check out our Related Courses Weblogic Tutorials Introduction to Clustering Weblogic Oracle Goldengate Training In Houston Oracle Weblogic Server Installation
You liked the article?
Like : 0
Vote for difficulty
Current difficulty (Avg): Medium
1/15
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.
Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox