com.gargoylesoftware.base.resource
public class PooledResourceFactory extends ResourceFactory
Version: $Revision: 1.4 $
| Field Summary | |
|---|---|
| List | cache_ |
| int | preferredCacheSize_ |
| ResourceFactory | sourceFactory_ |
| Constructor Summary | |
|---|---|
| PooledResourceFactory(ResourceFactory sourceFactory)
Create an instance
| |
| Method Summary | |
|---|---|
| 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
|
Parameters: sourceFactory The factory that will be used to actually create and destroy the pooled resources
Returns: The size
Parameters: resourceManager The manager that owns this factory
Returns: A resource
Throws: Exception If an error occurs
Parameters: resource the resource to reinitialize
Returns: true if the resource was successfully reinitialized
Parameters: resource The resource to release resourceManager The manager that owns this factory
Throws: Exception If an error occurs
Parameters: size The new size. May not be negative