Search in sources :

Example 1 with WebserviceDescriptionMetaData

use of org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData in project wildfly by wildfly.

the class XTSHandlerDeploymentProcessor method updateXTSEndpoint.

private boolean updateXTSEndpoint(final String endpoint, final EndpointMetaData endpointMetaData, final List<WebserviceDescriptionMetaData> webserviceDescriptions, final DeploymentUnit unit) {
    if (endpointMetaData.isWebservice()) {
        final List<String> handlers = new ArrayList<String>();
        if (endpointMetaData.isBridgeEnabled()) {
            handlers.add(TX_BRIDGE_HANDLER);
        }
        handlers.add(TX_CONTEXT_HANDLER);
        if (!isAnyOfHandlersRegistered(unit, endpoint, handlers)) {
            final UnifiedHandlerChainsMetaData unifiedHandlerChainsMetaData = buildHandlerChains(handlers);
            final QName portQname = endpointMetaData.getWebServiceAnnotation().buildPortQName();
            webserviceDescriptions.add(new WebserviceDescriptionMetaData(null, null, null, buildPortComponent(endpointMetaData.isEJB(), endpoint, portQname, unifiedHandlerChainsMetaData)));
            registerHandlersWithAS(unit, endpoint, handlers);
            return true;
        }
    }
    return false;
}
Also used : WebserviceDescriptionMetaData(org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData) QName(javax.xml.namespace.QName) UnifiedHandlerChainsMetaData(org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData) ArrayList(java.util.ArrayList)

Example 2 with WebserviceDescriptionMetaData

use of org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData 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)2 WebserviceDescriptionMetaData (org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData)2 QName (javax.xml.namespace.QName)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 UnifiedHandlerChainsMetaData (org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData)1 WebservicesMetaData (org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData)1