|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Method Summary | |
java.lang.Object |
getInstance()
Gets an instance of a class. |
java.lang.Object |
getInstance(java.lang.ClassLoader loader)
Gets an instance of a class using a specified class loader. |
java.lang.Object |
getInstance(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.Object[] params,
java.lang.String[] signature)
Gets an instance of a named class. |
void |
init(java.lang.String className)
Initializes the factory. |
boolean |
isLoaderSupported()
Tests if this object factory supports specified class loaders. |
Method Detail |
public void init(java.lang.String className) throws TurbineException
className
- the name of the production class
TurbineException
- if initialization fails.public java.lang.Object getInstance() throws TurbineException
TurbineException
- if instantiation fails.public java.lang.Object getInstance(java.lang.ClassLoader loader) throws TurbineException
Class loaders are supported only if the isLoaderSupported method returns true. Otherwise the loader parameter is ignored.
loader
- the class loader.
TurbineException
- if instantiation fails.public java.lang.Object getInstance(java.lang.Object[] params, java.lang.String[] signature) throws TurbineException
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.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.
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()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |