Class ODatabasePoolAbstract<DB extends ODatabaseInternal>
java.lang.Object
com.orientechnologies.common.concur.lock.OAbstractLock
com.orientechnologies.common.concur.lock.OAdaptiveLock
com.orientechnologies.orient.core.db.ODatabasePoolAbstract<DB>
- All Implemented Interfaces:
OLock,OResourcePoolListener<String,,DB> OOrientListener,OOrientShutdownListener
public abstract class ODatabasePoolAbstract<DB extends ODatabaseInternal>
extends OAdaptiveLock
implements OResourcePoolListener<String,DB>, OOrientListener
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionODatabasePoolAbstract(Object iOwner, int iMinSize, int iMaxSize) ODatabasePoolAbstract(Object iOwner, int iMinSize, int iMaxSize, int iTimeout, long idleTimeoutMillis, long timeBetweenEvictionRunsMillis) ODatabasePoolAbstract(Object iOwner, int iMinSize, int iMaxSize, long idleTimeout, long timeBetweenEvictionRunsMillis) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes all the databases.intgetAvailableConnections(String url, String userName) intgetConnectionsInCurrentThread(String url, String userName) intgetCreatedInstances(String url, String userName) intgetMaxConnections(String url, String userName) intgetPools()voidvoidonStorageRegistered(OStorage iStorage) voidonStorageUnregistered(OStorage iStorage) Removes from memory the pool associated to the closed storage.voidvoidvoidMethods inherited from class com.orientechnologies.common.concur.lock.OAdaptiveLock
getUnderlying, isConcurrent, isHeldByCurrentThread, lock, tryAcquireLock, tryAcquireLock, unlockMethods inherited from class com.orientechnologies.common.concur.lock.OAbstractLock
callInLockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.orientechnologies.common.concur.resource.OResourcePoolListener
createNewResource, reuseResource
-
Field Details
-
owner
-
-
Constructor Details
-
ODatabasePoolAbstract
-
ODatabasePoolAbstract
public ODatabasePoolAbstract(Object iOwner, int iMinSize, int iMaxSize, long idleTimeout, long timeBetweenEvictionRunsMillis) -
ODatabasePoolAbstract
public ODatabasePoolAbstract(Object iOwner, int iMinSize, int iMaxSize, int iTimeout, long idleTimeoutMillis, long timeBetweenEvictionRunsMillis)
-
-
Method Details
-
acquire
- Throws:
OLockException
-
acquire
public DB acquire(String iURL, String iUserName, String iUserPassword, Map<String, Object> iOptionalParams) throws OLockException- Throws:
OLockException
-
getMaxConnections
-
getCreatedInstances
-
getAvailableConnections
-
getConnectionsInCurrentThread
-
release
-
getPools
-
close
public void close()Closes all the databases.- Specified by:
closein interfaceOLock- Overrides:
closein classOAdaptiveLock
-
remove
-
remove
-
getMaxSize
public int getMaxSize() -
onStorageRegistered
- Specified by:
onStorageRegisteredin interfaceOOrientListener
-
onStorageUnregistered
Removes from memory the pool associated to the closed storage. This avoids pool open against closed storages.- Specified by:
onStorageUnregisteredin interfaceOOrientListener
-
onShutdown
public void onShutdown()- Specified by:
onShutdownin interfaceOOrientListener- Specified by:
onShutdownin interfaceOOrientShutdownListener
-