| java.lang.Object org.apache.turbine.services.factory.TurbineFactory
TurbineFactory | abstract public class TurbineFactory (Code) | | The Factory Service instantiates objects using either default
class loaders or a specified one. Whether specified class
loaders are supported for a class depends on implementation
and can be tested with the isLoaderSupported method.
author: Ilkka Priha author: Henning P. Schmiedehausen version: $Id: TurbineFactory.java 534527 2007-05-02 16:10:59Z tv $ |
Method Summary | |
public static Object | getInstance(String className) Gets an instance of a named class.
Parameters: className - the name of the class. | public static Object | getInstance(String className, ClassLoader loader) Gets an instance of a named class using a specified class loader.
Class loaders are supported only if the isLoaderSupported
method returns true. | public static Object | getInstance(String className, 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: className - the name of the class. Parameters: params - an array containing the parameters of the constructor. Parameters: signature - an array containing the signature of the constructor. | public static Object | getInstance(String className, 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. | public static FactoryService | getService() | public static Class[] | getSignature(Class clazz, Object params, String signature) Gets the signature classes for parameters of a method of a class.
Parameters: clazz - the class. Parameters: params - an array containing the parameters of the method. Parameters: signature - an array containing the signature of the method. | public static boolean | isLoaderSupported(String className) Tests if specified class loaders are supported for a named class.
Parameters: className - the name of the class. |
getInstance | public static Object getInstance(String className, ClassLoader loader) throws TurbineException(Code) | | 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. Parameters: loader - the class loader. the instance. throws: TurbineException - if instantiation fails. |
getInstance | public static Object getInstance(String className, 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: className - the name of the 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 | public static Object getInstance(String className, 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: className - the name of the class. 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. |
getService | public static FactoryService getService()(Code) | | Utility method for accessing the service
implementation
An AssemblerBroker implementation instance |
getSignature | public static Class[] getSignature(Class clazz, Object params, String signature) throws ClassNotFoundException(Code) | | Gets the signature classes for parameters of a method of a class.
Parameters: clazz - the class. Parameters: params - an array containing the parameters of the method. Parameters: signature - an array containing the signature of the method. an array of signature classes. Note that in some casesobjects in the parameter array can be switched to the contextof a different class loader. throws: ClassNotFoundException - if any of the classes is not found. |
isLoaderSupported | public static boolean isLoaderSupported(String className) throws TurbineException(Code) | | Tests if specified class loaders are supported for a named class.
Parameters: className - the name of the class. true if class loaders are supported, false otherwise. throws: TurbineException - if test fails. |
|
|