MessageDrivenBean (Java EE 5)

Java EE API


javax.ejb Interface MessageDrivenBean

All Superinterfaces:
EnterpriseBean, Serializable

public interface MessageDrivenBean
extends EnterpriseBean

Implements: EnterpriseBean

MessageDrivenBean 由每个消息驱动企业 Bean 类实现。容器使用 MessageDrivenBean 方法将实例的生命周期事件通知给企业 Bean 实例。
英文文档:

The MessageDrivenBean interface is implemented by every message-driven enterprise Bean class. The container uses the MessageDrivenBean methods to notify the enterprise Bean instances of the instance's life cycle events.


Method Summary
 void
 void
 

Method Detail

public void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException
设置相关消息驱动上下文。容器在创建实例之后调用此方法。

企业 Bean 实例应该在实例变量中存储对上下文对象的引用。

在无事务上下文的情况下调用此方法。

ctx 实例的 MessageDrivenContext 接口。
ThrowsEJBException: 该方法抛出此异常指示由于系统级错误导致的失败。

英文文档:

setMessageDrivenContext

void setMessageDrivenContext(MessageDrivenContext ctx)
                             throws EJBException
Set the associated message-driven context. The container calls this method after the instance creation.

The enterprise Bean instance should store the reference to the context object in an instance variable.

This method is called with no transaction context.

Parameters:
ctx - A MessageDrivenContext interface for the instance.
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.

public void ejbRemove() throws EJBException
容器在结束消息驱动对象生命周期之前调用此方法。这在容器决定终止消息驱动对象时发生。

在无事务上下文的情况下调用此方法。

ThrowsEJBException: 该方法抛出此异常指示由于系统级错误导致的失败。

英文文档:

ejbRemove

void ejbRemove()
               throws EJBException
A container invokes this method before it ends the life of the message-driven object. This happens when a container decides to terminate the message-driven object.

This method is called with no transaction context.

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error.


Submit a bug or feature

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

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

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