KickJava   Java API By Example, From Geeks To Geeks.

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


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.lang.reflect.Method JavaDoc;
10 import javax.ejb.TimerService JavaDoc;
11
12 import org.jfox.ejb.connector.EJBInvocation;
13 import org.jfox.ejb.handler.HandlerChain;
14 import org.jfox.ejb.meta.EJBDescriptor;
15 import org.jfox.ioc.Component;
16 import org.jfox.ioc.ext.InitializableComponent;
17 import org.jfox.jndi.enc.EnterpriseContext;
18
19 /**
20  * a bucket 容纳一个特定的 bean,保存了这个 bean 的一切资源,bucket 放在 container 中
21  * <p/>
22  * 继承 EJBOperation 是为了强迫实现它的方法,以便在方法调用时可以直接调用
23  *
24  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
25  */

26
27 public interface Bucket extends EJBOperation, Component, InitializableComponent {
28
29     /**
30      * invoke a method
31      * @return
32      */

33 // Object invoke(Invocation invocation) throws Exception;
34

35     /**
36      * 得到该 ejb 的 classLoader
37      */

38     ClassLoader JavaDoc getEJBClassLoader();
39
40     Method JavaDoc getHomeMethod(EJBInvocation invocation) throws NoSuchMethodException JavaDoc;
41
42     Method JavaDoc getBeanMethod(EJBInvocation invocation) throws NoSuchMethodException JavaDoc;
43
44     /**
45      * 来自 EJBHome 的方法
46      *
47      * @param invocation
48      * @return Bean 的 ObjectId
49      * @throws Exception
50      */

51     Object JavaDoc invokeHome(EJBInvocation invocation) throws Exception JavaDoc;
52
53     /**
54      * 执行 Bean 的方法
55      *
56      * @param invocation
57      * @return
58      * @throws Exception
59      */

60     Object JavaDoc invokeBean(EJBInvocation invocation) throws Exception JavaDoc;
61
62     EJBDescriptor getEJBDescriptor();
63
64     EnterpriseContext getEnterpriseContext();
65
66     TimerService JavaDoc getTimerService();
67
68     EJBObjectId nextObjectId();
69
70     EJBObjectId getHomeObjectId();
71
72     Class JavaDoc getBeanClass();
73
74     void setBucketMeta(BucketMeta meta);
75
76     void setHandlerChain(HandlerChain handlerChain);
77
78     EJBPoolableObject retrieveBean(Object JavaDoc key) throws Exception JavaDoc;
79
80     void restoreBean(Object JavaDoc key, EJBPoolableObject pobj);
81
82     /**
83      * 调用 home.create 时,服务端使用该方法生成Bean实例
84      * @param invocation
85      * @return
86      * @throws Exception
87      */

88     EJBObjectId createBean(EJBInvocation invocation) throws Exception JavaDoc;
89
90     /**
91      * 集群同步调用
92      */

93     void syncBean(EJBInvocation invocation);
94
95
96 }
Popular Tags