01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: EJBObject.java 1100 2006-08-16 13:05:31Z benoitf $
23: * --------------------------------------------------------------------------
24: */package javax.ejb;
25:
26: import java.rmi.Remote;
27: import java.rmi.RemoteException;
28:
29: /**
30: * Used by EJB 2.1 for their business remote interface.
31: * @see <a href="http://www.jcp.org/en/jsr/detail?id=220">EJB 3.0 specification</a>
32: * @author Florent Benoit
33: */
34: public interface EJBObject extends Remote {
35:
36: /**
37: * Obtain the enterprise Bean's remote home interface. The remote home
38: * interface defines the enterprise Bean's create, finder, remove, and home
39: * business methods.
40: * @return A reference to the enterprise Bean's home interface.
41: * @throws RemoteException Thrown when the method failed due to a
42: * system-level failure.
43: */
44: EJBHome getEJBHome() throws RemoteException;
45:
46: /**
47: * Obtain the primary key of the EJB object.<br>
48: * This method can be called on an entity bean. An attempt to invoke this
49: * method on a session bean will result in RemoteException.
50: * @return The EJB object's primary key.
51: * @throws RemoteException Thrown when the method failed due to a
52: * system-level failure or when invoked on a session bean.
53: */
54: Object getPrimaryKey() throws RemoteException;
55:
56: /**
57: * Remove the EJB object.
58: * @throws RemoteException Thrown when the method failed due to a
59: * system-level failure.
60: * @throws RemoveException The enterprise Bean or the container does not
61: * allow destruction of the object.
62: */
63: void remove() throws RemoteException, RemoveException;
64:
65: /**
66: * Obtain a handle for the EJB object. The handle can be used at later time
67: * to re-obtain a reference to the EJB object, possibly in a different Java
68: * Virtual Machine.
69: * @return A handle for the EJB object.
70: * @throws RemoteException Thrown when the method failed due to a
71: * system-level failure.
72: */
73: Handle getHandle() throws RemoteException;
74:
75: /**
76: * Test if a given EJB object is identical to the invoked EJB object.
77: * @param obj An object to test for identity with the invoked object.
78: * @return True if the given EJB object is identical to the invoked object,
79: * false otherwise.
80: * @throws RemoteException Thrown when the method failed due to a
81: * system-level failure.
82: */
83: boolean isIdentical(EJBObject obj) throws RemoteException;
84:
85: }
|