use of org.jboss.ws.common.management.AbstractServerConfig in project wildfly by wildfly.
the class EndpointService method install.
public static void install(final ServiceTarget serviceTarget, final Endpoint endpoint, final DeploymentUnit unit) {
final ServiceName serviceName = getServiceName(unit, endpoint.getShortName());
final String propContext = endpoint.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
final String propEndpoint = endpoint.getName().getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
final StringBuilder context = new StringBuilder(Endpoint.SEPID_PROPERTY_CONTEXT).append("=").append(propContext);
final ServiceBuilder<?> builder = serviceTarget.addService(serviceName);
Supplier<ApplicationSecurityDomainService.ApplicationSecurityDomain> ejbApplicationSecurityDomain = null;
Supplier<EJBViewMethodSecurityAttributesService> ejbMethodSecurityAttributeService = null;
Supplier<SecurityDomain> elytronSecurityDomain = null;
final ServiceName alias = WSServices.ENDPOINT_SERVICE.append(context.toString()).append(propEndpoint);
final Consumer<Endpoint> endpointConsumer = builder.provides(serviceName, alias);
// builder.addAliases(alias);
final String domainName = getDeploymentSecurityDomainName(endpoint, unit);
endpoint.setProperty(SECURITY_DOMAIN_NAME, domainName);
if (isElytronSecurityDomain(unit, endpoint, domainName)) {
if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) {
ServiceName ejbSecurityDomainServiceName = EJB_APPLICATION_SECURITY_DOMAIN_RUNTIME_CAPABILITY.getCapabilityServiceName(domainName, ApplicationSecurityDomainService.ApplicationSecurityDomain.class);
ejbApplicationSecurityDomain = builder.requires(ejbSecurityDomainServiceName);
} else {
ServiceName securityDomainName = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT).getCapabilityServiceName(Capabilities.CAPABILITY_APPLICATION_SECURITY_DOMAIN, domainName).append(Constants.SECURITY_DOMAIN);
elytronSecurityDomain = builder.requires(securityDomainName);
}
endpoint.setProperty(ELYTRON_SECURITY_DOMAIN, true);
} else if (isLegacySecurityDomain(unit, endpoint, domainName)) {
throw ROOT_LOGGER.legacySecurityUnsupported();
}
final Supplier<AbstractServerConfig> serverConfigService = builder.requires(WSServices.CONFIG_SERVICE);
if (EndpointType.JAXWS_EJB3.equals(endpoint.getType())) {
ejbMethodSecurityAttributeService = builder.requires(getEJBViewMethodSecurityAttributesServiceName(unit, endpoint));
}
builder.setInstance(new EndpointService(endpoint, serviceName, alias, endpointConsumer, serverConfigService, ejbApplicationSecurityDomain, ejbMethodSecurityAttributeService, elytronSecurityDomain));
builder.install();
// add a dependency on the endpoint service to web deployments, so that the
// endpoint servlet is not started before the endpoint is actually available
unit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, serviceName);
}
Aggregations