Search in sources :

Example 6 with DeploymentAspect

use of org.jboss.wsf.spi.deployment.DeploymentAspect in project wildfly by wildfly.

the class EndpointPublisherImpl method getPublisherDeploymentAspects.

private static synchronized List<DeploymentAspect> getPublisherDeploymentAspects() {
    if (publisherDepAspects == null) {
        publisherDepAspects = new LinkedList<DeploymentAspect>();
        // copy to replace the EndpointServiceDeploymentAspect
        List<DeploymentAspect> serverAspects = DeploymentAspectsProvider.getSortedDeploymentAspects();
        for (DeploymentAspect aspect : serverAspects) {
            if (aspect instanceof EndpointServiceDeploymentAspect) {
                final EndpointServiceDeploymentAspect a = (EndpointServiceDeploymentAspect) aspect;
                EndpointServiceDeploymentAspect clone = (EndpointServiceDeploymentAspect) (a.clone());
                clone.setStopServices(true);
                publisherDepAspects.add(clone);
            } else if (aspect instanceof EndpointHandlerDeploymentAspect) {
                publisherDepAspects.add(aspect);
                //add another aspect to set InvocationHandlerJAXWS to each endpoint
                ForceJAXWSInvocationHandlerDeploymentAspect handlerAspect = new ForceJAXWSInvocationHandlerDeploymentAspect();
                publisherDepAspects.add(handlerAspect);
            } else {
                publisherDepAspects.add(aspect);
            }
        }
    }
    return publisherDepAspects;
}
Also used : EndpointHandlerDeploymentAspect(org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect) AbstractDeploymentAspect(org.jboss.ws.common.integration.AbstractDeploymentAspect) EndpointServiceDeploymentAspect(org.jboss.as.webservices.deployers.EndpointServiceDeploymentAspect) DeploymentAspect(org.jboss.wsf.spi.deployment.DeploymentAspect) EndpointHandlerDeploymentAspect(org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect) EndpointServiceDeploymentAspect(org.jboss.as.webservices.deployers.EndpointServiceDeploymentAspect)

Example 7 with DeploymentAspect

use of org.jboss.wsf.spi.deployment.DeploymentAspect in project wildfly by wildfly.

the class EndpointPublisherImpl method doDeploy.

/**
     * Triggers the WS deployment aspects, which process the deployment and
     * install the endpoint services.
     *
     * @param target
     * @param unit
     */
protected void doDeploy(ServiceTarget target, DeploymentUnit unit) {
    List<DeploymentAspect> aspects = getDeploymentAspects();
    ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
    Deployment dep = null;
    try {
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
        dep = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
        dep.addAttachment(ServiceTarget.class, target);
        DeploymentAspectManager dam = new DeploymentAspectManagerImpl();
        dam.setDeploymentAspects(aspects);
        dam.deploy(dep);
    } finally {
        if (dep != null) {
            dep.removeAttachment(ServiceTarget.class);
        }
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
    }
}
Also used : AbstractDeploymentAspect(org.jboss.ws.common.integration.AbstractDeploymentAspect) EndpointServiceDeploymentAspect(org.jboss.as.webservices.deployers.EndpointServiceDeploymentAspect) DeploymentAspect(org.jboss.wsf.spi.deployment.DeploymentAspect) EndpointHandlerDeploymentAspect(org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect) DeploymentAspectManager(org.jboss.wsf.spi.deployment.DeploymentAspectManager) Deployment(org.jboss.wsf.spi.deployment.Deployment) DeploymentAspectManagerImpl(org.jboss.ws.common.deployment.DeploymentAspectManagerImpl)

Example 8 with DeploymentAspect

use of org.jboss.wsf.spi.deployment.DeploymentAspect in project wildfly by wildfly.

the class EndpointPublisherImpl method undeploy.

protected void undeploy(Deployment deployment) throws Exception {
    List<DeploymentAspect> aspects = getDeploymentAspects();
    ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
    try {
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
        DeploymentAspectManager dam = new DeploymentAspectManagerImpl();
        dam.setDeploymentAspects(aspects);
        dam.undeploy(deployment);
    } finally {
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
    }
}
Also used : AbstractDeploymentAspect(org.jboss.ws.common.integration.AbstractDeploymentAspect) EndpointServiceDeploymentAspect(org.jboss.as.webservices.deployers.EndpointServiceDeploymentAspect) DeploymentAspect(org.jboss.wsf.spi.deployment.DeploymentAspect) EndpointHandlerDeploymentAspect(org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect) DeploymentAspectManager(org.jboss.wsf.spi.deployment.DeploymentAspectManager) DeploymentAspectManagerImpl(org.jboss.ws.common.deployment.DeploymentAspectManagerImpl)

Aggregations

DeploymentAspect (org.jboss.wsf.spi.deployment.DeploymentAspect)8 EndpointServiceDeploymentAspect (org.jboss.as.webservices.deployers.EndpointServiceDeploymentAspect)4 EndpointHandlerDeploymentAspect (org.jboss.ws.common.deployment.EndpointHandlerDeploymentAspect)4 AbstractDeploymentAspect (org.jboss.ws.common.integration.AbstractDeploymentAspect)4 DeploymentAspectManagerImpl (org.jboss.ws.common.deployment.DeploymentAspectManagerImpl)2 DeploymentAspectManager (org.jboss.wsf.spi.deployment.DeploymentAspectManager)2 InputStream (java.io.InputStream)1 LinkedList (java.util.LinkedList)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 WebServiceException (javax.xml.ws.WebServiceException)1 AspectDeploymentProcessor (org.jboss.as.webservices.deployers.AspectDeploymentProcessor)1 ClassLoaderProvider (org.jboss.wsf.spi.classloading.ClassLoaderProvider)1 Deployment (org.jboss.wsf.spi.deployment.Deployment)1 Test (org.junit.Test)1