Purpose: Used to specify how connection should be pooled in a server session.
ServerSession
| Modifier and Type | Field and Description |
|---|---|
| protected volatile boolean | |
| protected List | |
| protected List | |
| public static final long | |
| protected volatile long | |
| protected List | |
| public static final int | |
| protected int | |
| protected boolean | |
| protected volatile boolean | |
| protected Login | |
| public static final int | |
| protected int | |
| public static final int | |
| protected int | |
| protected static final String | |
| protected String | |
| protected ServerSession | |
| protected volatile long | |
| public static final int | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public | ConnectionPool()
PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. |
| public | ConnectionPool(String name, Login login, ServerSession owner)
PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. |
| public | ConnectionPool(String name, Login login, int minNumberOfConnections, int maxNumberOfConnections, ServerSession owner)
PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. |
| public | ConnectionPool(String name, Login login, int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections, ServerSession owner)
PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized Accessor | acquireConnection()
INTERNAL: Wait until a connection is available and allocate the connection for the client. |
| public boolean | addFailoverConnectionPool(String poolName)
PUBLIC: Add the connection pool to used if this pool database goes down. |
| protected Accessor | |
| public Accessor | |
| public List | |
| protected List | |
| public List | getFailoverConnectionPools()
PUBLIC: Return the list of connection pools to used if this pool database goes down. |
| public int | |
| public Login | |
| public int | |
| public int | |
| public String | |
| protected ServerSession | Returns: org.eclipse.persistence.sessions.server.ServerSessionReturn the ServerSession that is the owner of this connection pool. |
| public int | |
| public int | |
| public boolean | hasConnectionAvailable()
INTERNAL: Wait until a connection is avaiable and allocate the connection for the client. |
| public boolean | |
| public boolean | |
| public boolean | isThereConflictBetweenLoginAndType()
INTERNAL: Checks for a conflict between pool's type and pool's login |
| public synchronized void | releaseConnection(Accessor connection)
INTERNAL: Add the connection as single that a new connection is available. |
| public void | |
| public void | setCheckConnections()
INTERNAL: This method is called to indicate that all available connections should be checked. |
| protected void | setConnectionsAvailable(Vector<E> connectionsAvailable)
INTERNAL: Set this list of connections available |
| protected void | |
| public void | setFailoverConnectionPools(List<String> failoverConnectionPools)
PUBLIC: Set the list of connection pools to used if this pool database goes down. |
| public void | setInitialNumberOfConnections(int initialNumberOfConnections)
PUBLIC: Set the initial number of connections allowed. |
| public void | |
| public void | setIsDead(boolean isDead)
ADVANCED: Set if the connection pool's database is down, and failover should be used. |
| public void | |
| public void | setMaxNumberOfConnections(int maxNumberOfConnections)
PUBLIC: Set the maximum number of connections allowed. |
| public void | |
| public void | |
| protected void | |
| public void | setWaitTimeout(int waitTimeout)
PUBLIC: Set the time in milliseconds to wait for an available connection. |
| public synchronized void | |
| public synchronized void | |
| public String | toString()
Overrides java. |
| checkConnections | back to summary |
|---|---|
| protected volatile boolean checkConnections | |
| connectionsAvailable | back to summary |
|---|---|
| protected List<Accessor> connectionsAvailable | |
| connectionsUsed | back to summary |
|---|---|
| protected List<Accessor> connectionsUsed | |
| DEAD_CHECK_TIME | back to summary |
|---|---|
| public static final long DEAD_CHECK_TIME | |
| deadCheckTime | back to summary |
|---|---|
| protected volatile long deadCheckTime | |
| failoverConnectionPools | back to summary |
|---|---|
| protected List<String> failoverConnectionPools | |
| INITIAL_CONNECTIONS | back to summary |
|---|---|
| public static final int INITIAL_CONNECTIONS | |
| initialNumberOfConnections | back to summary |
|---|---|
| protected int initialNumberOfConnections | |
| isConnected | back to summary |
|---|---|
| protected boolean isConnected | |
| isDead | back to summary |
|---|---|
| protected volatile boolean isDead | |
| login | back to summary |
|---|---|
| protected Login login | |
| MAX_CONNECTIONS | back to summary |
|---|---|
| public static final int MAX_CONNECTIONS | |
| maxNumberOfConnections | back to summary |
|---|---|
| protected int maxNumberOfConnections | |
| MIN_CONNECTIONS | back to summary |
|---|---|
| public static final int MIN_CONNECTIONS | |
| minNumberOfConnections | back to summary |
|---|---|
| protected int minNumberOfConnections | |
| MONITOR_HEADER | back to summary |
|---|---|
| protected static final String MONITOR_HEADER | |
| name | back to summary |
|---|---|
| protected String name | |
| owner | back to summary |
|---|---|
| protected ServerSession owner | |
| timeOfDeath | back to summary |
|---|---|
| protected volatile long timeOfDeath | |
| WAIT_TIMEOUT | back to summary |
|---|---|
| public static final int WAIT_TIMEOUT | |
| waitTimeout | back to summary |
|---|---|
| protected int waitTimeout | |
| ConnectionPool | back to summary |
|---|---|
| public ConnectionPool() PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. | |
| ConnectionPool | back to summary |
|---|---|
| public ConnectionPool(String name, Login login, ServerSession owner) PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. | |
| ConnectionPool | back to summary |
|---|---|
| public ConnectionPool(String name, Login login, int minNumberOfConnections, int maxNumberOfConnections, ServerSession owner) PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. | |
| ConnectionPool | back to summary |
|---|---|
| public ConnectionPool(String name, Login login, int initialNumberOfConnections, int minNumberOfConnections, int maxNumberOfConnections, ServerSession owner) PUBLIC: A connection pool is used to specify how connection should be pooled in a server session. | |
| acquireConnection | back to summary |
|---|---|
| public synchronized Accessor acquireConnection() throws ConcurrencyException INTERNAL: Wait until a connection is available and allocate the connection for the client. | |
| addFailoverConnectionPool | back to summary |
|---|---|
| public boolean addFailoverConnectionPool(String poolName) PUBLIC: Add the connection pool to used if this pool database goes down. The failover pools should be a clustered, replicated or backuped database. | |
| buildConnection | back to summary |
|---|---|
| protected Accessor buildConnection() INTERNAL: Create a new connection, accessors are used as connections. | |
| failover | back to summary |
|---|---|
| public Accessor failover() INTERNAL: The connection pool is dead fail over to the fail-over pool. | |
| getConnectionsAvailable | back to summary |
|---|---|
| public List INTERNAL: returns the connections currently available for use in the pool | |
| getConnectionsUsed | back to summary |
|---|---|
| protected List Return a list of the connections that are being used. | |
| getFailoverConnectionPools | back to summary |
|---|---|
| public List PUBLIC: Return the list of connection pools to used if this pool database goes down. The failover pools should be a clustered, replicated or backuped database. | |
| getInitialNumberOfConnections | back to summary |
|---|---|
| public int getInitialNumberOfConnections() PUBLIC: Return the initial number of connections allowed. This is the number of connections connected on startup. | |
| getLogin | back to summary |
|---|---|
| public Login getLogin() PUBLIC: Return the login used to create connections. | |
| getMaxNumberOfConnections | back to summary |
|---|---|
| public int getMaxNumberOfConnections() PUBLIC: Return the maximum number of connections allowed. If all connections are in use, a new connection will be created until the maximum size is reach. Only the minimum number of connections will be pooled, if the pool is between the min and max size the connection will be disconnected when returned to the pool. Typically it is desirable to have the min and max connections the same to avoid connects and disconnects. When the max is reached clients must wait for a connection to become available. | |
| getMinNumberOfConnections | back to summary |
|---|---|
| public int getMinNumberOfConnections() PUBLIC: Return the minimum number of connections. If all connections are in use, a new connection will be created until the maximum size is reach. Only the minimum number of connections will be pooled, if the pool is between the min and max size the connection will be disconnected when returned to the pool. Typically it is desirable to have the min and max connections the same to avoid connects and disconnects. | |
| getName | back to summary |
|---|---|
| public String getName() PUBLIC: Return the name of this pool. Pools are identified by name to allow multiple connection pools. | |
| getOwner | back to summary |
|---|---|
| protected ServerSession getOwner() Return the ServerSession that is the owner of this connection pool.
| |
| getTotalNumberOfConnections | back to summary |
|---|---|
| public int getTotalNumberOfConnections() INTERNAL: Return the total number of connections currently in use. | |
| getWaitTimeout | back to summary |
|---|---|
| public int getWaitTimeout() PUBLIC: Return the time in milliseconds to wait for a available connection. If the wait time is exceeded and exception will occur. The default is 180000 or 3 minutes. A value of 0 means wait forever. | |
| hasConnectionAvailable | back to summary |
|---|---|
| public boolean hasConnectionAvailable() INTERNAL: Wait until a connection is avaiable and allocate the connection for the client. | |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() INTERNAL: Return if this pool has been connected to the database. | |
| isDead | back to summary |
|---|---|
| public boolean isDead() ADVANCED: Return if the connection pool's database is down, and failover should be used. | |
| isThereConflictBetweenLoginAndType | back to summary |
|---|---|
| public boolean isThereConflictBetweenLoginAndType() INTERNAL: Checks for a conflict between pool's type and pool's login | |
| releaseConnection | back to summary |
|---|---|
| public synchronized void releaseConnection(Accessor connection) throws DatabaseException INTERNAL: Add the connection as single that a new connection is available. | |
| resetConnections | back to summary |
|---|---|
| public void resetConnections() INTERNAL: Reset the connections on shutDown and when the pool is started. | |
| setCheckConnections | back to summary |
|---|---|
| public void setCheckConnections() INTERNAL: This method is called to indicate that all available connections should be checked. | |
| setConnectionsAvailable | back to summary |
|---|---|
| protected void setConnectionsAvailable(Vector<E> connectionsAvailable) INTERNAL: Set this list of connections available | |
| setConnectionsUsed | back to summary |
|---|---|
| protected void setConnectionsUsed(Vector<E> connectionsUsed) INTERNAL: Set the list of connections being used. | |
| setFailoverConnectionPools | back to summary |
|---|---|
| public void setFailoverConnectionPools(List<String> failoverConnectionPools) PUBLIC: Set the list of connection pools to used if this pool database goes down. The failover pools should be a clustered, replicated or backuped database. | |
| setInitialNumberOfConnections | back to summary |
|---|---|
| public void setInitialNumberOfConnections(int initialNumberOfConnections) PUBLIC: Set the initial number of connections allowed. This is the number of connections connected on startup. The default is 1. | |
| setIsConnected | back to summary |
|---|---|
| public void setIsConnected(boolean isConnected) INTERNAL: Set if this pool has been connected to the database. | |
| setIsDead | back to summary |
|---|---|
| public void setIsDead(boolean isDead) ADVANCED: Set if the connection pool's database is down, and failover should be used. | |
| setLogin | back to summary |
|---|---|
| public void setLogin(Login login) PUBLIC: Set the login used to create connections. | |
| setMaxNumberOfConnections | back to summary |
|---|---|
| public void setMaxNumberOfConnections(int maxNumberOfConnections) PUBLIC: Set the maximum number of connections allowed. If all connections are in use, a new connection will be created until the maximum size is reach. Only the minimum number of connections will be pooled, if the pool is between the min and max size the connection will be disconnected when returned to the pool. Typically it is desirable to have the min and max connections the same to avoid connects and disconnects. When the max is reached clients must wait for a connection to become available. The default is 32. | |
| setMinNumberOfConnections | back to summary |
|---|---|
| public void setMinNumberOfConnections(int minNumberOfConnections) PUBLIC: Set the minimum number of connections. If all connections are in use, a new connection will be created until the maximum size is reach. Only the minimum number of connections will be pooled, if the pool is between the min and max size the connection will be disconnected when returned to the pool. Typically it is desirable to have the min and max connections the same to avoid connects and disconnects. The default is 32. | |
| setName | back to summary |
|---|---|
| public void setName(String name) PUBLIC: Set the name of this pool. Pools are identified by name to allow multiple connection pools. | |
| setOwner | back to summary |
|---|---|
| protected void setOwner(ServerSession owner) Set the ServerSession that owns this connection pool | |
| setWaitTimeout | back to summary |
|---|---|
| public void setWaitTimeout(int waitTimeout) PUBLIC: Set the time in milliseconds to wait for an available connection. If the wait time is exceeded an exception will occur. The default is 180000 or 3 minutes. A value of 0 means wait forever. | |
| shutDown | back to summary |
|---|---|
| public synchronized void shutDown() INTERNAL: Disconnect all connections. | |
| startUp | back to summary |
|---|---|
| public synchronized void startUp() INTERNAL: Allocate the minimum connections. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. INTERNAL: return a string representation of this connection pool
| |