protected <X> void findHessianWebServices(final @Observes ProcessBean<X> processBean) { if (ProcessSessionBean.class.isInstance(processBean)) { return; } final Bean<X> bean = processBean.getBean(); final Class<?> beanClass = bean.getBeanClass(); for (final Class<?> itf : beanClass.getInterfaces()) { final Hessian hessian = itf.getAnnotation(Hessian.class); final String key = "openejb.hessian." + beanClass.getName() + "_" + itf.getName() + ".path"; final String path = appInfo.properties.getProperty(key, SystemInstance.get().getProperty(key)); if (hessian != null || path != null) { toDeploy.add(new Deployment(itf, path, bean)); } } }
/** * Observes {@link ProcessManagedBean} event. * * @param event {@link ProcessManagedBean} event. */ <X> void processBean( @Observes ProcessManagedBean<X> event) { boolean sessionBean = event instanceof ProcessSessionBean<?>; AnnotatedType<X> annotatedType = event.getAnnotatedBeanClass(); boolean hasClassInterceptor = annotatedType .isAnnotationPresent(Transactional.class); if (hasClassInterceptor && sessionBean) { event.addDefinitionError(new RuntimeException( "@Transactional is forbidden for session bean " + event.getBean())); } else { TransactionAttribute classAttr = annotatedType .getAnnotation(TransactionAttribute.class); for (AnnotatedMethod<? super X> am : annotatedType.getMethods()) { boolean hasMethodInterceptor = am .isAnnotationPresent(Transactional.class); if (hasMethodInterceptor && sessionBean) { event.addDefinitionError(new RuntimeException( "@Transactional is forbidden for session bean method " + am)); } else if (hasClassInterceptor || hasMethodInterceptor) { TransactionAttribute attr = am .getAnnotation(TransactionAttribute.class); Method method = am.getJavaMember(); TransactionAttributeType attrType = mergeTransactionAttributes(classAttr, attr); transactionAttributes.put(method, attrType); } } } }
<T> void processSessionBean(@Observes ProcessSessionBean<T> psb) { logger.info("finished the scanning process"); processSessionBean++; }