1 29 30 package com.caucho.ejb.cfg; 31 32 import com.caucho.bytecode.JClass; 33 import com.caucho.bytecode.JMethod; 34 import com.caucho.config.ConfigException; 35 import com.caucho.log.Log; 36 import com.caucho.util.L10N; 37 38 import java.util.logging.Logger ; 39 40 43 public class EjbStatelessHomeView extends EjbHomeView { 44 private static final Logger log = Log.open(EjbStatelessHomeView.class); 45 private static final L10N L = new L10N(EjbStatelessHomeView.class); 46 47 50 public EjbStatelessHomeView(EjbBean bean, JClass apiClass, String prefix) 51 throws ConfigException 52 { 53 super(bean, apiClass, prefix); 54 } 55 56 59 protected EjbMethod introspectApiMethod(JMethod apiMethod) 60 throws ConfigException 61 { 62 String methodName = apiMethod.getName(); 63 JClass []paramTypes = apiMethod.getParameterTypes(); 64 65 if (methodName.equals("create") && paramTypes.length == 0) { 66 return new EjbCreateMethod(this, apiMethod, null); 67 } 68 else if (methodName.startsWith("create")) { 69 throw error(L.l("{0}: '{1}' forbidden in stateless session home. The create() method for a stateless session bean must have zero arguments.", 70 apiMethod.getDeclaringClass().getName(), 71 getFullMethodName(apiMethod))); 72 73 } 74 else 75 return super.introspectApiMethod(apiMethod); 76 } 77 } 78 | Popular Tags |