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, releaseResourcepublic 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 ResourceFactoryresource - the resource to reinitializeprotected ManagedResource getResourceImpl(ResourceManager resourceManager) throws Exception
getResourceImpl in class ResourceFactoryresourceManager - The manager that owns this factoryException - If an error occursprotected void releaseResourceImpl(ResourceManager resourceManager, ManagedResource resource) throws Exception
releaseResourceImpl in class ResourceFactoryresource - The resource to releaseresourceManager - The manager that owns this factoryException - If an error occursCopyright © 1998–2025 Gargoyle Software Inc.. All rights reserved.