javax.ejb.MessageDrivenBean翻译

博客介绍了javax.ejb中的MessageDrivenBean接口,指出每一个消息驱动企业Bean的类都应实现该接口,容器会使用其方法将实例的生命周期事件通知企业Bean,还提及了setMessageDrivenContext和ejbRemove等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!-- ========= START OF TOP NAVBAR ======= --> <!-- -->
JavaTM 2 Platform
Ent. Ed. v1.4
<!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== -->

javax.ejb
Interface MessageDrivenBean

All Superinterfaces:
EnterpriseBean , Serializable
public interface MessageDrivenBean extends EnterpriseBean

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. 每一个消息驱动企业Bean的类都应该实现MessageDrivenBean接口。容器使用MessageDrivenBean的方法 将实例的生命周期事件通知企业Bean。

<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><!-- -->

Method Summary
void ejbRemove()
A container invokes this method before it ends the life of the message-driven object. 容器调用该方法来终止消息驱动bean对象。
void setMessageDrivenContext(MessageDrivenContextctx)
Set the associated message-driven context. 设置关联的消息驱动bean上下文。

<!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><!-- -->

Method Detail
<!-- -->

setMessageDrivenContext

Set the associated message-driven context. The container calls this method after the instance creation. 设置关联的消息驱动bean上下文。容器在实例创建后调用该方法。

The enterprise Bean instance should store the reference to the context object in an instance variable. 企业Bean实例应当在实例变量中保存上下文对象的引用。

This method is called with no transaction context. 方法调用不含事务上下文。

Parameters:
ctx - A MessageDrivenContext interface for the instance. 实例的MessageDrivenContext接口。
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
<!-- -->

ejbRemove

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. 容器调用该方法来终止消息驱动bean对象。当容器决定终止消息驱动bean时发生。

This method is called with no transaction context. 方法调用不含事务上下文。

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
<!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <!-- -->
JavaTM 2 Platform
Ent. Ed. v1.4
<!-- ======== END OF BOTTOM NAVBAR ======= --> Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值