Search in sources :

Example 1 with AbstractServerConfig

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);
}
Also used : AbstractServerConfig(org.jboss.ws.common.management.AbstractServerConfig) EJBViewMethodSecurityAttributesService(org.jboss.as.ejb3.security.service.EJBViewMethodSecurityAttributesService) ApplicationSecurityDomain(org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService.ApplicationSecurityDomain) SecurityDomain(org.wildfly.security.auth.server.SecurityDomain) Endpoint(org.jboss.wsf.spi.deployment.Endpoint) ManagedEndpoint(org.jboss.ws.common.management.ManagedEndpoint) EJBEndpoint(org.jboss.as.webservices.metadata.model.EJBEndpoint) ApplicationSecurityDomainService(org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService) ServiceName(org.jboss.msc.service.ServiceName) ApplicationSecurityDomain(org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService.ApplicationSecurityDomain)

Aggregations

EJBViewMethodSecurityAttributesService (org.jboss.as.ejb3.security.service.EJBViewMethodSecurityAttributesService)1 ApplicationSecurityDomainService (org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService)1 ApplicationSecurityDomain (org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService.ApplicationSecurityDomain)1 EJBEndpoint (org.jboss.as.webservices.metadata.model.EJBEndpoint)1 ServiceName (org.jboss.msc.service.ServiceName)1 AbstractServerConfig (org.jboss.ws.common.management.AbstractServerConfig)1 ManagedEndpoint (org.jboss.ws.common.management.ManagedEndpoint)1 Endpoint (org.jboss.wsf.spi.deployment.Endpoint)1 SecurityDomain (org.wildfly.security.auth.server.SecurityDomain)1