EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference

org.eclipse.persistence.sessions.server
Class ConnectionPool

java.lang.Object
  extended by org.eclipse.persistence.sessions.server.ConnectionPool
Direct Known Subclasses:
ExternalConnectionPool, ReadConnectionPool

public class ConnectionPool
extends java.lang.Object

Purpose: Used to specify how connection should be pooled in a server session.

See Also:
ServerSession

Field Summary
protected  boolean checkConnections
           
protected  java.util.Vector connectionsAvailable
           
protected  java.util.Vector connectionsUsed
           
protected  boolean isConnected
           
protected  Login login
           
protected  int maxNumberOfConnections
           
protected  int minNumberOfConnections
           
protected  java.lang.String name
           
protected  ServerSession owner
           
 
Constructor Summary
ConnectionPool()
          PUBLIC: A connection pool is used to specify how connection should be pooled in a server session.
ConnectionPool(java.lang.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.
 
Method Summary
 org.eclipse.persistence.internal.databaseaccess.Accessor acquireConnection()
          INTERNAL: Wait until a connection is available and allocate the connection for the client.
protected  org.eclipse.persistence.internal.databaseaccess.Accessor buildConnection()
          INTERNAL: Create a new connection, accessors are used as connections.
 java.util.Vector getConnectionsAvailable()
          INTERNAL: returns the connections currently available for use in the pool
protected  java.util.Vector getConnectionsUsed()
          Return a list of the connections that are being used.
 Login getLogin()
          PUBLIC: Return the login used to create connections.
 int getMaxNumberOfConnections()
          PUBLIC: Return the maximum number of connections allowed.
 int getMinNumberOfConnections()
          PUBLIC: Return the minimum number of connections.
 java.lang.String getName()
          PUBLIC: Return the name of this pool.
protected  ServerSession getOwner()
          Return the ServerSession that is the owner of this connection pool.
 int getTotalNumberOfConnections()
          INTERNAL: Return the total number of connections currently in use.
 boolean hasConnectionAvailable()
          INTERNAL: Wait until a connection is avaiable and allocate the connection for the client.
 boolean isConnected()
          INTERNAL: Return if this pool has been connected to the database.
 boolean isThereConflictBetweenLoginAndType()
          INTERNAL: Checks for a conflict between pool's type and pool's login
 void releaseConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
          INTERNAL: Add the connection as single that a new connection is available.
 void resetConnections()
          INTERNAL: Reset the connections on shutDown and when the pool is started.
 void setCheckConnections()
          INTERNAL: This method is called to indicate that all available connections should be checked.
protected  void setConnectionsAvailable(java.util.Vector connectionsAvailable)
          INTERNAL: Set this list of connections available
protected  void setConnectionsUsed(java.util.Vector connectionsUsed)
          INTERNAL: Set the list of connections being used.
 void setIsConnected(boolean isConnected)
          INTERNAL: Set if this pool has been connected to the database.
 void setLogin(Login login)
          PUBLIC: Set the login used to create connections.
 void setMaxNumberOfConnections(int maxNumberOfConnections)
          PUBLIC: Set the maximum number of connections allowed.
 void setMinNumberOfConnections(int minNumberOfConnections)
          PUBLIC: Set the minimum number of connections.
 void setName(java.lang.String name)
          PUBLIC: Set the name of this pool.
protected  void setOwner(ServerSession owner)
          Set the ServerSession that owns this connection pool
 void shutDown()
          INTERNAL: Disconnect all connections.
 void startUp()
          INTERNAL: Allocate the minimum connections.
 java.lang.String toString()
          INTERNAL: return a string representation of this connection pool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isConnected

protected boolean isConnected

maxNumberOfConnections

protected int maxNumberOfConnections

minNumberOfConnections

protected int minNumberOfConnections

connectionsAvailable

protected java.util.Vector connectionsAvailable

connectionsUsed

protected java.util.Vector connectionsUsed

login

protected Login login

name

protected java.lang.String name

owner

protected ServerSession owner

checkConnections

protected boolean checkConnections
Constructor Detail

ConnectionPool

public ConnectionPool()
PUBLIC: A connection pool is used to specify how connection should be pooled in a server session.


ConnectionPool

public ConnectionPool(java.lang.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.

Method Detail

acquireConnection

public org.eclipse.persistence.internal.databaseaccess.Accessor acquireConnection()
                                                                           throws ConcurrencyException
INTERNAL: Wait until a connection is available and allocate the connection for the client.

Throws:
ConcurrencyException

buildConnection

protected org.eclipse.persistence.internal.databaseaccess.Accessor buildConnection()
INTERNAL: Create a new connection, accessors are used as connections.


getConnectionsAvailable

public java.util.Vector getConnectionsAvailable()
INTERNAL: returns the connections currently available for use in the pool


getConnectionsUsed

protected java.util.Vector getConnectionsUsed()
Return a list of the connections that are being used.

Returns:
java.util.Vector

getLogin

public Login getLogin()
PUBLIC: Return the login used to create connections.


getMaxNumberOfConnections

public int getMaxNumberOfConnections()
PUBLIC: Return the maximum number of connections allowed. When the max is reached clients must wait for a connection to become available.


getMinNumberOfConnections

public int getMinNumberOfConnections()
PUBLIC: Return the minimum number of connections. These connection will be create on startup.


getName

public java.lang.String getName()
PUBLIC: Return the name of this pool. Pools are identified by name to allow multiple connection pools.


getOwner

protected ServerSession getOwner()
Return the ServerSession that is the owner of this connection pool.

Returns:
org.eclipse.persistence.sessions.server.ServerSession

getTotalNumberOfConnections

public int getTotalNumberOfConnections()
INTERNAL: Return the total number of connections currently in use.


hasConnectionAvailable

public boolean hasConnectionAvailable()
INTERNAL: Wait until a connection is avaiable and allocate the connection for the client.


isConnected

public boolean isConnected()
INTERNAL: Return if this pool has been connected to the database.


isThereConflictBetweenLoginAndType

public boolean isThereConflictBetweenLoginAndType()
INTERNAL: Checks for a conflict between pool's type and pool's login


releaseConnection

public void releaseConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
                       throws DatabaseException
INTERNAL: Add the connection as single that a new connection is available.

Throws:
DatabaseException

resetConnections

public void resetConnections()
INTERNAL: Reset the connections on shutDown and when the pool is started.


setCheckConnections

public void setCheckConnections()
INTERNAL: This method is called to indicate that all available connections should be checked.


setConnectionsAvailable

protected void setConnectionsAvailable(java.util.Vector connectionsAvailable)
INTERNAL: Set this list of connections available

Parameters:
java.util.Vector -

setConnectionsUsed

protected void setConnectionsUsed(java.util.Vector connectionsUsed)
INTERNAL: Set the list of connections being used.

Parameters:
java.util.Vector -

setIsConnected

public void setIsConnected(boolean isConnected)
INTERNAL: Set if this pool has been connected to the database.


setLogin

public void setLogin(Login login)
PUBLIC: Set the login used to create connections.


setMaxNumberOfConnections

public void setMaxNumberOfConnections(int maxNumberOfConnections)
PUBLIC: Set the maximum number of connections allowed. When the max is reached clients must wait for a connection to become available.


setMinNumberOfConnections

public void setMinNumberOfConnections(int minNumberOfConnections)
PUBLIC: Set the minimum number of connections. These connection will be create on startup.


setName

public void setName(java.lang.String name)
PUBLIC: Set the name of this pool. Pools are identified by name to allow multiple connection pools.


setOwner

protected void setOwner(ServerSession owner)
Set the ServerSession that owns this connection pool

Parameters:
org.eclipse.persistence.sessions.server.ServerSession -

shutDown

public void shutDown()
INTERNAL: Disconnect all connections.


startUp

public void startUp()
INTERNAL: Allocate the minimum connections.


toString

public java.lang.String toString()
INTERNAL: return a string representation of this connection pool

Overrides:
toString in class java.lang.Object

EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference