Search in sources :

Example 1 with BasicComponentInstance

use of org.jboss.as.ee.component.BasicComponentInstance in project wildfly by wildfly.

the class WSComponentInstanceAssociationInterceptor method processInvocation.

@Override
public Object processInvocation(final InterceptorContext interceptorContext) throws Exception {
    final WSComponent wsComponent = (WSComponent) interceptorContext.getPrivateData(Component.class);
    BasicComponentInstance pojoComponentInstance = null;
    if (interceptorContext.getPrivateData(ManagedReference.class) != null) {
        ManagedReference reference = interceptorContext.getPrivateData(ManagedReference.class);
        pojoComponentInstance = (BasicComponentInstance) wsComponent.createInstance(reference.getInstance());
    } else {
        pojoComponentInstance = wsComponent.getComponentInstance();
    }
    interceptorContext.putPrivateData(ComponentInstance.class, pojoComponentInstance);
    return interceptorContext.proceed();
}
Also used : WSComponent(org.jboss.as.webservices.injection.WSComponent) ManagedReference(org.jboss.as.naming.ManagedReference) WSComponent(org.jboss.as.webservices.injection.WSComponent) Component(org.jboss.as.ee.component.Component) BasicComponentInstance(org.jboss.as.ee.component.BasicComponentInstance)

Aggregations

BasicComponentInstance (org.jboss.as.ee.component.BasicComponentInstance)1 Component (org.jboss.as.ee.component.Component)1 ManagedReference (org.jboss.as.naming.ManagedReference)1 WSComponent (org.jboss.as.webservices.injection.WSComponent)1