站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 connector API Documentation 英文版文档

ConnectionListener (JBoss Connector API) - JBoss 4.0.1 sp1 connector API Documentation 英文版文档


org.jboss.resource.connectionmanager
Interface ConnectionListener

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

public interface ConnectionListener
extends javax.resource.spi.ConnectionEventListener

A jboss connection listener

Version:
$Revision: 1.3 $
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 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

public static final int NORMAL
Normal state

See Also:
Constant Field Values

DESTROY

public static final int DESTROY
Destroy this connection

See Also:
Constant Field Values

DESTROYED

public static final int DESTROYED
This connection has been destroyed

See Also:
Constant Field Values
Method Detail

getManagedConnection

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

Returns:
the managed connection

getManagedConnectionPool

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

Returns:
the managed connection pool

getContext

public Object getContext()
Retrieve the context used by the pool

Returns:
the context

getState

public int getState()
Retrieve the state of this connection

Returns:
the state

setState

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


isTimedOut

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

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

used

public void used()
Mark the connection as used


registerConnection

public void registerConnection(Object handle)
Register a new connection

Parameters:
handle - the connection handle

unregisterConnection

public void unregisterConnection(Object handle)
Unregister a connection

Parameters:
handle - the connection handle

isManagedConnectionFree

public boolean isManagedConnectionFree()
Is the managed connection free?

Returns:
true when it is free

enlist

public void enlist()
            throws SystemException
Enlist the managed connection

Throws:
SystemException

delist

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

Throws:
javax.resource.ResourceException

isTrackByTx

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

Returns:
true for track by transaction, false otherwise

setTrackByTx

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

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

hasPermit

public boolean hasPermit()
Whether the connection has a permit

Returns:
true when it has permit, false otherwise

grantPermit

public 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.