Search in sources :

Example 1 with ConstructedValue

use of org.jboss.msc.value.ConstructedValue in project wildfly by wildfly.

the class ServerInterceptorCache method createInterceptorFactoryForServerInterceptor.

private InterceptorFactory createInterceptorFactoryForServerInterceptor(final Method method, final Constructor interceptorConstructor) {
    // The managed reference is going to be ConstructedValue, using the container-interceptor's constructor
    final ConstructedValue interceptorInstanceValue = new ConstructedValue(interceptorConstructor, Collections.<Value<?>>emptyList());
    // we *don't* create multiple instances of the container-interceptor class, but we just reuse a single instance and it's *not*
    // tied to the Jakarta Enterprise Beans component instance lifecycle.
    final CachedValue cachedInterceptorInstanceValue = new CachedValue(interceptorInstanceValue);
    // ultimately create the managed reference which is backed by the CachedValue
    final ManagedReference interceptorInstanceRef = new ValueManagedReference(cachedInterceptorInstanceValue);
    // which can invoke the container-interceptor's around-invoke/around-timeout methods
    return new ContainerInterceptorMethodInterceptorFactory(interceptorInstanceRef, method);
}
Also used : ValueManagedReference(org.jboss.as.naming.ValueManagedReference) ContainerInterceptorMethodInterceptorFactory(org.jboss.as.ejb3.component.ContainerInterceptorMethodInterceptorFactory) ConstructedValue(org.jboss.msc.value.ConstructedValue) ValueManagedReference(org.jboss.as.naming.ValueManagedReference) ManagedReference(org.jboss.as.naming.ManagedReference) CachedValue(org.jboss.msc.value.CachedValue)

Aggregations

ContainerInterceptorMethodInterceptorFactory (org.jboss.as.ejb3.component.ContainerInterceptorMethodInterceptorFactory)1 ManagedReference (org.jboss.as.naming.ManagedReference)1 ValueManagedReference (org.jboss.as.naming.ValueManagedReference)1 CachedValue (org.jboss.msc.value.CachedValue)1 ConstructedValue (org.jboss.msc.value.ConstructedValue)1