JavaBeat
Search JavaBeat

JAVABEAT
home
articles
tips
QnA
Books
forums
ARTICLE TOPICS
All Articles
Java 5.0
Java 6.0
EJB 3.0
JCA
Struts
JSF
Spring
Groovy
JBoss Seam
Hibernate
Eclipse
JavaFx
Google Guice
J2ME
GWT
WebServices
AJAX
ARCHIVE
2007 | 12 11 10 09 08 07 06 05 04 03
2008 | 07 06 05 04 03 02 01
CERTIFICATION KITS
350 SCJP 1.5 Mock Exams
400 SCJP 1.6 Mock Exams
300 SCWCD 5.0 Mock Exams
300 SCBCD 5.0 Mock Exams
Enter email address:

Latest JavaBeat Articles Delivered by FeedBurner
OUR NETWORK
javabeat
planetoss
Sponsors
Java Jobs eCommerce software Get Ubuntu 8.04 Get FireFox 3.0  

Pages : 1 2 3 4

Accessing objects in JNDI using Spring

Author : Christy
Date : Mon Oct 22nd, 2007
Topic : spring java 
Enter email address:

Latest JavaBeat Articles Delivered

1) Introduction

Spring provides support to access objects from the JNDI Repository. This article will begin with the JNDI concepts along with a sample JNDI Application. Then it will proceed with the various core supporting classes available in Spring for JNDI Integration. Following that, practical samples would be given to make things clear. The pre-requisite for this article is some basic introductory knowledge in Spring which can be got by reading the article in javabeat Introduction to Spring Web Framework.

2) JNDI

2.1) Introduction

JNDI stands for Java Naming and Directory interface. It is a specification and API that can be used to access any type directory service. For example, a particular implementation of JNDI specification can be used to access the LDAP Repository. JNDI is used heavily by the J2EE Applications to store Application specific data and business objects.

Imagine the case of a J2EE Application, where it is having a Web module and a EJB Module. A Web module is used to handle the Http Request from the Browser client, process it and then will return the Http Response back to the client. It basically will contain a collection of Servlet components and JSP's. The Web module may use the EJB module for accessing the Enterprise Beans for data manipulation. Suppose, say that we want to store data that is common to both Web and EJB Module. Where we can store this information, in the Web Module or in the EJB Module?. It doesn't make sense to store the data in any of the Modules, because the data is a common data and it is not particularly restricted to any of the Modules.

Here comes the JNDI Repository. The Application Server Container will provide an implementation for the JNDI Repository for storing the global data (data that is common across the modules) and the clients (either the Enterprise Beans, or the Servlets or even the Application client) can use the JNDI API to query the information available in the JNDI Repository. It is also possible to store the Business Objects (like Session Beans, Message Driven beans) in the JNDI Repository. In this case, a Servlet may be the client in getting a reference to the Enterprise Bean from the Repository. It is not necessary for an Application Developer to manually store the Business Objects into the JNDI Repository as the Container will take care of all these things, like constructing the JNDI Tree, storing the Business objects etc.

 
Pages : 1 2 3 4
 

Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat