public static boolean isInterceptionEnabled(Class<?> clazz) { ComponentType componentType = getComponentType(clazz); if ( componentType==ENTITY_BEAN ) { return false; } else if ( getComponentType(clazz)==MESSAGE_DRIVEN_BEAN ) { return true; } else if ( clazz.isAnnotationPresent(BypassInterceptors.class) ) { return false; } else { return true; } }
/** * Get the default scope * @see Scope */ public static ScopeType getComponentScope(Class<?> clazz) { return clazz.isAnnotationPresent(Scope.class) ? clazz.getAnnotation(Scope.class).value() : getComponentType(clazz).getDefaultScope(); }
/** * Get the scope for a role * @see Scope */ public static ScopeType getComponentRoleScope(Class clazz, Role role) { return role.scope()==ScopeType.UNSPECIFIED ? getComponentType(clazz).getDefaultScope() : role.scope(); }
public static String getEjbName(Class<?> clazz) { switch ( getComponentType(clazz) ) { case ENTITY_BEAN: case JAVA_BEAN: return null; case STATEFUL_SESSION_BEAN: return clazz.isAnnotationPresent(STATEFUL) ? getStatefulEjbName(clazz) : getEjbNameFromDescriptor(clazz); case STATELESS_SESSION_BEAN: return clazz.isAnnotationPresent(STATELESS) ? getStatelessEjbName(clazz) : getEjbNameFromDescriptor(clazz); case SINGLETON_SESSION_BEAN: return clazz.isAnnotationPresent(SINGLETON) ? getSingletonEjbName(clazz) : getEjbNameFromDescriptor(clazz); case MESSAGE_DRIVEN_BEAN: return clazz.isAnnotationPresent(MESSAGE_DRIVEN) ? getMessageDrivenEjbName(clazz) : getEjbNameFromDescriptor(clazz); default: throw new IllegalArgumentException(); } }
this.startup = startup; this.dependencies = dependencies; type = Seam.getComponentType( getBeanClass() ); interceptionEnabled = Seam.isInterceptionEnabled( getBeanClass() ); perNestedConversation = hasAnnotation(getBeanClass(), PerNestedConversation.class);