Search in sources :

Example 1 with EjbContextResourceReferenceProcessor

use of org.jboss.as.ejb3.context.EjbContextResourceReferenceProcessor in project wildfly by wildfly.

the class EjbContextJndiBindingProcessor method deploy.

/**
 * {@inheritDoc} *
 */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final EEResourceReferenceProcessorRegistry registry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY);
    // setup ejb context jndi handlers
    registry.registerResourceReferenceProcessor(new EjbContextResourceReferenceProcessor(EJBContext.class));
    registry.registerResourceReferenceProcessor(new EjbContextResourceReferenceProcessor(SessionContext.class));
    registry.registerResourceReferenceProcessor(new EjbContextResourceReferenceProcessor(EntityContext.class));
    registry.registerResourceReferenceProcessor(new EjbContextResourceReferenceProcessor(MessageDrivenContext.class));
    final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    final Collection<ComponentDescription> componentConfigurations = eeModuleDescription.getComponentDescriptions();
    if (componentConfigurations == null || componentConfigurations.isEmpty()) {
        return;
    }
    for (ComponentDescription componentConfiguration : componentConfigurations) {
        final CompositeIndex index = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPOSITE_ANNOTATION_INDEX);
        if (index != null) {
            processComponentConfig(componentConfiguration);
        }
    }
}
Also used : EJBContext(javax.ejb.EJBContext) EJBComponentDescription(org.jboss.as.ejb3.component.EJBComponentDescription) ComponentDescription(org.jboss.as.ee.component.ComponentDescription) EjbContextResourceReferenceProcessor(org.jboss.as.ejb3.context.EjbContextResourceReferenceProcessor) EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) MessageDrivenContext(javax.ejb.MessageDrivenContext) CompositeIndex(org.jboss.as.server.deployment.annotation.CompositeIndex) SessionContext(javax.ejb.SessionContext) EntityContext(javax.ejb.EntityContext) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) EEResourceReferenceProcessorRegistry(org.jboss.as.ee.component.deployers.EEResourceReferenceProcessorRegistry)

Aggregations

EJBContext (javax.ejb.EJBContext)1 EntityContext (javax.ejb.EntityContext)1 MessageDrivenContext (javax.ejb.MessageDrivenContext)1 SessionContext (javax.ejb.SessionContext)1 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)1 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)1 EEResourceReferenceProcessorRegistry (org.jboss.as.ee.component.deployers.EEResourceReferenceProcessorRegistry)1 EJBComponentDescription (org.jboss.as.ejb3.component.EJBComponentDescription)1 EjbContextResourceReferenceProcessor (org.jboss.as.ejb3.context.EjbContextResourceReferenceProcessor)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)1