public abstract class ResourceFactory
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map |
resourceManagerToResourceListMap_ |
| Constructor and Description |
|---|
ResourceFactory()
Create a factory
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
private final java.util.Map resourceManagerToResourceListMap_
public final ManagedResource getResource(ResourceManager resourceManager) throws ResourceException
resourceManager - The object that is managing the resource
allocationResourceException - If an error occurspublic final void releaseResource(ResourceManager resourceManager, ManagedResource resource) throws ResourceException
resource - The resource that we are releasingresourceManager - The object that is managing the resource
allocationResourceException - If an error occurspublic void releaseAllResources(ResourceManager resourceManager) throws ResourceException
resourceManager - The object that is managing the resource
allocationResourceException - If an error occurspublic abstract boolean reinitializeResourceIfPossible(ManagedResource resource)
resource - the resource to reinitializeprotected abstract ManagedResource getResourceImpl(ResourceManager resourceManager) throws java.lang.Exception
resourceManager - The object that is managing the resource
allocationjava.lang.Exception - If an error occursprotected abstract void releaseResourceImpl(ResourceManager resourceManager, ManagedResource resource) throws java.lang.Exception
resource - The resource to releaseresourceManager - The object that is managing the resource
allocationjava.lang.Exception - If an error occursprivate void registerResource(ResourceManager resourceManager, ManagedResource resource)
private void deregisterResource(ResourceManager resourceManager, ManagedResource resource) throws ResourceException
ResourceException