|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.kmr.scam.local.pool.PoolEntry
A wrapper class that holds a Connection. This class keeps track of the time the connection was created, how often it has been used, and its current allocation state.
ConnectionPool
,
Connection
Field Summary | |
static int |
AVAILABLE
The state in which the entry is available for allocation |
static int |
IN_USE
The state which an entry has when it is currently allocated to a client. |
static DateFormat |
timeFormat
|
Constructor Summary | |
PoolEntry(Connection con)
Creates a new pool entry containing the specified connection |
Method Summary | |
void |
allocate()
Changes the entry state to IN_USE and increments the times used counter. |
void |
close()
Closes the underlying resource. |
Connection |
getConnection()
Returns the connection |
long |
getCreationTime()
Returns the creation time in milliseconds |
int |
getHandle()
Returns the entry's handle, which is a sequentially assigned number that uniquely identifies this entry. |
int |
getState()
Returns the allocation state of the entry. |
int |
getTimesUsed()
Returns the number of times the resource has been used |
boolean |
isValid()
Returns true if the connection is still valid |
void |
setState(int newState)
Sets the entry's state |
String |
toString()
Returns the entry as a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final DateFormat timeFormat
public static final int AVAILABLE
public static final int IN_USE
Constructor Detail |
public PoolEntry(Connection con)
con
- the connectionMethod Detail |
public boolean isValid()
public Connection getConnection()
public long getCreationTime()
public int getTimesUsed()
public void allocate()
public void close()
public int getState()
public void setState(int newState)
public int getHandle()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |