Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > Java > javax.ejb.SessionBean翻译
【标  题】:javax.ejb.SessionBean翻译
【关键字】:javax.ejb.SessionBean
【来  源】:http://blog.csdn.net/wocongdongfanglai/archive/2005/11/18/532179.aspx

javax.ejb.SessionBean翻译

Your Ad Here  
JavaTM 2 Platform
Ent. Ed. v1.4

javax.ejb
Interface SessionBean

All Superinterfaces:
EnterpriseBean, Serializable

public interface SessionBean
extends EnterpriseBean

The SessionBean interface is implemented by every session enterprise Bean class. The container uses the SessionBean methods to notify the enterprise Bean instances of the instance's life cycle events. 每一个会话企业Bean的类都应该实现SessionBean接口。容器使用SessionBean的方法 将实例的生命周期事件通知企业Bean。


Method Summary
 voidejbActivate()
          The activate method is called when the instance is activated from its "passive" state. 该激活方法由实例从钝化状态被激活时调用。
 voidejbPassivate()
          The passivate method is called before the instance enters the "passive" state. 该钝化方法由实例进入钝化状态时调用。
 voidejbRemove()
          A container invokes this method before it ends the life of the session object. 容器调用该方法来终止会话对象。
 voidsetSessionContext(SessionContext ctx)
          Set the associated session context. 设置关联的会话上下文。
 

Method Detail

setSessionContext

public void setSessionContext(SessionContext ctx)
                       throws EJBException,
                              RemoteException
Set the associated session 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. 企业Bean实例应当在实例变量中保存上下文对象的引用。

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

Parameters:
ctx - A SessionContext interface for the instance. 实例的SessionContext接口。
Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
RemoteException - This exception is defined in the method signature to provide backward compatibility for applications written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。

ejbRemove

public void ejbRemove()
               throws EJBException,
                      RemoteException
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout. 容器调用该方法来终止会话对象。当客户端调用删除方法或者容器在会话对象 超时后决定对其终止时发生。

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

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。

ejbActivate

public void ejbActivate()
                 throws EJBException,
                        RemoteException
The activate method is called when the instance is activated from its "passive" state. The instance should acquire any resource that it has released earlier in the ejbPassivate() method. 该激活方法由实例从钝化状态被激活时调用。实例将获得原本在ejbPassivate()方法中释放的所有资源。

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

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。

ejbPassivate

public void ejbPassivate()
                  throws EJBException,
                         RemoteException
The passivate method is called before the instance enters the "passive" state. The instance should release any resources that it can re-acquire later in the ejbActivate() method. 该钝化方法由实例进入钝化状态时调用。实例将释放所有资源,在下次调用ejbActivate()方法后可以重新获得。

After the passivate method completes, the instance must be in a state that allows the container to use the Java Serialization protocol to externalize and store away the instance's state. 在钝化方法完成后,实例必须处于这样一种状态,可以让容器使用Java序列化策略来具体化和保存实例状态。

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

Throws:
EJBException - Thrown by the method to indicate a failure caused by a system-level error. 方法抛出该异常表示一个由系统级错误引起的失败。
RemoteException - This exception is defined in the method signature to provide backward compatibility for enterprise beans written for the EJB 1.0 specification. Enterprise beans written for the EJB 1.1 specification should throw the javax.ejb.EJBException instead of this exception. Enterprise beans written for the EJB2.0 and higher specifications must throw the javax.ejb.EJBException instead of this exception. 方法签名中定义该异常是为了对符合EJB 1.0规范的企业bean提供向下兼容。 符合EJB 1.1规范的企业bean应该抛出javax.ejb.EJBException来代替该异常。 符合EJB 2.0或更高版本规范的企业bean也应该抛出javax.ejb.EJBException 来代替该异常。

JavaTM 2 Platform
Ent. Ed. v1.4

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.

QUICK REVISION TIPS OF SCJP 1.4:【上一篇】
J2ME中使用pauseApp控制手机临时退出JAVA程序:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • 在安装SCO OpenServer时如何设置硬盘驱动器
  • Java模拟.NET的连接池
  • 《Beginning C# Objects》中文版勘误
  • linux文件安全---粘连位(Sticky bit)
  • 关于版权声明的写法
  • 网通用户有福气了~发现了一个几千部电影的网站
  • Asp.net实现IIS控制管理(Web虚拟目录的创建及管理)
  • [ASP.NET 2.0 Security FAQs]如何在membership中强制使用高安全性的密码
  • ERP学习(五)——MRP基本运算逻辑
  • 常见软件保护技术之CD-check
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.