org.norther.tammi.core.base
Interface ObjectFactory

All Known Subinterfaces:
CommonFactory, CommonSecureFactory, ConfigurableFactory, DOMBuilderFactory, Factory, HibernatePersisterFactory, JFCFactory, KeyStoreFactory, Logger, MessageDigestFactory, OJBPersisterFactory, PersisterFactory, Pool, SAXParserFactory, Scripter, SecureServerChannelFactory, SecureServerSocketFactory, SecureSocketFactory, ServerChannelFactory, ServerSocketFactory, SocketFactory, ThreadedLogger, ThreadFactory, VariableRegistry, XMLPersisterFactory
All Known Implementing Classes:
AbstractCommonFactory, AbstractCommonSecureFactory, AbstractLogger, AbstractPersisterFactory, AbstractSecureSocketFactory, AbstractSocketFactory, AbstractThreadedLogger, DefaultBaseQueryFactory, DefaultConfigurableFactory, DefaultContextFactory, DefaultDOMBuilderFactory, DefaultFactory, DefaultHibernatePersisterFactory, DefaultJFCFactory, DefaultKeyStoreFactory, DefaultMessageDigestFactory, DefaultObjectFactory, DefaultOJBPersisterFactory, DefaultPool, DefaultReportQueryFactory, DefaultSAXParserFactory, DefaultScripter, DefaultSecureServerChannelFactory, DefaultSecureServerSocketFactory, DefaultSecureSocketFactory, DefaultServerChannelFactory, DefaultServerSocketFactory, DefaultSessionFactory, DefaultSocketFactory, DefaultThreadFactory, DefaultVariableRegistry, DefaultXMLPersisterFactory, JDK4Logger, Log4JLogger

public interface ObjectFactory

An interface to object factories providing a set of factory methods required by registration to Factory.

Author:
Ilkka Priha

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.
 

Method Detail

getInstance

Object getInstance(String className)
                   throws ConstructionException
Gets an instance of a named class.

Parameters:
className - the name of the class.
Returns:
the instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   ObjectName loader)
                   throws ConstructionException
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.

Parameters:
className - the name of the class.
loader - the class loader.
Returns:
the instance.
Throws:
ConstructionException - if construction fails.

getInstance

Object getInstance(String className,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
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.

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

Object getInstance(String className,
                   ObjectName loader,
                   Object[] params,
                   String[] signature)
                   throws ConstructionException
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.

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

boolean isLoaderSupported(String className)
Checks if specified class loaders are supported for a named class.

Parameters:
className - the name of the class.
Returns:
true if class loaders are supported, false otherwise.


Copyright © 2004 The Norther Organization. All rights reserved.