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);
}
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;
}
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;
}
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));
}
}
}
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);
}
}
}
Aggregations