net.sf.jldapbeans.lang
Class LdapBeanFactory

java.lang.Object
  extended by net.sf.jldapbeans.lang.LdapBeanFactory
All Implemented Interfaces:
javax.naming.spi.DirObjectFactory, javax.naming.spi.ObjectFactory

public class LdapBeanFactory
extends java.lang.Object
implements javax.naming.spi.DirObjectFactory

The LdapBeanFactory is the entry point of the mechanism that retrieves an object from the LDAP directory, instantiates a java bean and fills its properties with the attribute values from the LDAP object.

Version:
1.0 $ Revision 01-nov-2005 :: alonso $
Author:
A. Alonso Domínguez
See Also:
DirObjectFactory

Constructor Summary
LdapBeanFactory()
           
 
Method Summary
protected  java.lang.String[] getObjectClasses(javax.naming.directory.Attribute objectClass)
          Reads the objectClass attribute to get an array of strings
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context ctx, java.util.Hashtable env)
           
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name name, javax.naming.Context ctx, java.util.Hashtable env, javax.naming.directory.Attributes attrs)
          Entry point from DirObjectFactory that starts the process of retrieving LdapBeans from the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapBeanFactory

public LdapBeanFactory()
Method Detail

getObjectClasses

protected java.lang.String[] getObjectClasses(javax.naming.directory.Attribute objectClass)
                                       throws javax.naming.NamingException
Reads the objectClass attribute to get an array of strings

Parameters:
objectClass - An instance of javax.naming.directory.Attribute which represents the values of the objectClass attribute.
Returns:
An array of strings with the objectClass names.
Throws:
javax.naming.NamingException

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name name,
                                          javax.naming.Context ctx,
                                          java.util.Hashtable env)
Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name name,
                                          javax.naming.Context ctx,
                                          java.util.Hashtable env,
                                          javax.naming.directory.Attributes attrs)
                                   throws java.lang.Exception
Entry point from DirObjectFactory that starts the process of retrieving LdapBeans from the server.

Specified by:
getObjectInstance in interface javax.naming.spi.DirObjectFactory
Parameters:
obj - Object received from the ldap server.
name - Name of the context
ctx - The LdapContext of the object
env - Actual environment
attrs - Attributes of the context
Returns:
A LdapBean initialized and ready to use
Throws:
java.lang.Exception


Copyright © 2005 jLDAPBeans Team. All Rights Reserved.