KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ejb > EJBOperation


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.ejb;
8
9 import java.rmi.RemoteException JavaDoc;
10 import javax.ejb.EJBContext JavaDoc;
11 import javax.ejb.EJBException JavaDoc;
12 import javax.ejb.EJBHome JavaDoc;
13 import javax.ejb.EJBMetaData JavaDoc;
14 import javax.ejb.EnterpriseBean JavaDoc;
15 import javax.ejb.Handle JavaDoc;
16 import javax.ejb.HomeHandle JavaDoc;
17 import javax.ejb.RemoveException JavaDoc;
18
19 /**
20  * 定义和 EJBObject,EJBHome 相对应的方法
21  * <p/>
22  * EJBHome 的方法可以直接继承,但是 EJBObject 里面的方法需要重新定义
23  *
24  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
25  */

26
27 public interface EJBOperation {
28
29     //########### EJBObject 定义的方法
30
Object JavaDoc getPrimaryKey(EnterpriseBean JavaDoc obj) throws RemoteException JavaDoc;
31
32     Handle JavaDoc getHandle(EnterpriseBean JavaDoc obj) throws RemoteException JavaDoc;
33
34     boolean isIdentical(EJBObjectId thisObjectId, EJBObjectId thatObjectId) throws RemoteException JavaDoc;
35
36     void remove(EnterpriseBean JavaDoc bean) throws RemoteException JavaDoc, RemoveException JavaDoc;
37
38     EJBHome JavaDoc getEJBHome() throws RemoteException JavaDoc;
39
40     // ########## EJBHome 定义的方法
41
/**
42      * Remove an EJB object identified by its handle.
43      *
44      * @throws RemoveException Thrown if the enterprise Bean or
45      * the container does not allow the client to remove the object.
46      * @throws RemoteException Thrown when the method failed due to a
47      * system-level failure.
48      */

49     void remove(Handle JavaDoc handle) throws RemoteException JavaDoc, RemoveException JavaDoc;
50
51     /**
52      * Remove an EJB object identified by its primary key.
53      * <p/>
54      * <p>This method can be used only for an entity bean. An attempt
55      * to call this method on a session bean will result in a RemoteException.
56      *
57      * @throws RemoveException Thrown if the enterprise Bean or
58      * the container does not allow the client to remove the object.
59      * @throws RemoteException Thrown when the method failed due to a
60      * system-level failure.
61      */

62     void remove(Object JavaDoc primaryKey) throws RemoteException JavaDoc, RemoveException JavaDoc;
63
64     /**
65      * Obtain the EJBMetaData interface for the enterprise Bean. The
66      * EJBMetaData interface allows the client to obtain information about
67      * the enterprise Bean.
68      * <p/>
69      * <p> The information obtainable via the EJBMetaData interface is
70      * intended to be used by tools.
71      *
72      * @return The enterprise Bean's EJBMetaData interface.
73      * @throws RemoteException Thrown when the method failed due to a
74      * system-level failure.
75      */

76     EJBMetaData JavaDoc getEJBMetaData() throws RemoteException JavaDoc;
77
78     /**
79      * Obtain a handle for the remote home object. The handle can be used at
80      * later time to re-obtain a reference to the remote home object, possibly
81      * in a different Java Virtual Machine.
82      *
83      * @return A handle for the remote home object.
84      * @throws RemoteException Thrown when the method failed due to a
85      * system-level failure.
86      */

87     HomeHandle JavaDoc getHomeHandle() throws RemoteException JavaDoc;
88
89     void ejbCreate(EnterpriseBean JavaDoc bean, String JavaDoc createMethod, Object JavaDoc[] args) throws RemoteException JavaDoc;
90     void ejbActivate(EnterpriseBean JavaDoc bean) throws EJBException JavaDoc, java.rmi.RemoteException JavaDoc;
91
92     void ejbPassivate(EnterpriseBean JavaDoc bean) throws EJBException JavaDoc, java.rmi.RemoteException JavaDoc;
93
94     void ejbRemove(EnterpriseBean JavaDoc bean) throws EJBException JavaDoc, java.rmi.RemoteException JavaDoc;
95
96     void setContext(EnterpriseBean JavaDoc bean, EJBContext JavaDoc ctx) throws EJBException JavaDoc, java.rmi.RemoteException JavaDoc;
97
98 }
99
Popular Tags