| org.apache.turbine.services.factory.FactoryService
All known Subclasses: org.apache.turbine.services.factory.TurbineFactoryService,
FactoryService | public interface FactoryService extends Service(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 version: $Id: FactoryService.java 534527 2007-05-02 16:10:59Z tv $ |
Field Summary | |
String | SERVICE_NAME The key under which this service is stored in TurbineServices. |
Method Summary | |
Object | getInstance(String className) Gets an instance of a named class.
Parameters: className - the name of the class. | 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. | 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. | 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. | 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. | boolean | isLoaderSupported(String className) Tests if specified class loaders are supported for a named class.
Parameters: className - the name of the class. |
SERVICE_NAME | String SERVICE_NAME(Code) | | The key under which this service is stored in TurbineServices.
|
getInstance | 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 | 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 | 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. |
getSignature | 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 | 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. |
|
|