|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.base.resource.ResourceFactory
public abstract class ResourceFactory
A class that can create instances of specific types of resources, such as JDBC connections.
| Field Summary | |
|---|---|
private java.util.Map |
resourceManagerToResourceListMap_
|
| Constructor Summary | |
|---|---|
ResourceFactory()
Create a factory |
|
| Method Summary | |
|---|---|
private void |
deregisterResource(ResourceManager resourceManager,
ManagedResource resource)
|
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. |
private void |
registerResource(ResourceManager resourceManager,
ManagedResource 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 |
| Field Detail |
|---|
private final java.util.Map resourceManagerToResourceListMap_
| 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 java.lang.Exception
resourceManager - The object that is managing the resource
allocation
java.lang.Exception - If an error occurs
protected abstract void releaseResourceImpl(ResourceManager resourceManager,
ManagedResource resource)
throws java.lang.Exception
resource - The resource to releaseresourceManager - The object that is managing the resource
allocation
java.lang.Exception - If an error occurs
private void registerResource(ResourceManager resourceManager,
ManagedResource resource)
private void deregisterResource(ResourceManager resourceManager,
ManagedResource resource)
throws ResourceException
ResourceException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||