org.chwf.resources
Interface ResourceFactory
- All Known Subinterfaces:
- ManagedResourceFactory
- public interface ResourceFactory
Interface that all resource factories must implement.
- Author:
- Paul Strack
Method Summary |
java.lang.Object |
getResource()
Gets a resource from the factory. |
java.lang.Class |
getType()
The type of resource created by this factory. |
void |
init(ResourceFactoryConfig config)
Initialize the factory. |
getType
public java.lang.Class getType()
- The type of resource created by this factory. The return type of the
getResource()
must be an instance or subclass of this type.
- Returns:
- The type of resource created by this factory.
init
public void init(ResourceFactoryConfig config)
throws ResourceException
- Initialize the factory.
- Parameters:
config
- The resource factory configuration.- Throws:
ResourceException
- If the factory could not be initialized.
getResource
public java.lang.Object getResource()
throws ResourceException
- Gets a resource from the factory. Must be a subclass of the factories type,
as defined by getType().
- Returns:
- A resource from the factory.
- Throws:
ResourceException
- If the resource could not be retrieved.
Copyright © 2002-2004, Paul Strack. All Rights Reserved.