01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package org.jfox.ejb3;
08:
09: import java.util.Iterator;
10: import javax.ejb.EJBException;
11:
12: import org.apache.log4j.Logger;
13:
14: /**
15: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
16: */
17: public abstract class EJBInvocationHandler {
18:
19: protected final Logger logger = Logger.getLogger(this .getClass());
20:
21: /**
22: * 交给 chain 的下一个 handler 处�
23: *
24: * @param invocation ejb invocation
25: * @param chain invocation china
26: * @throws Exception any exception
27: */
28: protected final Object next(final EJBInvocation invocation,
29: final Iterator<EJBInvocationHandler> chain)
30: throws Exception {
31: if (chain.hasNext()) {
32: return chain.next().invoke(invocation, chain);
33: } else {
34: throw new EJBException("no EJBInvocationHandler!");
35: }
36: }
37:
38: /**
39: * 对 ejb invocation 进行处�
40: * @param invocation ejb invocation
41: * @param chain invocation china
42: * @throws Exception any exception
43: */
44: public abstract Object invoke(final EJBInvocation invocation,
45: final Iterator<EJBInvocationHandler> chain)
46: throws Exception;
47:
48: public static void main(String[] args) {
49:
50: }
51: }
|