API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.db. JOTDBPool View Source
Author(s)
tcolar
Since
Version
Serial
Hierarchy
 Object
      Thread
          JOTDBPool
Implements
Subclasses
Description
public class JOTDBPool
  This is an implementation of a database connection pooling system It manages connections, adds some when needed, and periodically check there status and renew them is they appear corrupt/hung.
See also:   
Constructors
public JOTDBPool (String name, JOTDBJDBCSetup setup) throws Exception
  Create appol for a particular DB
Methods
Hide/Show inherited methods
publicstatic int activeCount () [Inherited From Thread]
publicfinal void checkAccess () [Inherited From Thread]
@Deprecated
publicnative int countStackFrames () [Inherited From Thread]
publicstaticnative Thread currentThread () [Inherited From Thread]
@Deprecated
public void destroy () [Inherited From Thread]
public void dropAll ()
Release/closes all the connections
publicsynchronized void dropConnection (int i)
  Release/removes a connection
publicstatic void dumpStack () [Inherited From Thread]
publicstatic int enumerate (Thread arg0) [Inherited From Thread]
public void finalize () throws Throwable
will automatically call shutdown when java app is terminated, to avoid hung DB connections.
publicstatic Map<Thread, StackTraceElement> getAllStackTraces () [Inherited From Thread]
public ClassLoader getContextClassLoader () [Inherited From Thread]
publicstatic UncaughtExceptionHandler getDefaultUncaughtExceptionHandler () [Inherited From Thread]
public long getId () [Inherited From Thread]
publicfinal String getName () [Inherited From Thread]
publicfinal int getPriority () [Inherited From Thread]
public StackTraceElement getStackTrace () [Inherited From Thread]
public State getState () [Inherited From Thread]
publicfinal ThreadGroup getThreadGroup () [Inherited From Thread]
public UncaughtExceptionHandler getUncaughtExceptionHandler () [Inherited From Thread]
publicstaticnative boolean holdsLock (Object arg0) [Inherited From Thread]
public void interrupt () [Inherited From Thread]
publicstatic boolean interrupted () [Inherited From Thread]
publicfinalnative boolean isAlive () [Inherited From Thread]
publicfinal boolean isDaemon () [Inherited From Thread]
public boolean isInterrupted () [Inherited From Thread]
publicfinal void join () throws InterruptedException [Inherited From Thread]
publicfinalsynchronized void join (long arg0) throws InterruptedException [Inherited From Thread]
publicfinalsynchronized void join (long arg0, int arg1) throws InterruptedException [Inherited From Thread]
public void releaseConnection (Connection con, int i)
  Description of the Method
public void releaseConnection (JOTTaggedConnection con)
  free a connection when not usefull anymore.
publicsynchronized Connection renewConnection (int index) throws Exception
  Renew a connection when it got corrupted.
@Deprecated
publicfinal void resume () [Inherited From Thread]
publicsynchronized JOTTaggedConnection retrieveConnection () throws Exception
  This get a connection from the pool Returns the "first available".
public void run () [Overrides Thread]
  The run thread method is there as a whatchdog It will try to find out when connections aren't needed anymore And free them if possible.
public void setContextClassLoader (ClassLoader arg0) [Inherited From Thread]
publicfinal void setDaemon (boolean arg0) [Inherited From Thread]
publicstatic void setDefaultUncaughtExceptionHandler (UncaughtExceptionHandler arg0) [Inherited From Thread]
publicfinal void setName (String arg0) [Inherited From Thread]
publicfinal void setPriority (int arg0) [Inherited From Thread]
public void setUncaughtExceptionHandler (UncaughtExceptionHandler arg0) [Inherited From Thread]
public void shutdown ()
Terminates a pool and releases resources
publicstaticnative void sleep (long arg0) throws InterruptedException [Inherited From Thread]
publicstatic void sleep (long arg0, int arg1) throws InterruptedException [Inherited From Thread]
publicsynchronized void start () [Inherited From Thread]
@Deprecated
publicfinal void stop () [Inherited From Thread]
@Deprecated
publicfinalsynchronized void stop (Throwable arg0) [Inherited From Thread]
@Deprecated
publicfinal void suspend () [Inherited From Thread]
public String toString () [Inherited From Thread]
publicsynchronized void updateAccessTime (int id)
  Updates the last time a pooled connection was used, so we can manage it better.
publicstaticnative void yield () [Inherited From Thread]
Fields
Hide/Show inherited fields
pack-private Hashtable cons
pack-private int initSize
pack-private long lastAccess
pack-private int lastIndex
pack-private long lastStatus
publicfinalstatic int MAX_PRIORITY = "10" [Inherited From Thread]
pack-private int maxSize
publicfinalstatic int MIN_PRIORITY = "1" [Inherited From Thread]
pack-private int minSize
pack-private String name
publicfinalstatic int NORM_PRIORITY = "5" [Inherited From Thread]
pack-private JOTDBJDBCSetup setup
pack-privatevolatile boolean shutdown
pack-private boolean status
pack-private int statusGap
Nested Classes
  Thread.State
  Thread.UncaughtExceptionHandler
Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar