Search in sources :

Example 1 with JaxrsAnnotations

use of org.jboss.as.jaxrs.JaxrsAnnotations in project wildfly by wildfly.

the class JaxrsAnnotationProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    if (deploymentUnit.getParent() == null) {
        //register resource, provider and application as CDI annotation defining types
        deploymentUnit.addToAttachmentList(INJECTION_TARGET_DEFINING_ANNOTATIONS, JaxrsAnnotations.PROVIDER.getDotName());
        deploymentUnit.addToAttachmentList(INJECTION_TARGET_DEFINING_ANNOTATIONS, JaxrsAnnotations.PATH.getDotName());
    }
    final CompositeIndex index = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
    for (final JaxrsAnnotations annotation : JaxrsAnnotations.values()) {
        if (!index.getAnnotations(annotation.getDotName()).isEmpty()) {
            JaxrsDeploymentMarker.mark(deploymentUnit);
            phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, Services.JBOSS_MODULE_INDEX_SERVICE);
            return;
        }
    }
}
Also used : JaxrsAnnotations(org.jboss.as.jaxrs.JaxrsAnnotations) CompositeIndex(org.jboss.as.server.deployment.annotation.CompositeIndex) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

JaxrsAnnotations (org.jboss.as.jaxrs.JaxrsAnnotations)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)1