org.edg.security.voms.database.connection
Class CurrentConnection

java.lang.Object
  |
  +--org.edg.security.voms.database.connection.CurrentConnection

public final class CurrentConnection
extends java.lang.Object

A simple class for accessing the database connection associated with the current thread.


Field Summary
private static java.lang.ThreadLocal conn
          Thread-local variable holding the current connection object (a subclass of ClientConnection).
static org.apache.log4j.Logger log
          Logger.
 
Constructor Summary
private CurrentConnection()
          No-op private constructor.
 
Method Summary
static void clear()
           
static ClientConnection get()
           
static Update getUpdate()
           
static void set(ClientConnection c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final transient org.apache.log4j.Logger log
Logger.


conn

private static java.lang.ThreadLocal conn
Thread-local variable holding the current connection object (a subclass of ClientConnection).

Constructor Detail

CurrentConnection

private CurrentConnection()
No-op private constructor.

Method Detail

get

public static ClientConnection get()
                            throws GeneralDatabaseException
Returns:
the database connection associated with the current thread.
Throws:
GeneralDatabaseException - if there is no such database connection.

getUpdate

public static Update getUpdate()
                        throws GeneralDatabaseException
Returns:
the database connection associated with the current thread, for update.
Throws:
GeneralDatabaseException - if there is no such database connection, or if it is not for update.

set

public static void set(ClientConnection c)
                throws java.lang.IllegalStateException
java.lang.IllegalStateException

clear

public static void clear()
                  throws java.lang.IllegalStateException
java.lang.IllegalStateException