|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Field Summary | |
static java.lang.String |
SERVICE_NAME
The key under which this service is stored in TurbineServices. |
Method Summary | |
java.lang.Object |
getInstance(java.lang.String className)
Gets an instance of a named class. |
java.lang.Object |
getInstance(java.lang.String className,
java.lang.ClassLoader loader)
Gets an instance of a named class using a specified class loader. |
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. |
java.lang.Object |
getInstance(java.lang.String className,
java.lang.Object[] params,
java.lang.String[] signature)
Gets an instance of a named class. |
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. |
boolean |
isLoaderSupported(java.lang.String className)
Tests if specified class loaders are supported for a named class. |
Methods inherited from interface org.apache.turbine.services.Service |
getConfiguration, getName, getProperties, setName, setServiceBroker |
Methods inherited from interface org.apache.turbine.services.Initable |
getInit, init, init, setInitableBroker, shutdown |
Field Detail |
public static final java.lang.String SERVICE_NAME
Method Detail |
public java.lang.Object getInstance(java.lang.String className) throws TurbineException
className
- the name of the class.
TurbineException
- if instantiation fails.public 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 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 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 boolean isLoaderSupported(java.lang.String className) throws TurbineException
className
- the name of the class.
TurbineException
- if test fails.public 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 |