org.norther.tammi.core.naming
Class DefaultNamingContextFactory

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.config.DefaultConfigurable
          extended by org.norther.tammi.core.config.DefaultConfigurableFactory<Context>
              extended by org.norther.tammi.core.naming.DefaultNamingContextFactory
All Implemented Interfaces:
Serializable, EventListener, NotificationBroadcaster, NotificationEmitter, TraceListener, Manageable, MBeanDelegate, ObjectFactory<Context>, Startable, Configurable, ConfigurableFactory<Context>, NamingContextFactory

public class DefaultNamingContextFactory
extends DefaultConfigurableFactory<Context>
implements NamingContextFactory

A default implementation of NamingContextFactory. The specified class name must implement the javax.naming.Context interface.

In addition to javax naming contexts, it supports instances of DomainContext instances that can be configured with domain specific properties of this factory.

Version:
$Id: DefaultNamingContextFactory.java,v 1.3 2009/09/28 15:08:44 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.norther.tammi.core.config.DefaultConfigurable
DefaultConfigurable.Modified
 
Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.naming.NamingContextFactory
AUTH_ATTRIBUTE, DESCRIPTION_ATTRIBUTE, ENVIRONMENT_PREFIX, FACTORY_ATTRIBUTE, GLOBAL_ATTRIBUTE, NAME_ATTRIBUTE, NAMING_DOMAIN_PROPERTY, PATTERN_ATTRIBUTE, RESOURCE_ENV_PREFIX, RESOURCE_LINK_PREFIX, RESOURCE_PREFIX, SCOPE_ATTRIBUTE, TRANSACTION_NAME, TRANSACTION_PREFIX, TYPE_ATTRIBUTE, VALUE_ATTRIBUTE
 
Constructor Summary
DefaultNamingContextFactory()
          Constructs a default naming context factory.
 
Method Summary
 void clearContexts()
          Clears all contexts.
 Context getDomainContext(String domain)
          Gets a domain specific context.
 Context getInitialContext(String domain)
          Gets an initial context.
 Context getInstance(String className, ObjectName loader, Object[] params, String[] signature)
          Gets an instance of a named class using a specified class loader.
 boolean isStarted()
          Checks whether the startable has been started.
 void removeContext(String domain)
          Removes a domain specific context and the corresponding initial context.
 void start()
          Starts the MBean.
 void stop()
          Stops the MBean.
 
Methods inherited from class org.norther.tammi.core.config.DefaultConfigurableFactory
getInstance, getInstance, getInstance, isLoaderSupported
 
Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, checkConfiguration, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties, validateConfiguration
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, postmanaged, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unmanaged, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.base.ObjectFactory
getInstance, getInstance, getInstance, isLoaderSupported
 
Methods inherited from interface org.norther.tammi.core.config.Configurable
addProperty, addProperty, addPropertyFilePath, addPropertyFilePath, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, getPropertyFilePaths, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, removePropertyFilePath, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, setPropertyFilePaths, setPropertyFilePaths, storeProperties
 

Constructor Detail

DefaultNamingContextFactory

public DefaultNamingContextFactory()
Constructs a default naming context factory.

Method Detail

isStarted

public boolean isStarted()
Description copied from interface: Startable
Checks whether the startable has been started.

Specified by:
isStarted in interface Startable
Returns:
true if started, otherwise false.

start

public void start()
           throws Exception
Description copied from interface: Startable
Starts the MBean.

Specified by:
start in interface Startable
Throws:
Exception - if start fails.

stop

public void stop()
Description copied from interface: Startable
Stops the MBean.

Specified by:
stop in interface Startable

getDomainContext

public Context getDomainContext(String domain)
Description copied from interface: NamingContextFactory
Gets a domain specific context.

Specified by:
getDomainContext in interface NamingContextFactory
Parameters:
domain - the domain name.
Returns:
the context or null if not bound.

getInitialContext

public Context getInitialContext(String domain)
Description copied from interface: NamingContextFactory
Gets an initial context.

Specified by:
getInitialContext in interface NamingContextFactory
Parameters:
domain - the domain name.
Returns:
the context or null if not bound.

removeContext

public void removeContext(String domain)
Description copied from interface: NamingContextFactory
Removes a domain specific context and the corresponding initial context.

Specified by:
removeContext in interface NamingContextFactory
Parameters:
domain - the domain name.

clearContexts

public void clearContexts()
Description copied from interface: NamingContextFactory
Clears all contexts.

Specified by:
clearContexts in interface NamingContextFactory

getInstance

public Context getInstance(String className,
                           ObjectName loader,
                           Object[] params,
                           String[] signature)
                    throws ConstructionException
Description copied from interface: ObjectFactory
Gets an instance of a named class using a specified class loader. Parameters for its constructor are given as an array of objects, primitive types must be wrapped with a corresponding class.

Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.

Specified by:
getInstance in interface ObjectFactory<Context>
Overrides:
getInstance in class DefaultConfigurableFactory<Context>
Parameters:
className - the name of the class.
loader - the class loader.
params - an array containing the parameters of the constructor.
signature - an array containing the signature of the constructor.
Returns:
the instance.
Throws:
ConstructionException - if construction fails.


Copyright © 2004 The Norther Organization. All rights reserved.