use of org.wildfly.extension.picketlink.federation.service.ServiceProviderService in project wildfly by wildfly.
the class ServiceProviderAddHandler method launchService.
public static void launchService(OperationContext context, PathAddress pathAddress, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
String alias = pathAddress.getLastElement().getValue();
ServiceProviderService service = new ServiceProviderService(toSPConfig(context, model, alias));
ServiceBuilder<ServiceProviderService> serviceBuilder = context.getServiceTarget().addService(ServiceProviderService.createServiceName(alias), service);
String federationAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();
serviceBuilder.addDependency(FederationService.createServiceName(federationAlias), FederationService.class, service.getFederationService());
configureHandler(context, model, service);
SPConfiguration configuration = service.getConfiguration();
serviceBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(configuration.getSecurityDomain()));
if (verificationHandler != null) {
serviceBuilder.addListener(verificationHandler);
}
ServiceController<ServiceProviderService> controller = serviceBuilder.install();
if (newControllers != null) {
newControllers.add(controller);
}
}
Aggregations