javax.ejb.EntityBean翻译

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

javax.ejb
Interface EntityBean

All Superinterfaces:
EnterpriseBean, Serializable

public interface EntityBean
extends EnterpriseBean

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


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

Method Summary
void ejbActivate()
A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object. 容器调用该方法,使实例由可用实例池中移出,与指定EJB对象关联。
void ejbLoad()
A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database. 容器调用该方法,指示实例通过从底层数据库加载来同步其状态。
void ejbPassivate()
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object. 容器调用该方法,使实例与指定EJB对象解除关联。
void ejbRemove()
A container invokes this method before it removes the EJB object that is currently associated with the instance. 容器调用该方法来删除当前与实例关联的EJB对象。
void ejbStore()
A container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database. 容器调用该方法,指示实例通过保存至底层数据库来同步其状态。
void setEntityContext(EntityContextctx)
Set the associated entity context. 设置关联实体bean上下文。
void unsetEntityContext()
Unset the associated entity context. 撤销关联实体bean上下文。

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

Method Detail
<!-- -->

setEntityContext

public void setEntityContext(EntityContextctx)
                      throws EJBException,
                             RemoteException
Set the associated entity context. The container invokes this method on an instance after the instance has been created. 设置关联实体bean上下文。容器在实例创建后调用该方法。

This method is called in an unspecified transaction context. 方法不在指定事务上下文中调用。

Parameters:
ctx - An EntityContext interface for the instance. The instance should store the reference to the context in an instance variable. 实例的EntityContext接口。实例应当在实例变量中保存上下文对象的引用。
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 来代替该异常。

<!-- -->

unsetEntityContext

public void unsetEntityContext()
                        throws EJBException,
                               RemoteException
Unset the associated entity context. The container calls this method before removing the instance. 撤销关联实体bean上下文。容器调用该方法删除实例。

This is the last method that the container invokes on the instance. The Java garbage collector will eventually invoke the finalize() method on the instance. 这是容器针对实例调用的最终方法。Java垃圾收集器最终将调用实例的finalize()方法。

This method is called in an unspecified 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 来代替该异常。

<!-- -->

ejbRemove

public void ejbRemove()
               throws RemoveException,
                      EJBException,
                      RemoteException
A container invokes this method before it removes the EJB object that is currently associated with the instance. This method is invoked when a client invokes a remove operation on the enterprise Bean's home interface or the EJB object's remote interface. This method transitions the instance from the ready state to the pool of available instances. 容器调用该方法来删除当前与实例关联的EJB对象。当客户端基于企业Bean的home接口或者EJB对象的远程接口 调用删除操作时调用该方法,实例将从准备状态转移至可用实例池中。

This method is called in the transaction context of the remove operation. 方法在删除操作的事务上下文中调用。

Throws:
RemoveException - The enterprise Bean does not allow destruction of the object. 企业Bean不允许清除该对象。
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
A container invokes this method when the instance is taken out of the pool of available instances to become associated with a specific EJB object. This method transitions the instance to the ready state. 容器调用该方法,使实例由可用实例池中移出,与指定EJB对象关联,实例变为准备状态。

This method executes in an unspecified 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
A container invokes this method on an instance before the instance becomes disassociated with a specific EJB object. After this method completes, the container will place the instance into the pool of available instances. 容器调用该方法,使实例与指定EJB对象解除关联。方法完成后,容器将实例放置于可用实例池中。

This method executes in an unspecified 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 来代替该异常。

<!-- -->

ejbLoad

public void ejbLoad()
             throws EJBException,
                    RemoteException
A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database. 容器调用该方法,指示实例通过从底层数据库加载来同步其状态。

This method always executes in the transaction context determined by the value of the transaction attribute in the deployment descriptor. 方法总是在事务上下文中执行,事务上下文决定于部署描述符中的事务属性值。

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 来代替该异常。

<!-- -->

ejbStore

public void ejbStore()
              throws EJBException,
                     RemoteException
A container invokes this method to instruct the instance to synchronize its state by storing it to the underlying database. 容器调用该方法,指示实例通过保存至底层数据库来同步其状态。

This method always executes in the transaction context determined by the value of the transaction attribute in the deployment descriptor. 方法总是在事务上下文中执行,事务上下文决定于部署描述符中的事务属性值。

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 来代替该异常。
<!-- ========= 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.

你可能感兴趣的:(bean,ejb,sun)