100 likes | 238 Views
JNDI. Celsina Bignoli bignolic@smccd.net. Naming Services. Name : reference to an entity A naming service : Associates (binds) names with objects Provides mechanisms for finding an object based on a name Naming services are ubiquitous in computing DNS (name –IP address)
E N D
JNDI Celsina Bignoli bignolic@smccd.net
Naming Services • Name: reference to an entity • A naming service: • Associates (binds) names with objects • Provides mechanisms for finding an object based on a name • Naming services are ubiquitous in computing • DNS (name –IP address) • File system naming service
Directory Services • A directoryobject is a special object which has attributes associated with it. • A directory service is a naming service with additional functionality for manipulating attributes • A directory is a system of correlated directory objects
Directory Structure Employee1 Employees Employee2 Company Printers Computer1 Hardware Computers Computer2 Fax Machines
Existing Naming & Directory Services • Examples: • LDAP (Lightweight Directory Access Protocol) • NIS (Network Information System) • Novell’s NDS (Network Directory System) • Each has its own proprietary set of services • Makes it hard to switch between systems
JNDI • Provides a common interface to disparate directory services • You can use behind the scene an heterogeneous set of Naming and Directory systems making it look like one, and not having to learn their specific APIs • Use JNDI for resource factories, look up beans, acquire references
JNDI Architecture Client Code JNDI Client API Service Provider Interface LDAP Service Provider NIS Service Provider File System Service Provider
JNDI Concepts • Atomic name: indivisible name • Ex: usr, local • Compound name:zero or more atomic names put together according to a specific syntax • Ex: /usr/local • Binding: association of a name with an object • run.exe associates to an executable file in the file system • Context:a set of 0 or more bindings, with its own distinct atomic name.
JNDI Concepts (2) • Naming system: connected set of contexts that use the same name syntax • Ex: folder tree in a file system • Namespace: set of names in a name system • Composite Name: name that spans multiple naming systems
Initial Context Factories • Initial Context: starting point from where to perform naming and directory operations • Initial Context Factory: used to acquire initial context. Implemented by the JNDI Driver • To acquire an Initial Context you must provide: • IP address of the J2EE server • Port number • Starting location within the JNDI tree • User name/ password combination to access J2EE server