ConnectionEventListener (Java EE 5)

Java EE API


javax.resource.spi Interface ConnectionEventListener

All Superinterfaces:
EventListener

public interface ConnectionEventListener
extends EventListener

Implements: java.util.EventListener

ConnectionEventListener 接口提供一个事件回调机制,使应用服务器能够接收 ManagedConnection 实例的通知。

应用服务器使用这些事件通知管理其连接池,以清除任何无效或已终止的连接以及管理本地事务。

应用服务器实现 ConnectionEventListener 接口。它使用 ManagedConnection.addConnectionEventListener 方法向 ManagedConnection 实例注册连接侦听器。

英文文档:

The ConnectionEventListener interface provides an event callback mechanism to enable an application server to receive notifications from a ManagedConnection instance.

An application server uses these event notifications to manage its connection pool, to clean up any invalid or terminated connections and to manage local transactions.

An application server implements the ConnectionEventListener interface. It registers a connection listener with a ManagedConnection instance by using ManagedConnection.addConnectionEventListener method.

Version:
0.5
Author:
Rahul Sharma
See Also:
ConnectionEvent

Method Summary
 void
 void
 void
 void
 void
 

Method Detail

public void connectionClosed(ConnectionEvent event)
通知应用程序组件已关闭连接。

ManagedConnection 实例在应用程序组件关闭连接句柄时调用 ConnectionEventListener.connectionClosed 方法通知其注册的侦听器集合。应用服务器使用此连接关闭事件,以将 ManagedConnection 实例放回连接池。

event 描述事件源的事件对象

英文文档:

connectionClosed

void connectionClosed(ConnectionEvent event)
Notifies that an application component has closed the connection.

A ManagedConnection instance notifies its registered set of listeners by calling ConnectionEventListener.connectionClosed method when an application component closes a connection handle. The application server uses this connection close event to put the ManagedConnection instance back in to the connection pool.

Parameters:
event - event object describing the source of the event

public void localTransactionStarted(ConnectionEvent event)
通知 ManagedConnection 实例上已启动资源管理器本地事务。
event 描述事件源的事件对象
英文文档:

localTransactionStarted

void localTransactionStarted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void localTransactionCommitted(ConnectionEvent event)
通知 ManagedConnection 实例上已提交资源管理器本地事务。
event 描述事件源的事件对象
英文文档:

localTransactionCommitted

void localTransactionCommitted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void localTransactionRolledback(ConnectionEvent event)
通知 ManagedConnection 实例上已回滚资源管理器本地事务。
event 描述事件源的事件对象
英文文档:

localTransactionRolledback

void localTransactionRolledback(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance.

Parameters:
event - event object describing the source of the event

public void connectionErrorOccurred(ConnectionEvent event)
通知与连接有关的错误。 ManagedConnection 实例调用 ConnectionEventListener.connectionErrorOccurred 方法通知其注册的侦听器发生了与物理连接有关的错误。事件通知发生在资源适配器对使用连接句柄向应用程序组件抛出异常之前。 connectionErrorOccurred 方法指示关联的 ManagedConnection 实例当前无效并且不能使用。应用服务器处理连接错误事件通知的方式如下:先启动特定于应用服务器的清除(例如,从连接池中移除 ManagedConnection 实例),然后调用 ManagedConnection.destroy 方法销毁物理连接。
event 描述事件源的事件对象
英文文档:

connectionErrorOccurred

void connectionErrorOccurred(ConnectionEvent event)
Notifies a connection related error. The ManagedConnection instance calls the method ConnectionEventListener.connectionErrorOccurred to notify its registered listeners of the occurrence of a physical connection-related error. The event notification happens just before a resource adapter throws an exception to the application component using the connection handle. The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable. The application server handles the connection error event notification by initiating application server-specific cleanup (for example, removing ManagedConnection instance from the connection pool) and then calling ManagedConnection.destroy method to destroy the physical connection.

Parameters:
event - event object describing the source of the event


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!