Search in sources :

Example 6 with InterceptorBindings

use of org.jboss.weld.ejb.spi.InterceptorBindings in project wildfly by wildfly.

the class WeldInterceptorBindingsService method getInterceptorBindings.

private InterceptorBindings getInterceptorBindings(final String ejbName, final BeanManagerImpl manager) {
    InterceptorBindings retVal = null;
    if (ejbName != null) {
        retVal = interceptorSupport.getInterceptorBindings(ejbName, manager);
    } else {
        // This is a managed bean
        SlimAnnotatedType<?> type = (SlimAnnotatedType<?>) manager.createAnnotatedType(componentClass);
        if (!manager.getInterceptorModelRegistry().containsKey(type)) {
            EnhancedAnnotatedType<?> enhancedType = manager.getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(type);
            InterceptionModelInitializer.of(manager, enhancedType, null).init();
        }
        InterceptionModel model = manager.getInterceptorModelRegistry().get(type);
        if (model != null) {
            retVal = new InterceptorBindingsAdapter(manager.getInterceptorModelRegistry().get(type));
        }
    }
    return retVal != null ? retVal : NullInterceptorBindings.INSTANCE;
}
Also used : InterceptorBindingsAdapter(org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter) InterceptorBindings(org.jboss.weld.ejb.spi.InterceptorBindings) ClassTransformer(org.jboss.weld.resources.ClassTransformer) InterceptionModel(org.jboss.weld.interceptor.spi.model.InterceptionModel) SlimAnnotatedType(org.jboss.weld.annotated.slim.SlimAnnotatedType)

Aggregations

InterceptorBindings (org.jboss.weld.ejb.spi.InterceptorBindings)6 ComponentInstance (org.jboss.as.ee.component.ComponentInstance)2 WeldBootstrapService (org.jboss.as.weld.WeldBootstrapService)2 InterceptorInstances (org.jboss.as.weld.spi.InterceptorInstances)2 InterceptorBindingsAdapter (org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter)2 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Interceptor (javax.enterprise.inject.spi.Interceptor)1 WeldInterceptorBindingsService (org.jboss.as.weld.ejb.WeldInterceptorBindingsService)1 Jsr299BindingsCreateInterceptor (org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor)1 ImmediateInterceptorFactory (org.jboss.invocation.ImmediateInterceptorFactory)1 ServiceName (org.jboss.msc.service.ServiceName)1 SlimAnnotatedType (org.jboss.weld.annotated.slim.SlimAnnotatedType)1 SessionBean (org.jboss.weld.bean.SessionBean)1 InterceptionModel (org.jboss.weld.interceptor.spi.model.InterceptionModel)1 BeanManagerImpl (org.jboss.weld.manager.BeanManagerImpl)1 ClassTransformer (org.jboss.weld.resources.ClassTransformer)1 SerializableContextualInstance (org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance)1 Test (org.junit.Test)1