org.norther.tammi.core.config
Class DefaultConfigurableFactory

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
All Implemented Interfaces:
Serializable, EventListener, NotificationBroadcaster, NotificationEmitter, TraceListener, Manageable, MBeanDelegate, ObjectFactory, Configurable, ConfigurableFactory
Direct Known Subclasses:
AbstractLogger, AbstractPersisterFactory, DefaultContextFactory, DefaultSessionFactory

public class DefaultConfigurableFactory
extends DefaultConfigurable
implements ConfigurableFactory

A default implementation of ConfigurableFactory.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.config.DefaultConfigurable
MODIFIED, SYNCHRONIZED, UNMODIFIED
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
DefaultConfigurableFactory()
          Constructs a new factory.
DefaultConfigurableFactory(ObjectFactory adaptee)
          Constructs a new factory adapter.
 
Method Summary
 Object getInstance(String className)
          Gets an instance of a named class.
 Object getInstance(String className, Object[] params, String[] signature)
          Gets an instance of a named class.
 Object getInstance(String className, ObjectName loader)
          Gets an instance of a named class using a specified class loader.
 Object getInstance(String className, ObjectName loader, Object[] params, String[] signature)
          Gets an instance of a named class using a specified class loader.
 boolean isLoaderSupported(String className)
          Checks if specified class loaders are supported for a named class.
 
Methods inherited from class org.norther.tammi.core.config.DefaultConfigurable
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getConfiguration, getModifiedState, getProperties, getProperty, getPropertyFilePath, indexOfProperty, loadConfiguration, loadConfiguration, loadConfiguration, modified, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setModifiedState, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties
 
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.config.Configurable
addProperty, addProperty, clearProperties, containsProperty, getConfigKey, getProperties, getProperty, getPropertyFilePath, indexOfProperty, propertyMap, propertyMap, removeProperty, removeProperty, setConfigKey, setProperties, setProperty, setPropertyFilePath, setPropertyFilePath, storeProperties
 

Constructor Detail

DefaultConfigurableFactory

public DefaultConfigurableFactory()
Constructs a new factory.


DefaultConfigurableFactory

public DefaultConfigurableFactory(ObjectFactory adaptee)
Constructs a new factory adapter.

Parameters:
adaptee - the adaptee.
Method Detail

getInstance

public Object getInstance(String className)
                   throws ConstructionException
Description copied from interface: ObjectFactory
Gets an instance of a named class.

Specified by:
getInstance in interface ObjectFactory
Parameters:
className - the name of the class.
Returns:
the instance.
Throws:
ConstructionException - if construction fails.

getInstance

public Object getInstance(String className,
                          ObjectName loader)
                   throws ConstructionException
Description copied from interface: ObjectFactory
Gets an instance of a named class using a specified class loader.

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

Specified by:
getInstance in interface ObjectFactory
Parameters:
className - the name of the class.
loader - the class loader.
Returns:
the instance.
Throws:
ConstructionException - if construction fails.

getInstance

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

Specified by:
getInstance in interface ObjectFactory
Parameters:
className - the name of the class.
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.

getInstance

public Object 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
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.

isLoaderSupported

public boolean isLoaderSupported(String className)
Description copied from interface: ObjectFactory
Checks if specified class loaders are supported for a named class.

Specified by:
isLoaderSupported in interface ObjectFactory
Parameters:
className - the name of the class.
Returns:
true if class loaders are supported, false otherwise.


Copyright © 2004 The Norther Organization. All rights reserved.