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: /**
25: * <p>The EJBLocalObject interface must be extended by all enterprise
26: * Beans' local interfaces. An enterprise Bean's local interface provides
27: * the local client view of an EJB object. An enterprise Bean's local interface
28: * defines the business methods callable by local clients.</p>
29: *
30: * <p>The enterprise Bean's local interface is defined by the enterprise Bean
31: * provider and implemented by the enterprise Bean container.</p>
32: */
33: public interface EJBLocalObject {
34:
35: /**
36: * Obtain the enterprise Bean's local home interface. The local home interface
37: * defines the enterprise Bean's create, finder, remove, and home business methods
38: * that are available to local clients.
39: *
40: * @return A reference to the enterprise Bean's local home interface.
41: * @exception EJBException - Thrown when the method failed due to a system-level failure.
42: */
43: public EJBLocalHome getEJBLocalHome() throws EJBException;
44:
45: /**
46: * <p>Obtain the primary key of the EJB local object.</p>
47: *
48: * <p>This method can be called on an entity bean. An attempt to invoke this method
49: * on a session Bean will result in an EJBException.</p>
50: *
51: * @return The EJB local object's primary key.
52: * @exception EJBException - Thrown when the method failed due to a system-level failure.
53: */
54: public java.lang.Object getPrimaryKey() throws EJBException;
55:
56: /**
57: * Remove the EJB local object.
58: *
59: * @exception RemoveException - The enterprise Bean or the container does not allow
60: * destruction of the object.
61: * @exception EJBException - Thrown when the method failed due to a system-level failure.
62: */
63: public void remove() throws RemoveException, EJBException;
64:
65: /**
66: * Test if a given EJB local object is identical to the invoked EJB local object.
67: *
68: * @param obj - An object to test for identity with the invoked object.
69: * @return True if the given EJB local object is identical to the invoked object, false otherwise.
70: * @exception EJBException - Thrown when the method failed due to a system-level failure.
71: */
72: public boolean isIdentical(EJBLocalObject obj) throws EJBException;
73: }
|