/** * This is called by getTypeDependencies(). * @return an array of all ejb annotation types */ protected Class<? extends Annotation>[] getEjbAnnotationTypes() { if (ejbProvider!=null) { return ejbProvider.getAnnotationTypes(); } else { return new Class[0]; } }
private MethodDescriptor processTimeoutMethod(EjbDescriptor ejb, MethodDescriptor timeoutMethodDescOrig, AnnotationTypesProvider provider, Class ejbClass) throws ClassNotFoundException { Method m = timeoutMethodDescOrig.getDeclaredMethod(ejb); if (m == null) { // In case deployment descriptor didn't specify "javax.ejb.Timer" // as the method-params, and we were not relying on it before, // check explicitly for a method with "javax.ejb.Timer" param type. Class[] params = new Class[1]; if (provider!=null) { params[0] = provider.getType("javax.ejb.Timer"); } else { throw new RuntimeException("Cannot find AnnotationTypesProvider named 'EJB'"); } m = timeoutMethodDescOrig.getDeclaredMethod(ejb, params); } if (m == null) { throw new RuntimeException("Class " + ejbClass.getName() + " does not define timeout method " + timeoutMethodDescOrig.getFormattedString()); } return new MethodDescriptor(m, MethodDescriptor.TIMER_METHOD); } }
public Vector getPossibleTransactionAttributes() { Vector txAttributes = super.getPossibleTransactionAttributes(); // Session beans that implement SessionSynchronization interface // have a limited set of possible transaction attributes. if( isStateful() ) { try { EjbBundleDescriptorImpl ejbBundle = getEjbBundleDescriptor(); ClassLoader classLoader = ejbBundle.getClassLoader(); Class ejbClass = classLoader.loadClass(getEjbClassName()); AnnotationTypesProvider provider = Globals.getDefaultHabitat().getService(AnnotationTypesProvider.class, "EJB"); if (provider!=null) { Class sessionSynchClass = provider.getType("javax.ejb.SessionSynchronization"); if( sessionSynchClass.isAssignableFrom(ejbClass) ) { txAttributes = new Vector(); txAttributes.add(new ContainerTransaction (ContainerTransaction.REQUIRED, "")); txAttributes.add(new ContainerTransaction (ContainerTransaction.REQUIRES_NEW, "")); txAttributes.add(new ContainerTransaction (ContainerTransaction.MANDATORY, "")); } } } catch(Exception e) { // Don't treat this as a fatal error. Just return full // set of possible transaction attributes. } } return txAttributes; }
canDoWebServiceAnnCheck = (provider.getType("javax.jws.WebService") != null);
ejbAnnotations = ejbProvider.getAnnotationTypes(); else ejbAnnotations = new Class[] {javax.ejb.Stateful.class, javax.ejb.Stateless.class,
provider.getType("javax.ejb.TimedObject").isAssignableFrom(ejbClass) ) { MethodDescriptor timedObjectMethod = new MethodDescriptor("ejbTimeout",
if (ejbProvider != null && ejbProvider.getType("javax.ejb.Stateless") != null) {
if ((ejbProvider != null) && ejbProvider.getType("javax.ejb.Stateless") != null) {