JNDI란 정확히 뭔데??

2012. 12. 12. 15:21Language/Java

반응형

2012/11/12 - [Language/Java] - [용어] JNDI

JNDI...(Java Naming and Directory Interface)
이름만으로는 도저히..@_@;;; 뭐하는 건지 자세히는 모르겠다.
그냥 이름과 디렉토리로 어떻게 하는건가???? 라는 물음표만 남을뿐..



JNDI is a standard interface to naming and directory services for enterprise applications
음... 위의 영어로 된 내용도 너무 추상적이다--;;; 대충 엔터프라이즈 애플리케이션을 위한 네이밍과 디렉토리 서비스 표준 인터페이스이다..라고만 대충 알고 우선은 넘어가자!!



  • Learn the concepts of naming services(네이밍 서비스의 개념)

    여러 분산 시스템들이 있다고 하자. Naming은 이런 분산 시스템들의 서비스들 중에 하나 이다.
    그리고 바인딩이라는것이 있는데 예를 들면 acet.pe.kr 는 ip address100.200.300.400 이였던 것이다.
    소위 DNS(Domain Naming Service)을 생각하면 더 빠르게 이해가 될 듯 싶다.
    즉, 핵심은 Naming - Binding 의 형태로 서비스를 하는 것이다.

  • Learn the concepts of directory services(디렉토리 서비스의 개념)
    디렉토리 서비스..는??
    빠른조회, 드문 삽입, 삭제, 수정에 대한 저장오브젝트들인 특별한 타입의 데이터베이스라고 볼 수 있다.
    LDAP 이 가장 인기있는 directory protocol 이다. 표준 네트워크 디렉토리 서비스 이다.

  • Explore the JNDI architecture(JNDI의 아키텍처)
    JNDI is a unified Java API designed to standardized access to
    a variety of naming and directory services

    2가지로 구분 되어진다. API, SPI

    • An application-level programming interface (API). APIs are used by the application components to access naming and directory services.
      우리가 잘 알고 있는 API 형태

    • A service provider interface (SPI). This part of the API is used to plug in a provider of a naming and directory service to the J2EE platform.
      API의 부분으로써 J2EE플랫폼 기반에 네이밍과 디렉토리 서비스의 제공자를 연결시킨다.
      즉 SPI가 LDAP, DNS, NDS등 서비스 제공자들을 연결 시킨다.

    The JNDI model defines a hierarchical namespace in which you name objects.
    Each object in the namespace may have attributes that can be used to search for the object.


  • Learn the JNDI API classes and interfaces
    The main JNDI API package is the javax.naming package, which contains one key class, InitialContext, and two key interfaces, Context and Name.

  • Study the JNDI context and its operations

    After a client connects to the JNDI service and obtains a JNDI context using InitialContext(), it can apply any of the interface methods. The main operations of the javax.naming.Context interface are the use of bind()
    to add an entry,
    rebind() to replace an entry name, lookup() to find or locate an object, and unbind() to delete an entry.

  • Explore how to use the JNDI to support other J2EE services
    JNDI is a fundamental service to all J2EE applications. One key target is the isolation of the development of J2EE component code from the deployment environment. This allows an application component to be customized without the need to access or change its source code.JNDI defines a logical namespace (directory) that application components (such as EJBs, servlets, JavaServer Pages [JSPs], and JDBC) can use to name resources, components, and other data. The namespace is provided to a component by its container, which executes the component. Typically, a component has a deployment descriptor that contains, among other data, information about the logical names and types of resources that the component references. Components of the Web tier are specified in the web.xml deployment descriptor, and those of the EJB tier are specified in the ejb-jar.xml deployment descriptor.

위에 것들은 읽어보면 좋을 것 같아서 발췌했다.

참고 사이트 : http://ejbvn.wordpress.com/category/week-1-enterprise-java-architecture/day-04-using-jndi-for-naming-services-and-components/#ch04fig02


그리고 조금 더 찾다가보니 정말 정리가 잘된 곳을 발견! 역시...

다시 한번 정리 해보자면..


Naming 서비스는 Java Naming and Directory Interface(JNDI) API를 이용하여 자원(Resource)를 찾을 수 있도록 도와주는 서비스이다.
Naming 서비스를 지원하는 Naming 서버에 자원을 등록하여 다른 어플리케이션에서 사용할 수 있도록 공개하고, Naming 서버에 등록되어 있는 자원을 찾아와서 이용할 수 있게 한다.


Java Naming and Directory Interface(JNDI)

Java Naming and Directory Interface(JNDI)는 Java 소프트웨어 클라이언트가 이름(name)을 이용하여 데이터 및 객체를 찾을 수 있도록 도와주는 디렉토리 서비스에 대한 Java API이다.

참고사이트 : http://www.egovframe.org/wiki/doku.php?id=egovframework:rte2:itl:naming_service
                   http://en.wikipedia.org/wiki/JNDI


음.. JNDI를 통해 Datasource에 접근한다고 해서 찾아보았는데..
JNDI가 이제는 대충 감이 왔다. 이제는 이 개념을 가지고 실전에서는 어떤 방식으로 어떻게 하고 있는지를  봐야 할 것 같다.

-끝-


반응형

'Language > Java' 카테고리의 다른 글

JMS란?  (1) 2013.01.07
MySQL+Apache Tomcat 6.0 JNDI Datasource How to  (2) 2012.12.12
[용어] JNDI  (0) 2012.11.12
Failed to create the Java Virtual Machine  (0) 2012.09.07
자바 보안  (0) 2012.06.04