Search in sources :

Example 1 with EjbComponentInstance

use of org.jboss.as.ejb3.component.EjbComponentInstance in project wildfly by wildfly.

the class CurrentInvocationContext method getEjbContext.

public static EJBContextImpl getEjbContext() {
    final InterceptorContext context = get();
    if (context == null) {
        throw EjbLogger.ROOT_LOGGER.noEjbContextAvailable();
    }
    final ComponentInstance component = context.getPrivateData(ComponentInstance.class);
    if (!(component instanceof EjbComponentInstance)) {
        throw EjbLogger.ROOT_LOGGER.currentComponentNotAEjb(component);
    }
    return ((EjbComponentInstance) component).getEjbContext();
}
Also used : InterceptorContext(org.jboss.invocation.InterceptorContext) ComponentInstance(org.jboss.as.ee.component.ComponentInstance) EjbComponentInstance(org.jboss.as.ejb3.component.EjbComponentInstance) EjbComponentInstance(org.jboss.as.ejb3.component.EjbComponentInstance)

Aggregations

ComponentInstance (org.jboss.as.ee.component.ComponentInstance)1 EjbComponentInstance (org.jboss.as.ejb3.component.EjbComponentInstance)1 InterceptorContext (org.jboss.invocation.InterceptorContext)1