Search in sources :

Example 1 with Endpoint

use of org.jboss.wsf.spi.deployment.Endpoint 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 {
    Deployment deployment = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
    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();
        for (Endpoint ep : endpoints) {
            final ServiceName serviceName = EndpointService.getServiceName(unit, ep.getShortName());
            registry.getRequiredService(serviceName).awaitValue();
        }
    }
    //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) ServiceRegistry(org.jboss.msc.service.ServiceRegistry)

Example 2 with Endpoint

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

the class AbstractDeploymentModelBuilder method newJMSEndpoint.

/**
     * Creates new JMS Web Service endpoint.
     *
     * @param endpointClass endpoint class name
     * @param endpointName endpoint name
     * @param dep deployment
     * @return WS endpoint
     */
protected final Endpoint newJMSEndpoint(final String endpointClass, final String endpointName, final String soapAddress, final Deployment dep) {
    if (endpointName == null)
        throw WSLogger.ROOT_LOGGER.nullEndpointName();
    if (endpointClass == null)
        throw WSLogger.ROOT_LOGGER.nullEndpointClass();
    final Endpoint endpoint = deploymentModelFactory.newJMSEndpoint(endpointClass);
    endpoint.setAddress(soapAddress);
    endpoint.setShortName(endpointName);
    endpoint.setType(endpointType);
    dep.getService().addEndpoint(endpoint);
    return endpoint;
}
Also used : Endpoint(org.jboss.wsf.spi.deployment.Endpoint)

Example 3 with Endpoint

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

the class AbstractDeploymentModelBuilder method newHttpEndpoint.

/**
     * Creates new Http Web Service endpoint.
     *
     * @param endpointClass endpoint class name
     * @param endpointName endpoint name
     * @param dep deployment
     * @return WS endpoint
     */
protected final Endpoint newHttpEndpoint(final String endpointClass, final String endpointName, final Deployment dep) {
    if (endpointName == null)
        throw WSLogger.ROOT_LOGGER.nullEndpointName();
    if (endpointClass == null)
        throw WSLogger.ROOT_LOGGER.nullEndpointClass();
    final Endpoint endpoint = this.deploymentModelFactory.newHttpEndpoint(endpointClass);
    endpoint.setShortName(endpointName);
    endpoint.setType(endpointType);
    dep.getService().addEndpoint(endpoint);
    return endpoint;
}
Also used : Endpoint(org.jboss.wsf.spi.deployment.Endpoint)

Example 4 with Endpoint

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

the class DeploymentModelBuilderJAXWS_POJO method build.

@Override
protected void build(final Deployment dep, final DeploymentUnit unit) {
    WSLogger.ROOT_LOGGER.trace("Creating JAXWS POJO endpoints meta data model");
    WSEndpointConfigMapping ecm = unit.getAttachment(WSAttachmentKeys.WS_ENDPOINT_CONFIG_MAPPING_KEY);
    for (final POJOEndpoint pojoEndpoint : getJaxwsPojos(unit)) {
        final String pojoEndpointName = pojoEndpoint.getName();
        WSLogger.ROOT_LOGGER.tracef("POJO name: %s", pojoEndpointName);
        final String pojoEndpointClassName = pojoEndpoint.getClassName();
        WSLogger.ROOT_LOGGER.tracef("POJO class: %s", pojoEndpointClassName);
        final Endpoint ep = newHttpEndpoint(pojoEndpointClassName, pojoEndpointName, dep);
        final ServiceName componentViewName = pojoEndpoint.getComponentViewName();
        if (componentViewName != null) {
            ep.setProperty(COMPONENT_VIEW_NAME, componentViewName);
        }
        if (ecm != null) {
            ep.setEndpointConfig(ecm.getConfig(pojoEndpointClassName));
        }
    }
}
Also used : POJOEndpoint(org.jboss.as.webservices.metadata.model.POJOEndpoint) Endpoint(org.jboss.wsf.spi.deployment.Endpoint) ServiceName(org.jboss.msc.service.ServiceName) POJOEndpoint(org.jboss.as.webservices.metadata.model.POJOEndpoint) WSEndpointConfigMapping(org.jboss.as.webservices.deployers.WSEndpointConfigMapping)

Example 5 with Endpoint

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

the class EndpointServiceDeploymentAspect method stop.

@Override
public void stop(Deployment dep) {
    for (final Endpoint ep : dep.getService().getEndpoints()) {
        if (ep.getLifecycleHandler() != null) {
            ep.getLifecycleHandler().stop(ep);
        }
        if (stopServices) {
            final DeploymentUnit unit = getRequiredAttachment(dep, DeploymentUnit.class);
            EndpointService.uninstall(ep, unit);
        }
    }
}
Also used : Endpoint(org.jboss.wsf.spi.deployment.Endpoint) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

Endpoint (org.jboss.wsf.spi.deployment.Endpoint)19 ServiceName (org.jboss.msc.service.ServiceName)6 HttpEndpoint (org.jboss.wsf.spi.deployment.HttpEndpoint)5 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)3 EJBEndpoint (org.jboss.as.webservices.metadata.model.EJBEndpoint)3 Deployment (org.jboss.wsf.spi.deployment.Deployment)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 WSEndpointConfigMapping (org.jboss.as.webservices.deployers.WSEndpointConfigMapping)2 ModelNode (org.jboss.dmr.ModelNode)2 ManagedEndpoint (org.jboss.ws.common.management.ManagedEndpoint)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Vector (java.util.Vector)1 OperationFailedException (org.jboss.as.controller.OperationFailedException)1 PathAddress (org.jboss.as.controller.PathAddress)1 ApplicationSecurityDomainService (org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService)1 DeploymentResourceSupport (org.jboss.as.server.deployment.DeploymentResourceSupport)1 POJOEndpoint (org.jboss.as.webservices.metadata.model.POJOEndpoint)1 WSEndpointDeploymentUnit (org.jboss.as.webservices.publish.WSEndpointDeploymentUnit)1 ParamValueMetaData (org.jboss.metadata.javaee.spec.ParamValueMetaData)1