EJBObject (Java EE 5)

Java EE API


javax.ejb Interface EJBObject

All Superinterfaces:
Remote
All Known Subinterfaces:
Management

public interface EJBObject
extends Remote

Implements: java.rmi.Remote
Implemented by: Management

EJBObject 接口通过所有企业 Bean 的远程接口扩展。企业 Bean 的远程接口提供 EJB 对象的远程客户端视图。企业 Bean 的远程接口定义了远程客户端可调用的业务方法。

远程接口必须扩展 javax.ejb.EJBObject 接口,并且定义企业 Bean 特有的业务方法。

企业 Bean 的远程接口由企业 Bean 提供者定义,由企业 Bean 容器实现。

英文文档:

The EJBObject interface is extended by all enterprise Beans' remote interfaces. An enterprise Bean's remote interface provides the remote client view of an EJB object. An enterprise Bean's remote interface defines the business methods callable by a remote client.

The remote interface must extend the javax.ejb.EJBObject interface, and define the enterprise Bean specific business methods.

The enterprise Bean's remote interface is defined by the enterprise Bean provider and implemented by the enterprise Bean container.


Method Summary
 EJBHome
 Handle
 Object
 boolean
 void
 

Method Detail

public EJBHome getEJBHome() throws java.rmi.RemoteException
获得企业 Bean 的远程 home 接口。远程 home 接口定义企业 Bean 的 create、finder、remove 和 home 业务方法。
return 对企业 Bean 的 home 接口的引用。
Throwsjava.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档:

getEJBHome

EJBHome getEJBHome()
                   throws RemoteException
Obtain the enterprise Bean's remote home interface. The remote home interface defines the enterprise Bean's create, finder, remove, and home business methods.

Returns:
A reference to the enterprise Bean's home interface.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.

public Object getPrimaryKey() throws java.rmi.RemoteException
获得 EJB 对象的主键。

可以对实体 Bean 调用此方法。试图对会话 Bean 调用此方法将导致 RemoteException。

return EJB 对象的主键。
Throwsjava.rmi.RemoteException: 方法由于系统级失败而失败或对会话 Bean 调用此方法时抛出该异常。

英文文档:

getPrimaryKey

Object getPrimaryKey()
                     throws RemoteException
Obtain the primary key of the EJB object.

This method can be called on an entity bean. An attempt to invoke this method on a session bean will result in RemoteException.

Returns:
The EJB object's primary key.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure or when invoked on a session bean.

public void remove() throws java.rmi.RemoteException, RemoveException
移除 EJB 对象。
Throwsjava.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
ThrowsRemoveException: 如果企业 Bean 或容器不允许销毁该对象。
英文文档:

remove

void remove()
            throws RemoteException,
                   RemoveException
Remove the EJB object.

Throws:
RemoteException - Thrown when the method failed due to a system-level failure.
RemoveException - The enterprise Bean or the container does not allow destruction of the object.

public Handle getHandle() throws java.rmi.RemoteException
获得 EJB 对象的句柄。句柄可以随后用于重新获得对 EJB 对象的引用,可能是在不同的 Java 虚拟机中。
return EJB 对象的句柄。
Throwsjava.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档:

getHandle

Handle getHandle()
                 throws RemoteException
Obtain a handle for the EJB object. The handle can be used at later time to re-obtain a reference to the EJB object, possibly in a different Java Virtual Machine.

Returns:
A handle for the EJB object.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.

public boolean isIdentical(EJBObject obj) throws java.rmi.RemoteException
测试给定 EJB 对象与调用的 EJB 对象是否相同。
obj 要与调用对象进行相等性测试的对象。
return 如果给定 EJB 对象与调用对象相同,则返回 true;否则返回 false。
Throwsjava.rmi.RemoteException: 方法由于系统级失败而失败时抛出该异常。
英文文档:

isIdentical

boolean isIdentical(EJBObject obj)
                    throws RemoteException
Test if a given EJB object is identical to the invoked EJB object.

Parameters:
obj - An object to test for identity with the invoked object.
Returns:
True if the given EJB object is identical to the invoked object, false otherwise.
Throws:
RemoteException - Thrown when the method failed due to a system-level failure.


Submit a bug or feature

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

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

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