KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ejb > handler > Z5_SessionHandler


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.handler;
8
9 import java.util.Iterator JavaDoc;
10
11 import org.jfox.ejb.Bucket;
12 import org.jfox.ejb.SessionBucket;
13 import org.jfox.ejb.connector.EJBInvocation;
14
15 /**
16  * 一般是最后一个 invoker
17  * invokeHome: 生成 EJBObject 的 invoker
18  * invokeBean: 执行实际的方法
19  *
20  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
21  */

22
23 public class Z5_SessionHandler extends AbstractHandler {
24
25     public Object JavaDoc invokeHome(Bucket bucket, EJBInvocation invocation, Iterator JavaDoc iter) throws Exception JavaDoc {
26         // 直接返回 EJBObject 的 Id
27
// System.out.println(this.getClass().getName() + " " + invocation.getMethod().getName());
28
return ((SessionBucket) bucket).createBean(invocation);
29     }
30
31     public Object JavaDoc invokeBean(Bucket bucket, EJBInvocation invocation, Iterator JavaDoc iter) throws Exception JavaDoc {
32         return invocation.getMethod().invoke(invocation.getBean(), invocation.getArgs());
33     }
34
35     public static void main(String JavaDoc[] args) {
36
37     }
38 }
39
Popular Tags