JNDI « J2EE Enterprise « Java Articles

Java Articles
1. Build Deploy
2. Class
3. Core Library
4. Data Types
5. Database JDBC
6. Design
7. Development
8. File Input Output
9. Graphics Desktop
10. J2EE Enterprise
11. J2ME Wireless
12. JVM
13. Language
14. Library Product
15. Network
16. Security
17. SOA Web Services
18. Test
19. Web Development
20. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Products
Java by API
Photoshop Tutorial
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Articles » J2EE Enterprise » JNDI 
1. JNDI overview, Part 3: Advanced JNDI
"Before I begin, a little doublethink is in order. Over the last two months, I've tried to convince you that naming and directory services are roughly the electronic equivalent of the card catalogs found in libraries. Now as we begin our tour of the advanced features of JNDI, I want you to forget this analogy completely -- it grossly underillustrates the power of JNDI."

2. JNDI overview, Part 1: An introduction to naming services
"This month, I introduce the Java Naming and Directory Interface (JNDI). JNDI provides a common-denominator interface to many existing naming services. As such, JNDI was not designed to replace existing technology; instead, it provides a common interface to existing naming services. Let's begin by taking a look at some of these services."

3. JNDI overview, Part 2: An introduction to directory services
"Directory services are simple databases. Like their relational cousins, many common directory services provide search and filter functionality. Instead of locating an entry only by name, these directory services allow you to locate entries based on a set of search criteria."

4. JNDI overview, Part 4: the Doc-u-Matic, a JNDI application
"You may recall from March's column that there are three techniques for storing Java objects in a JNDI service: as serialized data, as a reference to an object, and as the attributes on a directory context. Storing an object as serialized data is the simplest of the three techniques. Storing an object as a reference is useful in situations in which it doesn't make sense (or isn't possible) to store actual objects. Finally, storing objects as attributes on a directory context is useful when other, non-Java applications need access to the object's information. The application I've developed uses the first two methods of object storage."

5. Developing A White Pages Service with LDAP and JNDI
"Lightweight Directory Access Protocol (LDAP) is increasingly popular because it simplifies what has been complex, namely, accessing directory services. In this article you will learn what you can do with LDAP and how Java handles LDAP with its Java Naming and Directory Interface (JNDI) API. At the end of the article, you will find a project that provides a white pages service built with LDAP and JNDI."

6. Intercepting JNDI Filters
"JNDI filters are Java classes that can be invoked in response to a request for a resource in an intercepted JNDI object. They are very similar to Servlet filters but are used on the server-side."

7. Developing JNDI-based Applications
"The DNS service provider enables JNDI-based applications to access information stored in the DNS. The DNS service provider presents the DNS namespace as a tree of JNDI directory contexts, and the DNS resource records as JNDI attributes."

8. Navigate the JNDI maze
"The next bits of information your client needs are values for some properties. First, you'll need some value for java.naming.factory.initial. This property points to a class that provides an initial context factory. A typical value for this property, which we'll be using for these examples, would be com.sun.jndi.cosnaming.CNCtxFactory; this class exists in rt.jar and as such is part of the base JVM. This factory is for use by CosNaming nameservers, but the JVM includes an LDAP factory as well. Different application servers provide their own initial context factories, as we'll see later."

9. Apache Geronimo JNDI naming and Java resource connection pools, Part 3: Mail sessions
"This <resource-ref> tag associates the JNDI name to the resource object's type, which in this case is javax.mail.Session. If it looks familiar, it's because it's the same tag used to declare the object types of other resources like data sources (for JDBC) or connection factories (for JMS). Both of these resource types have already been used elsewhere in the example application. Listing 2 contains the tag needed in the corresponding Geronimo-specific plan."

10. Integrate Crystal Reports in Web applications using Rational Application Developer, Part 2: Embed Crystal Reports in Web applications using JDBC Connection at design time and JNDI Connection at run time
"In the previous three steps, you learned how to embed Crystal Reports in your Web applications that use JDBC connections at design time and run time. This step explains how to use JDBC at design time and switch to JNDI at run time. To use JNDI at run time, first you have to create a data source. Then you will re-visit the Standard Report Creation Wizard, sub-step 9 of Step 2, to use this data source for making the JNDI connection at run time. Because your project is targeted to the WebSphere V 6.0.2.5 test environment, you can use the Rational Application Developer Enhanced EAR editor to create this data source."

11. Apache Geronimo JNDI naming and Java resource connection pools, Part 1: Data source connections
"Configuring the descriptor files is important, because it's the mechanism that allows these components to be used in Geronimo. It's also how JNDI names get associated with a given Java object. Components deployed in Geronimo typically have two deployment files: the standard Java deployment descriptor and the Geronimo-specific deployment plan. The primary resource is the CustomerServiceDatabase. The data source, CustomerServicePool, provides a number of connections to access this database. To store customer information, the user first accesses the Web interface and types information in the fields. Those fields are passed to a Java bean that references a session bean. This session bean acts on the customer data by referencing an entity bean to perform the basic database operations. The entity bean is the Java object representation of one row in the customer's table, and it's the component that references the CustomerServicePool to access the database. Listing 2 contains the standard Java deployment descriptor for this entity bean."

12. EJB best practices: Industrial-strength JNDI optimization
"In addition to being more clear (at least in my opinion) the factory-optimized EJB lookup above will perform much faster over time. The first time you use the new class, you'll incur all the usual lookup penalties (assuming another portion of the application hasn't already paid them) but all future JNDI lookups should hum right along. It's also worth pointing out that the home-interface factory will not interfere with your container's bean management. Containers manage bean instances, not the home interfaces of those instances. Your container will still be in charge of instance swapping, as well as any other optimizations you want it to perform."

13. Apache Geronimo JNDI naming and Java resource connection pools, Part 2: Using Java Message Services
"The factory and receivingTopic are both obtained from JNDI and correspond to the resources CustomerServiceConnectionFactory and CustomerServiceTopic, respectively. Both of these resources were created using the Geronimo console. Listing 9 shows how to use these JMS resources to send a message to a destination."

14. The role of JNDI in J2EE
"Dolly could have avoided this dilemma if she had developed her application with knowledge of the J2EE roles. The J2EE specification delegates responsibilities into numerous development roles: Component Provider, Application Assembler, Deployer, and System Administrator. (In many organizations, the Component Provider and Assembler roles are merged, as are the Deployer and System Administrator roles.) Before JNDI's role in J2EE can be truly understood, it's important to grasp what the J2EE roles do."

15. Locating Resources Using JNDI (Java Naming and Directory Interface)
"JNDI provides a uniform API into a naming or directory service. You can use any naming or directory service through JNDI as long as you have access to a Service Provider implementation for that service."

16. JNDI and the new JDBC 2.0 Standard Extension
"For the most part, these features are entirely transparent to developers. In fact, support for connection pooling and distributed transactions requires almost no new knowledge on the part of the developer. This article explores the part of the JDBC 2.0 Standard Extension that will have the most impact on developers, the JNDI support."

w__w___w__.__j___a_v__a2s__.co___m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.