Class OReentrantResourcePool<K,V>
java.lang.Object
com.orientechnologies.common.concur.resource.OResourcePool<K,V>
com.orientechnologies.common.concur.resource.OReentrantResourcePool<K,V>
- All Implemented Interfaces:
OOrientShutdownListener,OOrientStartupListener
public class OReentrantResourcePool<K,V>
extends OResourcePool<K,V>
implements OOrientStartupListener, OOrientShutdownListener
Reentrant implementation of Resource Pool. It manages multiple resource acquisition on thread
local map. If you're looking for a Reentrant implementation look at #OReentrantResourcePool.
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com) (a.lomakin--at--orientdb.com), Luca Garulli (l.garulli--(at)--orientdb.com)
- See Also:
-
Field Summary
Fields inherited from class com.orientechnologies.common.concur.resource.OResourcePool
created, listener, resources, resourcesOut, sem, unmodifiableresources -
Constructor Summary
ConstructorsConstructorDescriptionOReentrantResourcePool(int maxResources, OResourcePoolListener<K, V> listener) -
Method Summary
Modifier and TypeMethodDescriptionintgetResource(K key, long maxWaitMillis, Object... additionalArgs) voidvoidvoidbooleanreturnResource(V res) Methods inherited from class com.orientechnologies.common.concur.resource.OResourcePool
close, getAllResources, getAvailableResources, getCreatedInstances, getInPoolResources, getMaxResources, getResources, getResourcesOutCount
-
Constructor Details
-
OReentrantResourcePool
-
-
Method Details
-
onShutdown
public void onShutdown()- Specified by:
onShutdownin interfaceOOrientShutdownListener
-
onStartup
public void onStartup()- Specified by:
onStartupin interfaceOOrientStartupListener
-
getResource
- Overrides:
getResourcein classOResourcePool<K,V> - Throws:
OLockException
-
returnResource
- Overrides:
returnResourcein classOResourcePool<K,V>
-
getConnectionsInCurrentThread
-
remove
- Overrides:
removein classOResourcePool<K,V>
-