use of org.kie.server.services.impl.security.ElytronIdentityProvider in project droolsjbpm-integration by kiegroup.
the class KieServerImpl method init.
protected void init(StartupStrategy startupStrategy) {
logger.info("Selected startup strategy {}", startupStrategy);
for (KieServerStateRepository repo : serverStateRepos) {
if (repo.getClass().getSimpleName().equals(startupStrategy.getRepositoryType())) {
this.repository = repo;
break;
}
}
logger.info("Configured '{}' server state repository", this.repository.getClass().getSimpleName());
this.context = new KieServerRegistryImpl();
if (ElytronIdentityProvider.available()) {
this.context.registerIdentityProvider(new ElytronIdentityProvider());
} else {
this.context.registerIdentityProvider(new JACCIdentityProvider());
}
this.context.registerStateRepository(repository);
// load available container locators
ContainerLocatorProvider.get();
ContainerManager containerManager = getContainerManager();
KieServerState currentState = repository.load(KieServerEnvironment.getServerId());
// if there is an update we just need to store it again
if (updateMutableEnvironmentState(currentState)) {
repository.store(KieServerEnvironment.getServerId(), currentState);
}
List<KieServerExtension> extensions = sortKnownExtensions();
for (KieServerExtension extension : extensions) {
logger.trace("{} processing", extension);
if (!extension.isActive()) {
continue;
}
try {
extension.init(this, this.context);
this.context.registerServerExtension(extension);
if (extension.isInitialized()) {
logger.info("{} has been successfully registered as server extension", extension);
} else {
logger.warn("{} has not been registered as server extension", extension);
}
} catch (Exception e) {
serverMessages.add(new Message(Severity.ERROR, "Error when initializing server extension of type " + extension + " due to " + e.getMessage()));
logger.error("Error when initializing server extension of type {}", extension, e);
}
}
// start policy manager
policyManager = new PolicyManager();
policyManager.start(this, context);
kieServerActive.set(true);
eventSupport.fireBeforeServerStarted(this);
startTimestamp = System.currentTimeMillis();
startupStrategy.startup(this, containerManager, currentState, kieServerActive);
eventSupport.fireAfterServerStarted(this);
}
Aggregations