Search in sources :

Example 1 with EndpointMetaData

use of org.jboss.as.xts.jandex.EndpointMetaData in project wildfly by wildfly.

the class XTSHandlerDeploymentProcessor method deploy.

public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit unit = phaseContext.getDeploymentUnit();
    final List<WebserviceDescriptionMetaData> webserviceDescriptions = new ArrayList<WebserviceDescriptionMetaData>();
    boolean modifiedWSMeta = false;
    for (String endpoint : getDeploymentClasses(unit)) {
        try {
            final EndpointMetaData endpointMetaData = EndpointMetaData.build(unit, endpoint);
            if (endpointMetaData.isXTSEnabled()) {
                XTSDeploymentMarker.mark(unit);
                final boolean result = updateXTSEndpoint(endpoint, endpointMetaData, webserviceDescriptions, unit);
                modifiedWSMeta = modifiedWSMeta || result;
            }
        } catch (XTSException e) {
            throw new DeploymentUnitProcessingException("Error processing endpoint '" + endpoint + "'", e);
        }
    }
    if (modifiedWSMeta) {
        unit.putAttachment(WSAttachmentKeys.WEBSERVICES_METADATA_KEY, new WebservicesMetaData(null, webserviceDescriptions));
    }
}
Also used : WebserviceDescriptionMetaData(org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData) DeploymentUnitProcessingException(org.jboss.as.server.deployment.DeploymentUnitProcessingException) ArrayList(java.util.ArrayList) EndpointMetaData(org.jboss.as.xts.jandex.EndpointMetaData) WebservicesMetaData(org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

ArrayList (java.util.ArrayList)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)1 EndpointMetaData (org.jboss.as.xts.jandex.EndpointMetaData)1 WebserviceDescriptionMetaData (org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData)1 WebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData)1