Search in sources :

Example 1 with WSEndpointDeploymentUnit

use of org.jboss.as.webservices.publish.WSEndpointDeploymentUnit in project wildfly by wildfly.

the class ModelDeploymentAspect method start.

@Override
public void start(final Deployment dep) {
    final DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
    if (unit instanceof WSEndpointDeploymentUnit)
        return;
    final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
    for (final Endpoint endpoint : dep.getService().getEndpoints()) {
        final ModelNode endpointModel;
        try {
            endpointModel = deploymentResourceSupport.getDeploymentSubModel(WSExtension.SUBSYSTEM_NAME, PathElement.pathElement(ENDPOINT, URLEncoder.encode(getId(endpoint), "UTF-8")));
        } catch (final UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        endpointModel.get(ENDPOINT_NAME).set(getName(endpoint));
        endpointModel.get(ENDPOINT_CONTEXT).set(getContext(endpoint));
        endpointModel.get(ENDPOINT_CLASS).set(endpoint.getTargetBeanName());
        endpointModel.get(ENDPOINT_TYPE).set(endpoint.getType().toString());
        endpointModel.get(ENDPOINT_WSDL).set(endpoint.getAddress() + "?wsdl");
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) Endpoint(org.jboss.wsf.spi.deployment.Endpoint) WSEndpointDeploymentUnit(org.jboss.as.webservices.publish.WSEndpointDeploymentUnit) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ModelNode(org.jboss.dmr.ModelNode) WSEndpointDeploymentUnit(org.jboss.as.webservices.publish.WSEndpointDeploymentUnit) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 DeploymentResourceSupport (org.jboss.as.server.deployment.DeploymentResourceSupport)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 WSEndpointDeploymentUnit (org.jboss.as.webservices.publish.WSEndpointDeploymentUnit)1 ModelNode (org.jboss.dmr.ModelNode)1 Endpoint (org.jboss.wsf.spi.deployment.Endpoint)1