newHandler.add(kv);
}
}
SAMLHandlerService service = new SAMLHandlerService(newHandler);
PathElement providerAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement();
ServiceTarget serviceTarget = context.getServiceTarget();
ServiceBuilder<SAMLHandlerService> serviceBuilder = serviceTarget.addService(createServiceName(providerAlias
.getValue(), pathAddress.getLastElement().getValue()), service);
ServiceName serviceName;
if (providerAlias.getKey().equals(IDENTITY_PROVIDER.getName())) {
serviceName = IdentityProviderService.createServiceName(providerAlias.getValue());
} else {
serviceName = ServiceProviderService.createServiceName(providerAlias.getValue());
}
serviceBuilder.addDependency(serviceName, EntityProviderService.class, service.getEntityProviderService());
if (verificationHandler != null) {
serviceBuilder.addListener(verificationHandler);
}