|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FactoryService
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 String |
ROLE
The key under which this component is known by an avalon container. |
Method Summary | |
---|---|
Object |
getInstance(Class clazz)
Gets an instance of a class. |
Object |
getInstance(String className)
Gets an instance of a named class. |
Object |
getInstance(String className,
ClassLoader loader)
Gets an instance of a named class using a specified class loader. |
Object |
getInstance(String className,
ClassLoader loader,
Object[] params,
String[] signature)
Gets an instance of a named class using a specified class loader. |
Object |
getInstance(String className,
Object[] params,
String[] signature)
Gets an instance of a named class. |
Class[] |
getSignature(Class clazz,
Object[] params,
String[] signature)
Gets the signature classes for parameters of a method of a class. |
boolean |
isLoaderSupported(String className)
Tests if specified class loaders are supported for a named class. |
Field Detail |
---|
static final String ROLE
Method Detail |
---|
Object getInstance(Class clazz) throws FactoryException
clazz
- the name of the class.
ServiceException
- if instantiation fails.
FactoryException
Object getInstance(String className) throws FactoryException
className
- the name of the class.
ServiceException
- if instantiation fails.
FactoryException
Object getInstance(String className, ClassLoader loader) throws FactoryException
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.
ServiceException
- if instantiation fails.
FactoryException
Object getInstance(String className, Object[] params, String[] signature) throws FactoryException
className
- the name of the class.params
- an array containing the parameters of the constructor.signature
- an array containing the signature of the constructor.
ServiceException
- if instantiation fails.
FactoryException
Object getInstance(String className, ClassLoader loader, Object[] params, String[] signature) throws FactoryException
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.
ServiceException
- if instantiation fails.
FactoryException
boolean isLoaderSupported(String className) throws FactoryException
className
- the name of the class.
ServiceException
- if test fails.
FactoryException
Class[] getSignature(Class clazz, Object[] params, String[] signature) throws ClassNotFoundException
clazz
- the class.params
- an array containing the parameters of the method.signature
- an array containing the signature of the method.
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 |