01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.ejb;
23:
24: import java.rmi.Remote;
25: import java.rmi.RemoteException;
26:
27: /**
28: * <P>The EJBObject interface is extended by all enterprise Bean's remote
29: * interface. An enterprise Bean's remote interface provides the client's
30: * view of an EJB object. An enterprise Bean's remote interface defines
31: * the business methods callable by a client.</P>
32: *
33: * <P>Each enterprise Bean has a remote interface. The remote interface must
34: * extend the javax.ejb.EJBObject interface, and define the enterprise Bean
35: * specific business methods.</P>
36: *
37: * <P>The enterprise Bean's remote interface is defined by the enterprise Bean
38: * provider and implemented by the enterprise Bean container.</P>
39: */
40: public interface EJBObject extends Remote {
41:
42: /**
43: * Obtain the enterprise Bean's remote home interface. The remote home interface defines the
44: * enterprise Bean's create, finder, remove, and home business methods.
45: *
46: * @return A reference to the enterprise Bean's home interface.
47: * @exception java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
48: */
49: public EJBHome getEJBHome() throws RemoteException;
50:
51: /**
52: * <P>Obtain the primary key of the EJB object.</P>
53: *
54: * <P>This method can be called on an entity bean. An attempt to invoke this method on a session
55: * bean will result in RemoteException.</P>
56: *
57: * @return The EJB object's primary key.
58: * @exception java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
59: */
60: public Object getPrimaryKey() throws RemoteException;
61:
62: /**
63: * Remove the EJB object.
64: *
65: * @exception java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
66: * @exception RemoveException - The enterprise Bean or the container does not allow destruction of the object.
67: */
68: public void remove() throws RemoteException, RemoveException;
69:
70: /**
71: * Obtain a handle for the EJB object. The handle can be used at later time to re-obtain a
72: * reference to the EJB object, possibly in a different Java Virtual Machine.
73: *
74: * @return A handle for the EJB object.
75: * @exception java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
76: */
77: public Handle getHandle() throws RemoteException;
78:
79: /**
80: * Tests if a given EJB object is identical to the invoked EJB object.
81: *
82: * @param ejbo - An object to test for identity with the invoked object.
83: * @return True if the given EJB object is identical to the invoked object, false otherwise.
84: * @exception java.rmi.RemoteException - Thrown when the method failed due to a system-level failure.
85: */
86: public boolean isIdentical(EJBObject ejbo) throws RemoteException;
87: }
|