launchService(context, PathAddress.pathAddress(operation.get(ADDRESS)), model, verificationHandler, newControllers);
}
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());
SPConfiguration configuration = service.getConfiguration();
serviceBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(configuration.getSecurityDomain()));
if (verificationHandler != null) {
serviceBuilder.addListener(verificationHandler);