org.jboss.resource.connectionmanager
Interface ConnectionListener

All Superinterfaces:
javax.resource.spi.ConnectionEventListener, EventListener
All Known Implementing Classes:
BaseConnectionManager2.BaseConnectionEventListener, TxConnectionManager.TxConnectionEventListener

public interface ConnectionListener
extends javax.resource.spi.ConnectionEventListener

A jboss connection listener

Version:
$Revision: 1.3.6.4 $
Author:
Adrian Brock

Field Summary
static int DESTROY
          Destroy this connection
static int DESTROYED
          This connection has been destroyed
static int NORMAL
          Normal state
 
Method Summary
 void delist()
          Delist the managed connection
 void enlist()
          Enlist the managed connection
 Object getContext()
          Retrieve the context used by the pool
 javax.resource.spi.ManagedConnection getManagedConnection()
          Retrieve the managed connection for this listener
 ManagedConnectionPool getManagedConnectionPool()
          Retrieve the managed connection pool for this listener
 int getState()
          Retrieve the state of this connection
 void grantPermit(boolean value)
          Tell the connection listener whether it owns the permit.
 boolean hasPermit()
          Whether the connection has a permit
 boolean isManagedConnectionFree()
          Is the managed connection free?
 boolean isTimedOut(long timeout)
          Has the connection timed out?
 boolean isTrackByTx()
          Get whether the listener is track by transaction
 void registerConnection(Object handle)
          Register a new connection
 void setState(int newState)
          Set the state of this connection
 void setTrackByTx(boolean trackByTx)
          Set whether the listener is track by transaction
 void tidyup()
          Tidyup
 void unregisterConnection(Object handle)
          Unregister a connection
 void used()
          Mark the connection as used
 
Methods inherited from interface javax.resource.spi.ConnectionEventListener
connectionClosed, connectionErrorOccurred, localTransactionCommitted, localTransactionRolledback, localTransactionStarted
 

Field Detail

NORMAL

static final int NORMAL
Normal state

See Also:
Constant Field Values

DESTROY

static final int DESTROY
Destroy this connection

See Also:
Constant Field Values

DESTROYED

static final int DESTROYED
This connection has been destroyed

See Also:
Constant Field Values
Method Detail

getManagedConnection

javax.resource.spi.ManagedConnection getManagedConnection()
Retrieve the managed connection for this listener

Returns:
the managed connection

getManagedConnectionPool

ManagedConnectionPool getManagedConnectionPool()
Retrieve the managed connection pool for this listener

Returns:
the managed connection pool

tidyup

void tidyup()
            throws javax.resource.ResourceException
Tidyup

Invoked just before returning the connection to the pool when the connection is not being destroyed

Throws:
javax.resource.ResourceException - for any error

getContext

Object getContext()
Retrieve the context used by the pool

Returns:
the context

getState

int getState()
Retrieve the state of this connection

Returns:
the state

setState

void setState(int newState)
Set the state of this connection


isTimedOut

boolean isTimedOut(long timeout)
Has the connection timed out?

Parameters:
timeout - the timeout
Returns:
true for timed out, false otherwise

used

void used()
Mark the connection as used


registerConnection

void registerConnection(Object handle)
Register a new connection

Parameters:
handle - the connection handle

unregisterConnection

void unregisterConnection(Object handle)
Unregister a connection

Parameters:
handle - the connection handle

isManagedConnectionFree

boolean isManagedConnectionFree()
Is the managed connection free?

Returns:
true when it is free

enlist

void enlist()
            throws SystemException
Enlist the managed connection

Throws:
SystemException

delist

void delist()
            throws javax.resource.ResourceException
Delist the managed connection

Throws:
javax.resource.ResourceException

isTrackByTx

boolean isTrackByTx()
Get whether the listener is track by transaction

Returns:
true for track by transaction, false otherwise

setTrackByTx

void setTrackByTx(boolean trackByTx)
Set whether the listener is track by transaction

Parameters:
trackByTx - true for track by transaction, false otherwise

hasPermit

boolean hasPermit()
Whether the connection has a permit

Returns:
true when it has permit, false otherwise

grantPermit

void grantPermit(boolean value)
Tell the connection listener whether it owns the permit.

Parameters:
value - true for owning the permit, false otherwise


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.