|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.gargoylesoftware.base.resource.ResourceFactory
A class that can create instances of specific types of resources, such as JDBC connections.
| Constructor Summary | |
ResourceFactory()
Create a factory |
|
| Method Summary | |
ManagedResource |
getResource(ResourceManager resourceManager)
Allocate a resource for the specified store |
protected abstract ManagedResource |
getResourceImpl(ResourceManager resourceManager)
Subclasses will override this to perform the actual allocation of the resource. |
abstract boolean |
reinitializeResourceIfPossible(ManagedResource resource)
Reinitialize the resource to a known state. |
void |
releaseAllResources(ResourceManager resourceManager)
Release all the resources that had been allocated by the specified store. |
void |
releaseResource(ResourceManager resourceManager,
ManagedResource resource)
Release the specified resource. |
protected abstract void |
releaseResourceImpl(ResourceManager resourceManager,
ManagedResource resource)
Subclasses will override this to perform the actual release of the resource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ResourceFactory()
| Method Detail |
public final ManagedResource getResource(ResourceManager resourceManager)
throws ResourceException
resourceManager - The object that is managing the resource
allocation
ResourceException - If an error occurs
public final void releaseResource(ResourceManager resourceManager,
ManagedResource resource)
throws ResourceException
resource - The resource that we are releasingresourceManager - The object that is managing the resource
allocation
ResourceException - If an error occurs
public void releaseAllResources(ResourceManager resourceManager)
throws ResourceException
resourceManager - The object that is managing the resource
allocation
ResourceException - If an error occurspublic abstract boolean reinitializeResourceIfPossible(ManagedResource resource)
resource - the resource to reinitialize
protected abstract ManagedResource getResourceImpl(ResourceManager resourceManager)
throws Exception
resourceManager - The object that is managing the resource
allocation
Exception - If an error occurs
protected abstract void releaseResourceImpl(ResourceManager resourceManager,
ManagedResource resource)
throws Exception
resource - The resource to releaseresourceManager - The object that is managing the resource
allocation
Exception - If an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||