Search in sources :

Example 11 with Deployment

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

the class AbstractSecurityMetaDataAccessorEJB method getEjbSecurityMetaData.

/**
 * Gets Jakarta Enterprise Beans security meta data if associated with Jakarta Enterprise Beans endpoint.
 *
 * @param endpoint EJB webservice endpoint
 * @return EJB security meta data or null
 */
private EJBSecurityMetaData getEjbSecurityMetaData(final Endpoint endpoint) {
    final String ejbName = endpoint.getShortName();
    final Deployment dep = endpoint.getService().getDeployment();
    final EJBArchiveMetaData ejbArchiveMD = WSHelper.getOptionalAttachment(dep, EJBArchiveMetaData.class);
    final EJBMetaData ejbMD = ejbArchiveMD != null ? ejbArchiveMD.getBeanByEjbName(ejbName) : null;
    return ejbMD != null ? ejbMD.getSecurityMetaData() : null;
}
Also used : EJBMetaData(org.jboss.wsf.spi.metadata.j2ee.EJBMetaData) Deployment(org.jboss.wsf.spi.deployment.Deployment) EJBArchiveMetaData(org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData)

Example 12 with Deployment

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

the class EndpointPublisherImpl method doPublish.

/**
 * Publish the webapp for the WS deployment unit
 *
 * @param target
 * @param unit
 * @return
 * @throws Exception
 */
protected Context doPublish(ServiceTarget target, DeploymentUnit unit) throws Exception {
    final Deployment deployment = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
    final List<Endpoint> endpoints = deployment.getService().getEndpoints();
    // otherwise we need to explicitly wait for the endpoint services to be started before creating the webapp.
    if (!runningInService) {
        final ServiceRegistry registry = unit.getServiceRegistry();
        final CountDownLatch latch = new CountDownLatch(endpoints.size());
        final LifecycleListener listener = new LifecycleListener() {

            @Override
            public void handleEvent(final ServiceController<?> controller, final LifecycleEvent event) {
                if (event == LifecycleEvent.UP) {
                    latch.countDown();
                    controller.removeListener(this);
                }
            }
        };
        ServiceName serviceName;
        for (Endpoint ep : endpoints) {
            serviceName = EndpointService.getServiceName(unit, ep.getShortName());
            registry.getRequiredService(serviceName).addListener(listener);
        }
        latch.await();
    }
    // TODO simplify and use findChild later in destroy()/stopWebApp()
    deployment.addAttachment(WebDeploymentController.class, startWebApp(host, unit));
    return new Context(unit.getAttachment(WSAttachmentKeys.JBOSSWEB_METADATA_KEY).getContextRoot(), endpoints);
}
Also used : Context(org.jboss.wsf.spi.publish.Context) Endpoint(org.jboss.wsf.spi.deployment.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) Deployment(org.jboss.wsf.spi.deployment.Deployment) LifecycleEvent(org.jboss.msc.service.LifecycleEvent) ServiceController(org.jboss.msc.service.ServiceController) ServiceRegistry(org.jboss.msc.service.ServiceRegistry) LifecycleListener(org.jboss.msc.service.LifecycleListener) CountDownLatch(java.util.concurrent.CountDownLatch)

Example 13 with Deployment

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

the class AspectDeploymentProcessor method undeploy.

@Override
public void undeploy(final DeploymentUnit unit) {
    if (isWebServiceDeployment(unit)) {
        final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY);
        WSLogger.ROOT_LOGGER.tracef("%s stop: %s", aspect, unit.getName());
        ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
        try {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader());
            aspect.stop(dep);
        } finally {
            WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader);
        }
    }
}
Also used : Deployment(org.jboss.wsf.spi.deployment.Deployment)

Example 14 with Deployment

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

the class EndpointService method getServiceNamesFromDeploymentUnit.

static List<ServiceName> getServiceNamesFromDeploymentUnit(final DeploymentUnit unit) {
    final List<ServiceName> endpointServiceNames = new ArrayList<>();
    Deployment deployment = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
    for (Endpoint ep : deployment.getService().getEndpoints()) {
        endpointServiceNames.add(EndpointService.getServiceName(unit, ep.getShortName()));
    }
    return endpointServiceNames;
}
Also used : Endpoint(org.jboss.wsf.spi.deployment.Endpoint) ManagedEndpoint(org.jboss.ws.common.management.ManagedEndpoint) EJBEndpoint(org.jboss.as.webservices.metadata.model.EJBEndpoint) ServiceName(org.jboss.msc.service.ServiceName) ArrayList(java.util.ArrayList) Deployment(org.jboss.wsf.spi.deployment.Deployment)

Example 15 with Deployment

use of org.jboss.wsf.spi.deployment.Deployment 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)

Aggregations

Deployment (org.jboss.wsf.spi.deployment.Deployment)16 SOAPAddressRewriteMetadata (org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata)6 DefaultDeploymentModelFactory (org.jboss.ws.common.deployment.DefaultDeploymentModelFactory)4 Bus (org.apache.cxf.Bus)3 BusLifeCycleManager (org.apache.cxf.buslifecycle.BusLifeCycleManager)3 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)3 Endpoint (org.jboss.wsf.spi.deployment.Endpoint)3 HashMap (java.util.HashMap)2 ServiceName (org.jboss.msc.service.ServiceName)2 IOException (java.io.IOException)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ServletConfig (javax.servlet.ServletConfig)1 ServletException (javax.servlet.ServletException)1 ServletRequest (javax.servlet.ServletRequest)1 HttpServletResponseWrapper (javax.servlet.http.HttpServletResponseWrapper)1 QName (javax.xml.namespace.QName)1 SoapMessage (org.apache.cxf.binding.soap.SoapMessage)1 Header (org.apache.cxf.headers.Header)1