/** * Returns {@link EnhancedAnnotatedType} for the EJB implementation class. Throws {@link IllegalStateException} if called after bootstrap. * * @param bean * @throws IllegalStateException if called after bootstrap * @return {@link EnhancedAnnotatedType} representation of this EJB's implementation class */ public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(SessionBean<T> bean) { return getEjbImplementationClass(bean.getEjbDescriptor(), bean.getBeanManager(), bean.getEnhancedAnnotated()); }
/** * Returns {@link EnhancedAnnotatedType} for the EJB implementation class. Throws {@link IllegalStateException} if called after bootstrap. * @param bean * @throws IllegalStateException if called after bootstrap * @return {@link EnhancedAnnotatedType} representation of this EJB's implementation class */ public static <T> EnhancedAnnotatedType<T> getEjbImplementationClass(SessionBean<T> bean) { return getEjbImplementationClass(bean.getEjbDescriptor(), bean.getBeanManager(), bean.getEnhancedAnnotated()); }
/** * If there are any observer methods, they must be static or business * methods. */ protected void checkObserverMethods() { Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated()); if (!observerMethods.isEmpty()) { Set<MethodSignature> businessMethodSignatures = getBusinessMethodSignatures(); for (EnhancedAnnotatedMethod<?, ? super T> observerMethod : observerMethods) { if (!observerMethod.isStatic() && !businessMethodSignatures.contains(observerMethod.getSignature())) { throw BeanLogger.LOG .observerMethodMustBeStaticOrBusiness(observerMethod, Formats.formatAsStackTraceElement(observerMethod.getJavaMember())); } } } }
@Override protected void checkType() { if (!isDependent() && getEnhancedAnnotated().isGeneric()) { throw BeanLogger.LOG.genericSessionBeanMustBeDependent(this); } boolean passivating = beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(getScope()).isPassivating(); if (passivating && !isPassivationCapableBean()) { throw BeanLogger.LOG.passivatingBeanNeedsSerializableImpl(this); } }