| org.apache.turbine.services.factory.Factory
Factory | public interface Factory (Code) | | Factory is an interface for object factories. Object factories
can be registered with the Factory Service to support customized
functionality during instantiation of specific classes that
the service itself cannot provide. Examples include
instantiation of XML parsers and secure sockets requiring
provider specific initializations before instantiation.
author: Ilkka Priha version: $Id: Factory.java 534527 2007-05-02 16:10:59Z tv $ |
Method Summary | |
Object | getInstance() Gets an instance of a class. | Object | getInstance(ClassLoader loader) Gets an instance of a class using a specified class loader.
Class loaders are supported only if the isLoaderSupported
method returns true. | Object | getInstance(Object[] params, String[] signature) 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: params - an array containing the parameters of the constructor. Parameters: signature - an array containing the signature of the constructor. | Object | getInstance(ClassLoader loader, Object[] params, String[] signature) 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. | void | init(String className) Initializes the factory. | boolean | isLoaderSupported() Tests if this object factory supports specified class loaders. |
getInstance | Object getInstance(ClassLoader loader) throws TurbineException(Code) | | Gets an instance of a class using a specified class loader.
Class loaders are supported only if the isLoaderSupported
method returns true. Otherwise the loader parameter is ignored.
Parameters: loader - the class loader. the instance. throws: TurbineException - if instantiation fails. |
getInstance | Object getInstance(Object[] params, String[] signature) throws TurbineException(Code) | | 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: params - an array containing the parameters of the constructor. Parameters: signature - an array containing the signature of the constructor. the instance. throws: TurbineException - if instantiation fails. |
getInstance | Object getInstance(ClassLoader loader, Object[] params, String[] signature) throws TurbineException(Code) | | 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: loader - the class loader. Parameters: params - an array containing the parameters of the constructor. Parameters: signature - an array containing the signature of the constructor. the instance. throws: TurbineException - if instantiation fails. |
init | void init(String className) throws TurbineException(Code) | | Initializes the factory. This method is called by
the Factory Service before the factory is used.
Parameters: className - the name of the production class throws: TurbineException - if initialization fails. |
isLoaderSupported | boolean isLoaderSupported()(Code) | | Tests if this object factory supports specified class loaders.
true if class loaders are supported, false otherwise. |
|
|