Topic : JNDI Kaster Nurmukan. JNDI2(c)CDAC(Formerly NCST) What is JNDI? Naming and Directory Services Naming Concepts Issues JNDI Architecture Programming.

Slides:



Advertisements
Similar presentations
Quantum Quantum Enterprise Solutions, Inc. Quantum JNDI Unleashed Java Conference 2000 March 29, 2000 Peter Fischer Director of Technical Services.
Advertisements

Communicating in J2EE.
21 Copyright © 2005, Oracle. All rights reserved. Oracle Application Server 10g Transaction Support.
12 Copyright © 2005, Oracle. All rights reserved. Implementing Business Tasks with Session EJBs.
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Java Remote Method Invocation (RMI) In Java we implement object systems: O1O2 O3 thread 1thread 2 execution scheme JVM 1JVM 2 distribution scheme.
Introduction to Java 2 Enterprise Edition About myself –Neutrinos, Cancer Research, IT Applications Today’s topic: J2EE –Context –Advantages –Components.
Java Naming and Directory Interface JNDI. v001025JNDI2 Topics Naming and Directory Services JNDI Overview Features and Code Samples JNDI Providers References.
Organizational Communication Technologies 1 Enterprise Java Beans Overview.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 14: Naming.
EJB Development and Support Services. EJB Development and Support Services Topics to be Covered: EJB Design Bean/Container Interaction Java Naming and.
Enterprise Java Beans Adam, Engels, Josh, Marc, Tim.
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
Java Remote Object Invocation (RMI) Overview of RMI Java RMI allowed programmer to execute remote function class using the same semantics as local functions.
Faculty of Information Technology © Copyright UTS Faculty of Information Technology - JNDIJNDI-1 Advanced Java Programming JNDI v2 Chris Wong
Basics of JNDI Alessio Bechini June Naming and Directory Services: Rationale A fundamental element in every application is the capability to find.
JMS Java Message Service Instructor Professor: Charles Tappert By Student: Amr Fouda.
Internet Software Development Remote Method Invocation Paul Krause.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
JNDI Java Naming and Directory Interface See also:
Distributed Multitiered Applications The J2EE platform uses a multitiered distributed application model. Application logic is divided into components 1.
卓越計劃進度報告 JNDI Java Naming and Directory Interface 網際網路實驗室 報告人 潘燕弘.
Enterprise Java Beans CS-422. Application Servers In the late 1980s and though the mid 1990s a number of corporations (Broadvision, Netscape…) marketed.
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
J2EE Part 2: Enterprise JavaBeans CSCI 4300 Images and code samples from jGuru EJB tutorial,
Seminar: Enterprise JavaBeans. Agenda Agenda Java™ 2 Platform Java™ 2 Platform Java™ 2 Platform,Enterprise Edition(J2EE) Java™ 2 Platform,Enterprise Edition(J2EE)
Corso di Formazione Sodalia “Enterprise Java Beans” JNDI Java Naming and Directory Interface.
Enterprise JavaBeans EJB Container Services. EJB container Enterprise JavaBeans are deployed in an EJB container within the application server EJB container.
CS 493/693: Distributed Systems Programming V. “Juggy” Jagannathan CSEE, West Virginia University March 21, 2005.
© D. Wong  Indexes  JDBC  JDBC in J2EE (Java 2 Enterprise Edition)
Entity Java Beans Jorg Janke Open Source ERP & CRM.
Presented By Pradeep K Sahu. What will be the Contents of the Seminar ? What is EJB ? EJB Architecture Types of EJB Session Entity Why EJB ? Writing a.
EJB Framework.  As we know, EJB is the center of the J2EE architecture that provides a sturdy framework for building enterprise applications. The major.
TDDD05 EJB Lab (Part of slides reused from Mikhail’s) Lu Li
Java Transaction API Sean C. Sullivan
第十四章 J2EE 入门 Introduction What is J2EE ?
Enterprise Java Beans Java for the Enterprise Server-based platform for Enterprise Applications Designed for “medium-to-large scale business, enterprise-wide.
Middleware Technology (J2EE/EJB) RMI-IIOP/JNDI. 2 Distributed Objects EJB components are based on distributed objects. A distributed object can be called.
Advanced Programming Rabie A. Ramadan 7.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Java Naming and Directory Interfaces. A naming service is an entity that performs the following tasks:  It associates names with objects. Similar to.
J2EE Overview ver 1.0Page 1 © Wipro Technologies Talent Transformation J2EE Overview.
Ch 2 – Application Assembly and Deployment COSC 617 Jeff Schmitt September 14, 2006.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
RMI-IIOP.  RMI-IIOP combines RMI-style ease of use with CORBA cross-language interoperability  Java™ Remote Method Invocation (RMI) provides a simple.
RMI remote method invocation. Traditional network programming The client program sends data to the server in some intermediary format and the server has.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Java Naming and Directory Interface Matt. 2 What is JNDI.
Introduction to Enterprise JavaBeans Topics In Systems Architecture Barry Herbold
Assignment of JAVA id : BSSE-F10-M-10-JAVA1 Overview of J2EE/Session 2/Slide 1 of 38.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Spring LDAP Dima Ionut Daniel.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Presentation: RMI Continued 2 Using The Registry & Callbacks.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Enterprise JavaBeans: Fundamentals. EJB Fundamentals(c)CDAC(Formerly NCST)2 Contents Introduction Technology Overview EJB Architecture EJB Specification.
Alan L. Batongbacal CS 4244 / 01 Nov 2000
Java Naming and Directory Interface. Contents Naming and directory services JNDI RMI Conclusion.
JAVA LDAP Dima Ionut Daniel. Contents What is LDAP? LDAP Operations Directory Service JNDI as LDAP API Pooling Spring LDAP UnboundId LDAP SDK JAVA LDAP.
J2EE Lecture 10: EJB 3.0 Overview
Master of Information System Management
Java Remote Method Invocation (RMI)
Knowledge Byte In this section, you will learn about:
Java Messaging Service (JMS)
Java Messaging Service (JMS)
Remote method invocation (RMI)
Introduction to Session beans
Presentation transcript:

Topic : JNDI Kaster Nurmukan

JNDI2(c)CDAC(Formerly NCST) What is JNDI? Naming and Directory Services Naming Concepts Issues JNDI Architecture Programming with JNDI Role of JNDI in J2EE

JNDI3(c)CDAC(Formerly NCST) Class.forName("com.microsoft.jdbc. sqlserver.SQLServerDriver"); cnn = DriverManager.getConnection ("jdbc:microsoft:sqlserver://siddh ant:1433",“username",“password");

JNDI4(c)CDAC(Formerly NCST) Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(“myname”); Connection con = ds.getConnection(“abc”,”***”);

JNDI5(c)CDAC(Formerly NCST) Java Naming and Directory Interface (JNDI) provides a standard interface for Java applications to access naming and directory services.

JNDI6(c)CDAC(Formerly NCST) Naming Service performs: – Binding: Associating names with objects – Lookup: Find an object based on a name. Examples: DNS and File systems Examples: – DNS – Filesystems

JNDI7(c)CDAC(Formerly NCST) Directory is a naming service that stores objects with attributes. – Usernames and passwords etc stored in attrs. Tree like structure

JNDI8(c)CDAC(Formerly NCST) Atomic name is a indivisible component of a name – in /etc/fstab, etc and fstab are atomic names. Compound name is zero or more atomic names put together. – /etc/fstab is a compound name

JNDI9(c)CDAC(Formerly NCST) Binding is an association of a name with an object. – Filename “autoexec.bat” has a binding to some file data on the disk. – “c:\windows” foldername is bound to a folder on your drive. Compound name such as /usr/people/ed/.cshrc consists of multiple bindings, one to usr, one to people, one to ed, and one to.cshrc.

JNDI10(c)CDAC(Formerly NCST) Contains zero or more bindings. – Each binding has a distinct atomic name. /etc contains files named mtab and exports. The /etc folder is a context containing bindings with atomic names mtab and exports. mtab and exports are each bound to a file on the disk.

JNDI11(c)CDAC(Formerly NCST) /usr – CONTEXT – /usr/people – SUB-CONTEXT – /usr/bin – SUB-CONTEXT – /usr/local – SUB-CONTEXT Each atomic name is bound to a sub-context the subfolder. Subcontext are full-fledged contexts Can contain more name-object bindings, such as other files or other folders.

JNDI12(c)CDAC(Formerly NCST) Naming system: A connected set of contexts. Namespace: all the names contained within that naming system.

JNDI13(c)CDAC(Formerly NCST) Starting point for exploring a namespace. Starting point for performing all naming and directory operations.

JNDI14(c)CDAC(Formerly NCST) Many naming and directory products. – Netscape Directory Server – MicrosoftActiveDirectory Various naming and directory protocols: Each directory standard has a different protocol for accessing the directory. – Lightweight Directory Access Protocol (LDAP) – Network Information System (NIS) – Novell’s Network Directory System (NDS) EveryDS has it’s ownAPI.

JNDI15(c)CDAC(Formerly NCST) Standard interface to interact with naming and directory systems. For Java programs. Provides common interface to disparate directories: Same API for LDAP and NIS NDS. Used in EJB, RMI-IIOP, JDBC for operations like locating entities i.e. Users, Machines (e.g. printer), Objects, Services (e.g. datasource) etc.

JNDI16(c)CDAC(Formerly NCST) The client API – Allow Java code to perform directory operations. The Service Provider: Driver The Service Provider Interface (SPI) – An interface to which naming and directory service vendors can plug in.

JNDI17(c)CDAC(Formerly NCST)

JNDI18(c)CDAC(Formerly NCST) The JNDI comprises of 5 packages javax.naming – Contains classes and interfaces for accessing naming services javax.naming.directory – Extends javax.naming and provides functionality to access directory services in addition to naming services

JNDI19(c)CDAC(Formerly NCST) javax.naming.event – Classes and interfaces for supporting event notification in naming and directory services javax.naming.ldap – Classes and interfaces for using features that are specific to LDAP v3 that are not already covered by the more generic javax.naming.directory javax.naming.spi – Vendors develop their naming/directory services conforming to SPI. Applications can then access these services through the JNDI API

JNDI20(c)CDAC(Formerly NCST) Used to acquire an initial context Implementation of the JNDI driver: Knows the specific semantics of a particular directory structure. bootstrapping. Necessary information for JNDI to acquire that initial context. – The IP address of the J2EE server – The port number that the J2EE server accepts – Any username/password necessary to use the J2EE server.

JNDI21(c)CDAC(Formerly NCST) javax.naming.Context ctx = new javax.naming.InitialContext (System.getProperties()); java -Djava.naming.factory.initial= com.sun.jndi.fscontext.RefFSContextFactory -Djava.naming.provider.url= file:c:\examples.InitCtx class of the JNDI driver provider URL: URL that the service provider accepts for bootstrapping.

JNDI22(c)CDAC(Formerly NCST) Methods invoked on a Context list() - list of contents available at the context. – names of objects bound to the JNDI tree – subcontexts. lookup() - look up objects bound to the JNDI tree – Return type is driver specific RMI-IIOP java.rmi.Remote file system java.io.File

JNDI23(c)CDAC(Formerly NCST) rename() - give a new name to a context – c:\temp to c:\tmp createSubcontext() - create a subcontext at the context – c:\foo\bar at the folder c:\foo. destroySubcontext() - destroy a subcontext of the context – Destroy c:\foo\bar from the folder c:\foo. bind() – associates a name to a content and stores it at the Context – JNDI drivers accept different parameters to bind() rebind() - forces a bind even if some object is already bound to the name.

JNDI24(c)CDAC(Formerly NCST) import javax.naming.*; public class Startup { public static void main(String args[]) throws Exception { AccountImpl acct_impl = new AccountImpl(); Context ctx = new InitialContext (System.getProperties()); ctx.rebind(“myname", acct_impl); }

JNDI25(c)CDAC(Formerly NCST) import javax.naming.*; import java.rmi.*; public class Client { public static void main (String[] args) throws Exception { Context ctx = new InitialContext (System.getProperties()); Object remoteObject = ctx.lookup(“myname"); Account account = (Account) javax.rmi.PortableRemoteObject.narrow ( remoteObject, Account.class); int b = account.method1(5));}}

JNDI26(c)CDAC(Formerly NCST) J2EE servers have a JNDI implementation. Used to Look up beans. Connect to resource factories – JDBC DataSource – Java Message Service (JMS) drivers Acquiring a reference to the Java Transaction API’s (JTA) UserTransaction interface.

JNDI27(c)CDAC(Formerly NCST) Mastering Enterprise JavaBeans by Ed Roman et. al. (Wiley) JNDI Tutorial on java.sun.com Java Server Programming J2EE Edition – Volume 1 – Wrox. Java Enterprise in a nutshell – David Flanagan et. Al. – O’reilly