org.sape.carbon.services.jndi
Class DefaultInitialContextFactoryImpl

java.lang.Object
  |
  +--org.sape.carbon.services.jndi.DefaultInitialContextFactoryImpl
All Implemented Interfaces:
Configurable, FunctionalInterface, InitialContextFactory, Initializable

public class DefaultInitialContextFactoryImpl
extends Object
implements InitialContextFactory, Configurable, Initializable

Default implementation of InitialContextFactory

Copyright 2003 Sapient

Since:
carbon 2.1
Version:
$Revision: 1.2 $($Author: dvoet $ / $Date: 2003/10/30 19:28:56 $)
Author:
Douglas Voet, Jul 30, 2003

Field Summary
protected  Hashtable environment
           
private  org.apache.commons.logging.Log log
           
 
Constructor Summary
DefaultInitialContextFactoryImpl()
           
 
Method Summary
 void configure(ComponentConfiguration configuration)
          Configure the component.
 InitialContext getContext()
          Gets a new InitialContext instance with evironment values that come from the service's configuration.
 InitialContext getContext(Map givenEnvironment)
          Gets a new InitialContext instance with evironment values that come from the service's configuration, but environment values can also be passed via the environment parameter to augment or override the values stored in configuration.
 InitialContext getContextIgnoreConfig(Map givenEnvironment)
          Gets a new InitialContext with environment values given in the evironment parameter.
 InitialDirContext getDirContext()
          Gets a new InitialDirContext instance with evironment values that come from the service's configuration.
 InitialDirContext getDirContext(Map givenEnvironment)
          Gets a new InitialDirContext instance with evironment values that come from the service's configuration, but environment values can also be passed via the environment parameter to augment or override the values stored in configuration.
 InitialDirContext getDirContextIgnoreConfig(Map givenEnvironment)
          Gets a new InitialDirContext with environment values given in the evironment parameter.
 void initialize(Component thisComponent)
          Initialize the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.commons.logging.Log log

environment

protected Hashtable environment
Constructor Detail

DefaultInitialContextFactoryImpl

public DefaultInitialContextFactoryImpl()
Method Detail

configure

public void configure(ComponentConfiguration configuration)
Description copied from interface: Configurable
Configure the component. This is preceded and followed by the suspend and resume operations if they are available on the component.

Specified by:
configure in interface Configurable
Parameters:
configuration - the configuration for this component

initialize

public void initialize(Component thisComponent)
Description copied from interface: Initializable
Initialize the component. Called immediately after the Component's constructor. On return, the container may start the component.

Specified by:
initialize in interface Initializable
Parameters:
thisComponent - the reference to the component that this object is a part of. Store this referece within your Functional Implementation for future use.

getContext

public InitialContext getContext()
                          throws NamingException
Gets a new InitialContext instance with evironment values that come from the service's configuration.

Specified by:
getContext in interface InitialContextFactory
Returns:
a new InitalContext
Throws:
NamingException - this is also logged at the info level

getContext

public InitialContext getContext(Map givenEnvironment)
                          throws NamingException
Gets a new InitialContext instance with evironment values that come from the service's configuration, but environment values can also be passed via the environment parameter to augment or override the values stored in configuration.

Specified by:
getContext in interface InitialContextFactory
Parameters:
givenEnvironment - values that augment and/or override the values stored in configuration
Returns:
a new InitialContext
Throws:
NamingException - this is also logged at the info level

getContextIgnoreConfig

public InitialContext getContextIgnoreConfig(Map givenEnvironment)
                                      throws NamingException
Gets a new InitialContext with environment values given in the evironment parameter. The service's configuration is ignored.

Specified by:
getContextIgnoreConfig in interface InitialContextFactory
Parameters:
givenEnvironment - values used to construct the InitialContext
Returns:
a new InitialContext
Throws:
NamingException - this is also logged at the info level

getDirContext

public InitialDirContext getDirContext()
                                throws NamingException
Gets a new InitialDirContext instance with evironment values that come from the service's configuration.

Specified by:
getDirContext in interface InitialContextFactory
Returns:
a new InitialDirContext
Throws:
NamingException

getDirContext

public InitialDirContext getDirContext(Map givenEnvironment)
                                throws NamingException
Gets a new InitialDirContext instance with evironment values that come from the service's configuration, but environment values can also be passed via the environment parameter to augment or override the values stored in configuration.

Specified by:
getDirContext in interface InitialContextFactory
Parameters:
givenEnvironment - values that augment and/or override the values stored in configuration
Returns:
a new InitialDirContext
Throws:
NamingException

getDirContextIgnoreConfig

public InitialDirContext getDirContextIgnoreConfig(Map givenEnvironment)
                                            throws NamingException
Gets a new InitialDirContext with environment values given in the evironment parameter. The service's configuration is ignored.

Specified by:
getDirContextIgnoreConfig in interface InitialContextFactory
Parameters:
givenEnvironment - values used to construct the InitialContext
Returns:
a new InitialDirContext
Throws:
NamingException


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.