001: /*
002: * JFox - The most lightweight Java EE Application Server!
003: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
004: *
005: * JFox is licenced and re-distributable under GNU LGPL.
006: */
007: package org.jfox.ejb3;
008:
009: import java.lang.reflect.Method;
010: import java.util.Collection;
011: import javax.ejb.EJBObject;
012: import javax.naming.Context;
013:
014: import org.jfox.ejb3.interceptor.InterceptorMethod;
015: import org.jfox.framework.component.Module;
016:
017: /**
018: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
019: */
020: public interface EJBBucket {
021:
022: /**
023: * ejb name
024: */
025: String getEJBName();
026:
027: /**
028: * description infomation
029: */
030: String getDescription();
031:
032: /**
033: * JNDI name
034: */
035: String[] getMappedNames();
036:
037: /**
038: * Bean Class
039: */
040: Class<?> getBeanClass();
041:
042: /**
043: * EJB 的接�,�以由 @Remote @Local指定,未指定则为Bean所有接�
044: */
045: Class[] getEJBInterfaces();
046:
047: /**
048: * new EJB instance, return bean instance, not EJBObject
049: *
050: * @param ejbObjectId ejb object id
051: */
052: ExtendEJBContext getEJBContext(EJBObjectId ejbObjectId);
053:
054: /**
055: * �用 ejb instance
056: *
057: * @param ejbContext ejb context
058: */
059: void reuseEJBContext(ExtendEJBContext ejbContext);
060:
061: /**
062: * EJB 所在的 Module
063: */
064: Module getModule();
065:
066: /**
067: * 部署的 EJB 容器
068: */
069: EJBContainer getEJBContainer();
070:
071: /**
072: * 获得 EJB å˜æ ¹ï¼Œä½œä¸ºå¯¹EJB的引用,用æ?¥ bind 到 jndi,以å?Š inject
073: */
074: EJBObject createProxyStub();
075:
076: /**
077: * \@Interceptors on class
078: */
079: Collection<InterceptorMethod> getClassInterceptorMethods();
080:
081: /**
082: * \@Interceptors on concreteMethod
083: * @param concreteMethod concrete Method
084: */
085: Collection<InterceptorMethod> getMethodInterceptorMethods(
086: Method concreteMethod);
087:
088: /**
089: * \@AroundInvoke in bean class
090: */
091: Collection<InterceptorMethod> getBeanInterceptorMethods();
092:
093: /**
094: * 是�是 Session Bean
095: */
096: boolean isSession();
097:
098: boolean isStateful();
099:
100: /**
101: * 是�是 @Remote EJB
102: */
103: boolean isRemote();
104:
105: /**
106: * 是�是 @Local EJB
107: */
108: boolean isLocal();
109:
110: /**
111: * 是��布� WebService, �有 Stateless Session Bean �以�布� WebService
112: */
113: boolean isWebService();
114:
115: /**
116: * 是�以该接��布
117: * @param beanInterface 是å?¦åœ¨ Remote/Local ä¸æŒ‡å®šè¯¥ Bean interface
118: */
119: boolean isBusinessInterface(Class beanInterface);
120:
121: Method getConcreteMethod(Method interfaceMethod);
122:
123: /**
124: * EJB env context, java:comp/env
125: * @param ejbObjectId ejb object id
126: */
127: Context getENContext(EJBObjectId ejbObjectId);
128:
129: void start();
130:
131: /**
132: * 销� EJBBucket
133: */
134: void stop();
135: }
|