Search in sources :

Example 1 with Jsr299BindingsCreateInterceptor

use of org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor in project wildfly by wildfly.

the class WeldComponentIntegrationProcessor method addJsr299BindingsCreateInterceptor.

private static void addJsr299BindingsCreateInterceptor(final ComponentConfiguration configuration, final ComponentDescription description, final String beanName, final ServiceName weldServiceName, ServiceBuilder<WeldComponentService> builder, final ServiceName bindingServiceName, final ComponentInterceptorSupport componentInterceptorSupport) {
    //add the create interceptor that creates the CDI interceptors
    final Jsr299BindingsCreateInterceptor createInterceptor = new Jsr299BindingsCreateInterceptor(description.getBeanDeploymentArchiveId(), beanName, componentInterceptorSupport);
    configuration.addPostConstructInterceptor(new ImmediateInterceptorFactory(createInterceptor), InterceptorOrder.ComponentPostConstruct.CREATE_CDI_INTERCEPTORS);
    builder.addDependency(weldServiceName, WeldBootstrapService.class, createInterceptor.getWeldContainer());
    builder.addDependency(bindingServiceName, InterceptorBindings.class, createInterceptor.getInterceptorBindings());
}
Also used : Jsr299BindingsCreateInterceptor(org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor) ImmediateInterceptorFactory(org.jboss.invocation.ImmediateInterceptorFactory)

Example 2 with Jsr299BindingsCreateInterceptor

use of org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor in project wildfly by wildfly.

the class WeldComponentIntegrationProcessor method addJsr299BindingsCreateInterceptor.

private static void addJsr299BindingsCreateInterceptor(final ComponentConfiguration configuration, final ComponentDescription description, final String beanName, final ServiceName weldServiceName, ServiceBuilder<?> builder, final ServiceName bindingServiceName, final ComponentInterceptorSupport componentInterceptorSupport) {
    // add the create interceptor that creates the Jakarta Contexts and Dependency Injection Interceptors
    final Supplier<WeldBootstrapService> weldContainerSupplier = builder.requires(weldServiceName);
    final Supplier<InterceptorBindings> interceptorBindingsSupplier = builder.requires(bindingServiceName);
    final Jsr299BindingsCreateInterceptor createInterceptor = new Jsr299BindingsCreateInterceptor(weldContainerSupplier, interceptorBindingsSupplier, description.getBeanDeploymentArchiveId(), beanName, componentInterceptorSupport);
    configuration.addPostConstructInterceptor(new ImmediateInterceptorFactory(createInterceptor), InterceptorOrder.ComponentPostConstruct.CREATE_CDI_INTERCEPTORS);
}
Also used : InterceptorBindings(org.jboss.weld.ejb.spi.InterceptorBindings) Jsr299BindingsCreateInterceptor(org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor) ImmediateInterceptorFactory(org.jboss.invocation.ImmediateInterceptorFactory) WeldBootstrapService(org.jboss.as.weld.WeldBootstrapService)

Aggregations

Jsr299BindingsCreateInterceptor (org.jboss.as.weld.interceptors.Jsr299BindingsCreateInterceptor)2 ImmediateInterceptorFactory (org.jboss.invocation.ImmediateInterceptorFactory)2 WeldBootstrapService (org.jboss.as.weld.WeldBootstrapService)1 InterceptorBindings (org.jboss.weld.ejb.spi.InterceptorBindings)1