ExceptionListener (Java EE 5)

Java EE API


javax.jms Interface ExceptionListener


public interface ExceptionListener


如果 JMS 提供者检测到 Connection 对象存在严重问题,它会通知 Connection 对象的 ExceptionListener(如果已注册了一个异常侦听器)。这是通过调用侦听器的 onException 方法并将其传递到描述问题的 JMSException 参数来实现的。

异常侦听器允许客户端异步获得问题的通知。某些连接只使用消息,因此它们没有其他方式来了解其连接已失败。

JMS 提供者应该在通知客户端之前尝试自己解决连接问题。

英文文档:

If a JMS provider detects a serious problem with a Connection object, it informs the Connection object's ExceptionListener, if one has been registered. It does this by calling the listener's onException method, passing it a JMSException argument describing the problem.

An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn that their connection has failed.

A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.

Version:
1.0 - 9 March 1998
Author:
Mark Hapner, Rich Burridge
See Also:
Connection.setExceptionListener(ExceptionListener)

Method Summary
 void
 

Method Detail

public void onException(JMSException exception)
向用户通知 JMS 异常。
exception JMS 异常
英文文档:

onException

void onException(JMSException exception)
Notifies user of a JMS exception.

Parameters:
exception - the JMS exception


Submit a bug or feature

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

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

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