|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.factory.TurbineFactory
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.
Constructor Summary | |
TurbineFactory()
|
Method Summary | |
static java.lang.Object |
getInstance(java.lang.String className)
Gets an instance of a named class. |
static java.lang.Object |
getInstance(java.lang.String className,
java.lang.ClassLoader loader)
Gets an instance of a named class using a specified class loader. |
static java.lang.Object |
getInstance(java.lang.String className,
java.lang.ClassLoader loader,
java.lang.Object[] params,
java.lang.String[] signature)
Gets an instance of a named class using a specified class loader. |
static java.lang.Object |
getInstance(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] signature)
Gets an instance of a named class. |
static FactoryService |
getService()
Utility method for accessing the service implementation |
static java.lang.Class[] |
getSignature(java.lang.Class clazz,
java.lang.Object[] params,
java.lang.String[] signature)
Gets the signature classes for parameters of a method of a class. |
static boolean |
isLoaderSupported(java.lang.String className)
Tests if specified class loaders are supported for a named class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TurbineFactory()
Method Detail |
public static FactoryService getService()
public static java.lang.Object getInstance(java.lang.String className) throws TurbineException
className
- the name of the class.
TurbineException
- if instantiation fails.public static java.lang.Object getInstance(java.lang.String className, java.lang.ClassLoader loader) throws TurbineException
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
className
- the name of the class.loader
- the class loader.
TurbineException
- if instantiation fails.public static java.lang.Object getInstance(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature) throws TurbineException
className
- the name of the class.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
TurbineException
- if instantiation fails.public static java.lang.Object getInstance(java.lang.String className, java.lang.ClassLoader loader, java.lang.Object[] params, java.lang.String[] signature) throws TurbineException
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
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.
TurbineException
- if instantiation fails.public static boolean isLoaderSupported(java.lang.String className) throws TurbineException
className
- the name of the class.
TurbineException
- if test fails.public static java.lang.Class[] getSignature(java.lang.Class clazz, java.lang.Object[] params, java.lang.String[] signature) throws java.lang.ClassNotFoundException
clazz
- the class.params
- an array containing the parameters of the method.signature
- an array containing the signature of the method.
java.lang.ClassNotFoundException
- if any of the classes is not found.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |