use of org.forgerock.openam.sts.soap.config.SoapSTSInstanceModule in project OpenAM by OpenRock.
the class SoapSTSInstancePublisherImpl method publishInstance.
private void publishInstance(SoapSTSInstanceConfig instanceConfig) throws STSPublishException {
Injector injector;
try {
injector = SoapSTSInjectorHolder.getInstance(Key.get(Injector.class)).createChildInjector(new SoapSTSInstanceModule(instanceConfig));
final Server server = soapSTSInstanceLifecycleManager.exposeSTSInstanceAsWebService(injector.getInstance(Key.get(new TypeLiteral<Map<String, Object>>() {
}, Names.named(AMSTSConstants.STS_WEB_SERVICE_PROPERTIES))), injector.getInstance(SecurityTokenServiceProvider.class), instanceConfig);
publishedAndExposedInstances.put(instanceConfig.getDeploymentSubPath(), new ConfigAndServerHolder(instanceConfig, server));
//TODO: add the sts element, or whatever is exposed in web.xml to the log message?
logger.info("The following soap-sts instance has been successfully exposed at " + instanceConfig.getDeploymentSubPath() + ":\n" + instanceConfig);
} catch (Exception e) {
throw new STSPublishException(ResourceException.INTERNAL_ERROR, "Could not create injector corresponding to the " + "to-be-published instance " + instanceConfig.getDeploymentSubPath() + "; The exception: " + e, e);
}
}
Aggregations