Tuesday, April 10, 2012

JNDI

http://docs.oracle.com/javase/jndi/tutorial/

JNDI
Java Naming and Directory Interface

Naming service It is a mean by which names are associated with objects and objects are found based on their names.The naming system determines the syntax that the name must follow. This syntax is sometimes called the naming system's naming convention.

Bindings
The association of a name with an object is called a binding.

Context
A context is a set of name-to-object bindings. Every context has an associated naming convention. A context provides a lookup (resolution) operation that returns the object and may provide operations such as those for binding names, unbinding names, and listing bound names. A name in one context object can be bound to another context object (called a subcontext) that has the same naming convention.
    For example, a file directory, such as /usr, in the UNIX file system is a context. A file directory named relative to another file directory is a subcontext (some UNIX users refer to this as a subdirectory). That is, in a file directory /usr/bin, the directory bin is a subcontext of usr. In another example, a DNS domain, such as COM, is a context. A DNS domain named relative to another DNS domain is a subcontext. For example, in the DNS domain Sun.COM, the DNS domain Sun is a subcontext of COM.

Naming system
A naming system is a connected set of contexts of the same type (they have the same naming convention) and provides a common set of operations.
For example, a system that implements the DNS is a naming system. A system that communicates using the LDAP is a naming system.

Namespace
A namespace is the set of names in a naming system.

How to use JNDI
To use the JNDI, you must have the JNDI classes and one or more service providers. The Java 2 SDK, v1.3 includes three service providers for the following naming/directory services:
Lightweight Directory Access Protocol (LDAP)
Common Object Request Broker Architecture (CORBA) Common Object Services (COS) name service
Java Remote Method Invocation (RMI) Registry



LDAP

http://docs.oracle.com/javase/jndi/tutorial/ldap/index.html

LDAP
The Lightweight Directory Access Protocol (LDAP) is a network protocol for accessing directories. It is based on the X.500

X.500
The X.500 directory service is a global directory service. Its components cooperate to manage information about objects such as countries, organizations, people, machines, and so on in a worldwide scope. It provides the capability to look up information by name (a white-pages service) and to browse and search for information (a yellow-pages service).

The information is held in a directory information base (DIB). Entries in the DIB are arranged in a tree structure called the directory information tree (DIT). Each entry is a named object and consists of a set of attributes. Each attribute has a defined attribute type and one or more values. The directory schema defines the mandatory and optional attributes for each class of object (called the object class). Each named object may have one or more object classes associated with it.

The X.500 namespace is hierarchical. An entry is unambiguously identified by a distinguished name (DN). A distinguished name is the concatenation of selected attributes from each entry, called the relative distinguished name (RDN), in the tree along a path leading from the root down to the named entry.

Web Server V/S Application Server

http://www.javaworld.com/javaworld/javaqa/2002-08/01-qa-0823-appvswebserver.html

Tomcat, or officially named Apache Tomcat is a light-weight web container used for deploying and running web application based on Java

Web Server handles HTTP requests.It responds with static pages like HTML pages and can use other programs such as JSP,servlets,CGI,ASP etc to generate dynamic response.

Application Sever handles business logic for use by client applications and supports various protocols including HTTP.

SpringBoot Application Event Listeners

When a spring boot application starts few events occurs in below order ApplicationStartingEvent ApplicationEnvironmentPreparedEvent Applicat...