|
xmlBlaster 1.6.2 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmlBlaster.util.queue.jdbc.JdbcConnectionPool
A Pool of connections to the database to be used for a persistent queue. To keep genericity, queries and update strings are read from properties.
| Field Summary | |
private int |
capacity
the initial capacity of this pool. |
private boolean |
cascadeDeleteSupported
|
private java.lang.String |
colNamePrefix
|
private java.lang.String |
configurationIdentifier
|
private long |
connectionBusyTimeout
|
private EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue |
connections
|
private boolean |
dbAdmin
|
private boolean |
debug
|
private boolean |
enableBatchMode
|
private static boolean |
firstConnectError
|
private int |
forceIsoaltionLevel
|
private Global |
glob
|
private boolean |
initialized
|
private boolean |
isShutdown
|
private static java.util.logging.Logger |
log
|
private int |
managerCount
|
private java.util.Hashtable |
mapping
|
private int |
maxWaitingThreads
|
private static java.lang.String |
ME
|
private int |
MIN_POOL_SIZE
|
private boolean |
nestedBracketsSupported
|
private java.lang.String |
password
|
private java.util.Properties |
pluginProp
|
private int |
queryTimeout
Sets the number of seconds the driver will wait for a Statement object to execute to the given number of seconds. |
private long |
reconnectionTimeout
|
private int |
status
will be set when a connecton is broken |
private I_StorageProblemListener |
storageProblemListener
|
private int |
tableAllocationIncrement
|
private java.lang.String |
tableNamePrefix
|
private java.lang.String |
url
|
private java.lang.String |
user
|
private int |
waitingCalls
|
private boolean |
waitingForReentrantConnections
|
| Constructor Summary | |
JdbcConnectionPool()
The default constructor currently does nothing. |
|
| Method Summary | |
private void |
addConnectionToPool(boolean doLog)
|
private void |
connect(boolean disconnectFirst,
boolean doLog)
Connects to the DB (so many connections as configured) |
void |
discardConnection(java.sql.Connection conn)
Discards the passed connection from the pool and instead adds a new fresh connection to the pool. |
void |
disconnect()
Closes all connections to the Database. |
private void |
disconnect(long waitTime,
boolean silent)
|
void |
dumpMetaData()
|
void |
finalize()
|
private java.sql.Connection |
get(long delay)
returns null if no connection available |
java.lang.String |
getColNamePrefix()
|
java.sql.Connection |
getConnection()
Returns a free connection. |
Global |
getGlobal()
Returns the global object associated with this pool. |
static java.lang.String |
getIsolationLevel(java.sql.Connection conn)
|
java.util.Hashtable |
getMapping()
The mapping is taken out of the xmlBlaster.properties file. |
java.util.Properties |
getPluginProperties()
returns the plugin properties, i.e. |
int |
getProp(java.lang.String key,
int def)
|
java.lang.String |
getProp(java.lang.String key,
java.lang.String def)
|
int |
getQueryTimeout()
|
int |
getStatus()
returns true if the connection is temporarly lost (and the pool is polling for new connections) |
int |
getTableAllocationIncrement()
|
java.lang.String |
getTableNamePrefix()
|
java.lang.String |
getUrl()
|
java.lang.String |
getUserName()
|
void |
initialize(Global glob,
java.util.Properties pluginProperties)
Is called after the instance is created. |
boolean |
isBatchModeEnabled()
The batch mode means that insertions in the database are made in batch mode, i.e. |
boolean |
isCascadeDeleteSuppported()
|
boolean |
isDbAdmin()
|
boolean |
isInitialized()
returns true if the pool already is initialized, false otherwise. |
private boolean |
isInPool(java.sql.Connection conn)
|
boolean |
isNestedBracketsSuppported()
|
static java.lang.String |
isolationToString(int isolation)
|
static void |
main(java.lang.String[] args)
|
private java.util.Hashtable |
parseMapping(Property prop)
This method is used in the init method |
private boolean |
put(java.sql.Connection conn)
|
void |
registerManager(JdbcManagerCommonTable manager)
|
boolean |
registerStorageProblemListener(I_StorageProblemListener storageProblemListener)
Sets the connection listener. |
private void |
releaseConnection(java.sql.Connection conn)
Used to give back a connection to the pool. |
void |
releaseConnection(java.sql.Connection conn,
boolean success)
Used to give back a connection to the pool. |
void |
setConnectionLost()
informs this pool that the connection to the DB has been lost |
private void |
setInPool(java.sql.Connection conn,
boolean inPool)
|
void |
shutdown()
|
void |
timeout(java.lang.Object userData)
Invoked by the timer when a check for reconnection is wanted again |
void |
unregisterManager(JdbcManagerCommonTable manager)
|
boolean |
unRegisterStorageProblemListener(I_StorageProblemListener storageProblemListener)
Unregisters the storageProblemListener. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static java.lang.String ME
private static java.util.logging.Logger log
private Global glob
private EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue connections
private int capacity
private int waitingCalls
private long connectionBusyTimeout
private int maxWaitingThreads
private java.util.Hashtable mapping
private boolean initialized
private java.lang.String tableNamePrefix
private java.lang.String colNamePrefix
private int tableAllocationIncrement
private int status
private boolean waitingForReentrantConnections
private java.lang.String url
private java.lang.String user
private java.lang.String password
private long reconnectionTimeout
private I_StorageProblemListener storageProblemListener
private static boolean firstConnectError
private java.util.Properties pluginProp
private boolean dbAdmin
private int queryTimeout
Statement object to execute to the given number of seconds.
If the limit is exceeded, an SQLException is thrown.
private int managerCount
private boolean isShutdown
private boolean enableBatchMode
private java.lang.String configurationIdentifier
private boolean cascadeDeleteSupported
private boolean nestedBracketsSupported
private int forceIsoaltionLevel
private boolean debug
private final int MIN_POOL_SIZE
| Constructor Detail |
public JdbcConnectionPool()
| Method Detail |
public java.util.Properties getPluginProperties()
public void timeout(java.lang.Object userData)
timeout in interface I_TimeoutuserData - You get bounced back your userData which you passed
with Timeout.addTimeoutListener()I_Timeout.timeout(Object)public boolean registerStorageProblemListener(I_StorageProblemListener storageProblemListener)
registerStorageProblemListener in interface I_StorageProblemNotifierpublic boolean unRegisterStorageProblemListener(I_StorageProblemListener storageProblemListener)
unRegisterStorageProblemListener in interface I_StorageProblemNotifier
private java.sql.Connection get(long delay)
throws XmlBlasterException
XmlBlasterException
private boolean put(java.sql.Connection conn)
throws XmlBlasterException
XmlBlasterExceptionpublic Global getGlobal()
public boolean isInitialized()
public void discardConnection(java.sql.Connection conn)
throws XmlBlasterException
conn -
XmlBlasterExceptionpublic static java.lang.String isolationToString(int isolation)
public static java.lang.String getIsolationLevel(java.sql.Connection conn)
private final void setInPool(java.sql.Connection conn,
boolean inPool)
private final boolean isInPool(java.sql.Connection conn)
private void addConnectionToPool(boolean doLog)
throws java.sql.SQLException
java.sql.SQLException
private void connect(boolean disconnectFirst,
boolean doLog)
throws java.sql.SQLException
disconnectFirst - if 'true' then all connections to the db are closed before reconnecting.
java.sql.SQLException
public java.lang.String getProp(java.lang.String key,
java.lang.String def)
public int getProp(java.lang.String key,
int def)
public void initialize(Global glob,
java.util.Properties pluginProperties)
throws java.lang.ClassNotFoundException,
java.sql.SQLException,
XmlBlasterException
java.lang.ClassNotFoundException
java.sql.SQLException
XmlBlasterExceptionpublic java.lang.String getTableNamePrefix()
public java.lang.String getUserName()
public java.lang.String getColNamePrefix()
public int getTableAllocationIncrement()
private java.util.Hashtable parseMapping(Property prop)
throws XmlBlasterException,
java.sql.SQLException
XmlBlasterException
java.sql.SQLExceptionpublic java.util.Hashtable getMapping()
private final void disconnect(long waitTime,
boolean silent)
public void disconnect()
public void finalize()
public final int getStatus()
public final void setConnectionLost()
public java.sql.Connection getConnection()
throws XmlBlasterException
XmlBlasterException
public void releaseConnection(java.sql.Connection conn,
boolean success)
throws XmlBlasterException
XmlBlasterException
private void releaseConnection(java.sql.Connection conn)
throws XmlBlasterException
XmlBlasterExceptionpublic void dumpMetaData()
public boolean isDbAdmin()
public int getQueryTimeout()
public static void main(java.lang.String[] args)
public void shutdown()
public void registerManager(JdbcManagerCommonTable manager)
public void unregisterManager(JdbcManagerCommonTable manager)
public boolean isBatchModeEnabled()
public boolean isCascadeDeleteSuppported()
public boolean isNestedBracketsSuppported()
public java.lang.String getUrl()
|
xmlBlaster 1.6.2 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||