Package com.j_spaces.kernel.pool
Class TraceableResource
java.lang.Object
com.j_spaces.kernel.pool.Resource
com.j_spaces.kernel.pool.TraceableResource
- All Implemented Interfaces:
IResource
A resource that can be traced back to it's allocation point. Helps to find leaks in code which
acquire a resource but do not return it back into the pool.
Usage: replace the Resource with a TraceableResource e.g., public myResource extends Resource { ...
} would be replaced with public myResource extends TraceableResource {...}
- Since:
- 6.0.2
- Version:
- 1.0
- Author:
- moran
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.j_spaces.kernel.pool.Resource
clear, isAcquired, isFromPool, setAcquired, setFromPool
-
Constructor Details
-
TraceableResource
public TraceableResource()
-
-
Method Details
-
release
public void release()Description copied from interface:IResourceAtomically sets this resource as free; usually when returning a resource to the pool.Before releasing the resource back into the pool,
is invoked.IResource.clear() -
acquire
public boolean acquire()Description copied from interface:IResourceAtomically acquires a free resource. But, due to race conditions, it may fail.
-