K
- Resource's KeyV
- Resource Objectpublic class OResourcePool<K,V> extends Object
Modifier and Type | Field and Description |
---|---|
protected AtomicInteger |
created |
protected OResourcePoolListener<K,V> |
listener |
protected Queue<V> |
resources |
protected Queue<V> |
resourcesOut |
protected Semaphore |
sem |
protected Collection<V> |
unmodifiableresources |
Constructor and Description |
---|
OResourcePool(int min,
int max,
OResourcePoolListener<K,V> listener) |
OResourcePool(int max,
OResourcePoolListener<K,V> listener) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
Collection<V> |
getAllResources() |
int |
getAvailableResources() |
int |
getCreatedInstances() |
int |
getInPoolResources() |
int |
getMaxResources() |
V |
getResource(K key,
long maxWaitMillis,
Object... additionalArgs) |
Collection<V> |
getResources() |
int |
getResourcesOutCount() |
void |
remove(V res) |
boolean |
returnResource(V res) |
protected final Semaphore sem
protected final Collection<V> unmodifiableresources
protected OResourcePoolListener<K,V> listener
protected final AtomicInteger created
public OResourcePool(int max, OResourcePoolListener<K,V> listener)
public OResourcePool(int min, int max, OResourcePoolListener<K,V> listener)
public V getResource(K key, long maxWaitMillis, Object... additionalArgs) throws OAcquireTimeoutException
OAcquireTimeoutException
public int getMaxResources()
public int getAvailableResources()
public int getInPoolResources()
public boolean returnResource(V res)
public Collection<V> getResources()
public void close()
public Collection<V> getAllResources()
public void remove(V res)
public int getCreatedInstances()
public int getResourcesOutCount()
Copyright © 2009–2020 OrientDB. All rights reserved.