|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.connection.AbstractManagedConnection
public abstract class AbstractManagedConnection
Abstract implementation of a managed connection. There are three primary modes for a connection.
| Field Summary | |
|---|---|
protected boolean |
closeOnRelease
Whether we should close() when release() of the connection is called. |
protected boolean |
commitOnRelease
Whether we should commit() the connection on release(). |
protected java.lang.Object |
conn
The underlying (datastore-specific) connection. |
protected java.util.List<ManagedConnectionResourceListener> |
listeners
Listeners for the connection. |
protected boolean |
locked
Whether the connection is locked for use. |
protected int |
useCount
Count on the number of outstanding uses of this connection. |
| Constructor Summary | |
|---|---|
AbstractManagedConnection()
|
|
| Method Summary | |
|---|---|
void |
addListener(ManagedConnectionResourceListener listener)
Registers a ManagedConnectionResourceListener |
void |
flush()
Flush the connection. |
javax.transaction.xa.XAResource |
getXAResource()
Obtain an XAResource which can be enlisted in a transaction Override this if you intend on supporting this as an XA resource (default = not supported). |
boolean |
isLocked()
whether access to this ManagedConnection has been locked. |
void |
lock()
lock the access to this ManagedConnection |
void |
release()
Release this connection. |
void |
removeListener(ManagedConnectionResourceListener listener)
Deregister a ManagedConnectionResourceListener |
void |
setManagedResource()
Method to set that this connection is "managed". |
void |
setPooled()
Method to set that this connection is "pooled". |
java.lang.String |
toString()
Method to return a string form of this object for convenience debug. |
void |
unlock()
unlock the access to this ManagedConnection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.datanucleus.store.connection.ManagedConnection |
|---|
close, getConnection |
| Field Detail |
|---|
protected java.lang.Object conn
protected boolean closeOnRelease
protected boolean commitOnRelease
protected boolean locked
protected java.util.List<ManagedConnectionResourceListener> listeners
protected int useCount
| Constructor Detail |
|---|
public AbstractManagedConnection()
| Method Detail |
|---|
public void release()
release in interface ManagedConnectionpublic void setManagedResource()
setManagedResource in interface ManagedConnectionpublic void setPooled()
public void addListener(ManagedConnectionResourceListener listener)
ManagedConnection
addListener in interface ManagedConnectionlistener - The listenerpublic void removeListener(ManagedConnectionResourceListener listener)
ManagedConnection
removeListener in interface ManagedConnectionlistener - The listenerpublic void flush()
ManagedConnectionManagedConnectionResourceListener.managedConnectionFlushed()
flush in interface ManagedConnectionpublic boolean isLocked()
ManagedConnection
isLocked in interface ManagedConnectionpublic void lock()
ManagedConnection
lock in interface ManagedConnectionpublic void unlock()
ManagedConnection
unlock in interface ManagedConnectionpublic javax.transaction.xa.XAResource getXAResource()
getXAResource in interface ManagedConnectionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||