public class PooledResourceFactory extends ResourceFactory
Constructor and Description |
---|
PooledResourceFactory(ResourceFactory sourceFactory)
Create an instance
|
Modifier and Type | Method and Description |
---|---|
int |
getPreferredCacheSize()
Return the preferredCacheSize
|
protected ManagedResource |
getResourceImpl(ResourceManager resourceManager)
Get a resource
|
boolean |
reinitializeResourceIfPossible(ManagedResource resource)
Reinitialize the resource to a known state.
|
protected void |
releaseResourceImpl(ResourceManager resourceManager,
ManagedResource resource)
Release a resource
|
void |
setPreferredCacheSize(int size)
Set the preferredCacheSize
|
getResource, releaseAllResources, releaseResource
public PooledResourceFactory(ResourceFactory sourceFactory)
sourceFactory
- The factory that will be used to actually create
and destroy the pooled resourcespublic void setPreferredCacheSize(int size)
size
- The new size. May not be negativepublic int getPreferredCacheSize()
public boolean reinitializeResourceIfPossible(ManagedResource resource)
reinitializeResourceIfPossible
in class ResourceFactory
resource
- the resource to reinitializeprotected ManagedResource getResourceImpl(ResourceManager resourceManager) throws Exception
getResourceImpl
in class ResourceFactory
resourceManager
- The manager that owns this factoryException
- If an error occursprotected void releaseResourceImpl(ResourceManager resourceManager, ManagedResource resource) throws Exception
releaseResourceImpl
in class ResourceFactory
resource
- The resource to releaseresourceManager
- The manager that owns this factoryException
- If an error occursCopyright © 1998–2014 Gargoyle Software Inc.. All rights reserved.