public class ConnectionQueue extends Object
Queue here.| Constructor and Description |
|---|
ConnectionQueue(DBAccess aDBAccess,
String aPoolName,
String anUrl,
String anUser,
String aPassword,
int aMinPool,
int aMaxPool,
boolean aReadOnly) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnection(JDCConnection aCon)
Synchronized - Adds a connection that is now available for use to the list of connections
|
void |
addConnectionInUse(JDCConnection aCon) |
void |
addReader(ConnectionPool aReader)
Synchronized - Will add a new Reader (PoolMgr) to the Queue
|
void |
addWriter(JDCConnection aWriter)
Synchronized - Will add a new Worker to the Queue
|
void |
close()
Will remove all messages from the queue and remove the queue
|
JDCConnection |
createConnection() |
JDCConnection |
getConnection()
Synchronized - Will retrieve the next Thread from the queue
note: This call will block until a message is received
|
JDCConnection |
getConnectionNoWait()
Will retrieve the next available Connection from the queue
note: This call will NOT BLOCK if not Connection returns null
|
int |
getMaxPoolSize() |
int |
getMinPoolSize() |
String |
getPoolName() |
int |
getPoolSize() |
String |
getQueueName()
Returns the Queue Reference Name
|
void |
removeConnection(JDCConnection aCon) |
void |
removeReader(ConnectionPool aReader)
Synchronized - Will remove a Reader (PoolMgr) from the Queue
|
void |
removeWriter(JDCConnection aWriter)
Synchronized - Will remove a Worker from the Queue
|
int |
size()
Synchronized - Will return the number of messages left in the Queue
|
void |
wakeUp() |
public ConnectionQueue(DBAccess aDBAccess, String aPoolName, String anUrl, String anUser, String aPassword, int aMinPool, int aMaxPool, boolean aReadOnly) throws SQLException
aDBAccess - dbaPoolName - pool nameanUrl - urlanUser - useraPassword - passaMinPool - minaMaxPool - maxaReadOnly - read onlySQLException - sqlpublic String getQueueName()
public void wakeUp()
public void addConnection(JDCConnection aCon)
aCon - connectionpublic void addConnectionInUse(JDCConnection aCon)
public void removeConnection(JDCConnection aCon)
public JDCConnection getConnection()
public String getPoolName()
public int getMinPoolSize()
public int getMaxPoolSize()
public JDCConnection createConnection() throws SQLException
SQLExceptionpublic JDCConnection getConnectionNoWait()
public int size()
public int getPoolSize()
public void close()
public void addReader(ConnectionPool aReader)
aReader - QueueReader New queue reader (PoolMgr) objectpublic void removeReader(ConnectionPool aReader)
aReader - PoolMgr Is a reader objectpublic void addWriter(JDCConnection aWriter)
aWriter - Worker New queue worker objectpublic void removeWriter(JDCConnection aWriter)
aWriter - Worker Class which performs workCopyright © 2020. All rights reserved.