public abstract class ODatabasePoolBase<DB extends ODatabaseInternal> extends Thread
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected ODatabasePoolAbstract<DB> |
dbPool |
protected String |
url |
protected String |
userName |
protected String |
userPassword |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
protected |
ODatabasePoolBase() |
protected |
ODatabasePoolBase(String iURL,
String iUserName,
String iUserPassword) |
Modifier and Type | Method and Description |
---|---|
DB |
acquire()
Acquires a connection from the pool using the configured URL, user-name and user-password.
|
DB |
acquire(String iName,
String iUserName,
String iUserPassword)
Acquires a connection from the pool.
|
DB |
acquire(String iName,
String iUserName,
String iUserPassword,
Map<String,Object> iOptionalParams)
Acquires a connection from the pool specifying options.
|
void |
close()
Closes the entire pool freeing all the connections.
|
protected abstract DB |
createResource(Object owner,
String iDatabaseName,
Object... iAdditionalArgs) |
int |
getAvailableConnections(String name,
String userName)
Returns amount of available connections which you can acquire for given source and user name.
|
int |
getConnectionsInCurrentThread(String name,
String userName) |
int |
getCreatedInstances(String name,
String userName) |
int |
getMaxSize()
Returns the maximum size of the pool
|
Map<String,OReentrantResourcePool<String,DB>> |
getPools()
Returns all the configured pools.
|
void |
release(DB iDatabase)
Don't call it directly but use database.close().
|
void |
remove(String iName,
String iUser)
Removes a pool by name/user
|
void |
run() |
ODatabasePoolBase<DB> |
setup() |
ODatabasePoolBase<DB> |
setup(int iMinSize,
int iMaxSize) |
ODatabasePoolBase<DB> |
setup(int iMinSize,
int iMaxSize,
long idleTimeout,
long timeBetweenEvictionRunsMillis) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected final String url
protected final String userName
protected final String userPassword
protected ODatabasePoolAbstract<DB extends ODatabaseInternal> dbPool
public ODatabasePoolBase<DB> setup()
public ODatabasePoolBase<DB> setup(int iMinSize, int iMaxSize)
public ODatabasePoolBase<DB> setup(int iMinSize, int iMaxSize, long idleTimeout, long timeBetweenEvictionRunsMillis)
public DB acquire()
public DB acquire(String iName, String iUserName, String iUserPassword)
iName
- Database nameiUserName
- User nameiUserPassword
- User passwordpublic int getAvailableConnections(String name, String userName)
name
- Source name.userName
- User name which is used to acquire source.public DB acquire(String iName, String iUserName, String iUserPassword, Map<String,Object> iOptionalParams)
iName
- Database nameiUserName
- User nameiUserPassword
- User passwordpublic int getConnectionsInCurrentThread(String name, String userName)
public void release(DB iDatabase)
iDatabase
- public void close()
public int getMaxSize()
public Map<String,OReentrantResourcePool<String,DB>> getPools()
Copyright © 2009–2020 OrientDB. All rights reserved.