org.apache.ldap.server.jndi
Class ContextFactoryService

java.lang.Object
  extended byorg.apache.ldap.server.jndi.ContextFactoryService

public abstract class ContextFactoryService
extends java.lang.Object

Provides JNDI service to AbstractContextFactory.

Version:
$Rev: 264732 $, $Date: 2005-08-30 04:04:51 -0400 (Tue, 30 Aug 2005) $
Author:
The Apache Directory Project

Constructor Summary
ContextFactoryService()
           
 
Method Summary
static java.util.Set getAllInstances()
          Returns all instances of instantiated ContextFactoryService.
abstract  ContextFactoryConfiguration getConfiguration()
          Returns the configuration of this service.
static ContextFactoryService getInstance()
          Returns the default instance.
static ContextFactoryService getInstance(java.lang.String instanceId)
          Returns ContextFactoryService with the specified instance ID.
abstract  javax.naming.Context getJndiContext(java.lang.String baseName)
          Returns an anonymous JNDI Context with the specified baseName
abstract  javax.naming.Context getJndiContext(java.lang.String principal, byte[] credential, java.lang.String authentication, java.lang.String baseName)
          Returns a JNDI Context with the specified authentication information (principal, credential, and authentication) and baseName.
abstract  boolean isStarted()
          Returns true if this service is started.
abstract  void shutdown()
          Shuts down this service.
abstract  void startup(ContextFactoryServiceListener listener, java.util.Hashtable environment)
          Starts up this service.
abstract  void sync()
          Calls ContextPartition.sync() for all registered ContextPartitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextFactoryService

public ContextFactoryService()
Method Detail

getInstance

public static ContextFactoryService getInstance()
Returns the default instance. This method is identical with calling getInstance( Configuration.DEFAULT_INSTANCE_ID ).


getInstance

public static ContextFactoryService getInstance(java.lang.String instanceId)
Returns ContextFactoryService with the specified instance ID.


getAllInstances

public static java.util.Set getAllInstances()
Returns all instances of instantiated ContextFactoryService.


startup

public abstract void startup(ContextFactoryServiceListener listener,
                             java.util.Hashtable environment)
                      throws javax.naming.NamingException
Starts up this service.

Parameters:
listener - a listener that listens to the lifecycle of this service
environment - JNDI InitialContext environment
Throws:
javax.naming.NamingException - if failed to start up

shutdown

public abstract void shutdown()
                       throws javax.naming.NamingException
Shuts down this service.

Throws:
javax.naming.NamingException - if failed to shut down

sync

public abstract void sync()
                   throws javax.naming.NamingException
Calls ContextPartition.sync() for all registered ContextPartitions.

Throws:
javax.naming.NamingException - if synchronization failed

isStarted

public abstract boolean isStarted()
Returns true if this service is started.


getConfiguration

public abstract ContextFactoryConfiguration getConfiguration()
Returns the configuration of this service.


getJndiContext

public abstract javax.naming.Context getJndiContext(java.lang.String baseName)
                                             throws javax.naming.NamingException
Returns an anonymous JNDI Context with the specified baseName

Throws:
javax.naming.NamingException - if failed to create a context

getJndiContext

public abstract javax.naming.Context getJndiContext(java.lang.String principal,
                                                    byte[] credential,
                                                    java.lang.String authentication,
                                                    java.lang.String baseName)
                                             throws javax.naming.NamingException
Returns a JNDI Context with the specified authentication information (principal, credential, and authentication) and baseName.

Parameters:
principal - Context.SECURITY_PRINCIPAL value
credential - Context.SECURITY_CREDENTIALS value
authentication - Context.SECURITY_AUTHENTICATION value
Throws:
javax.naming.NamingException - if failed to create a context


Copyright © 2002-2005 . All Rights Reserved.