use of org.kie.server.remote.rest.common.resource.KieServerRestImpl in project droolsjbpm-integration by kiegroup.
the class KieServerExecutor method addServerSingletonResources.
private void addServerSingletonResources() {
kieServer = new KieServerImpl();
kieServer.init();
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.setApplication(new Application());
deployment.getResources().add(new KieServerRestImpl(kieServer));
List<KieServerExtension> extensions = kieServer.getServerExtensions();
for (KieServerExtension extension : extensions) {
List<Object> components = extension.getAppComponents(SupportedTransports.REST);
deployment.getResources().addAll(components);
}
server.deploy(deployment);
}
use of org.kie.server.remote.rest.common.resource.KieServerRestImpl in project droolsjbpm-integration by kiegroup.
the class KieServerAutoConfiguration method kieServer.
@Bean(destroyMethod = "destroy")
@ConditionalOnMissingBean(name = "kieServer")
public KieServer kieServer(List<KieServerExtension> extensions, List<KieContainerResource> containers) {
System.setProperty(KieServerConstants.CFG_SB_CXF_PATH, cxfPath);
System.setProperty(KieServerConstants.KIE_SERVER_CONTROLLER, properties.getControllers());
System.setProperty(KieServerConstants.KIE_SERVER_LOCATION, properties.getLocation());
if (KieServerEnvironment.getServerId() == null) {
String serverName = properties.getServerName();
String serverId = properties.getServerId();
KieServerEnvironment.setServerId(serverId.toString());
KieServerEnvironment.setServerName(serverName);
}
logger.info("KieServer (id {} (name {})) started initialization process", KieServerEnvironment.getServerId(), KieServerEnvironment.getServerName());
if (properties.isClassPathContainer()) {
kieServer = new ImmutableSpringBootKieServerImpl(extensions, identityProvider, containers);
} else {
kieServer = new SpringBootKieServerImpl(extensions, identityProvider);
}
kieServer.init();
KieServerRestImpl kieServerResource = new KieServerRestImpl(kieServer);
this.endpoints = new ArrayList<>();
endpoints.add(kieServerResource);
// next add any resources from server extensions
List<KieServerExtension> activeExtensions = kieServer.getServerExtensions();
for (KieServerExtension extension : activeExtensions) {
LinkedHashSet<Object> resources = new LinkedHashSet<>(extension.getAppComponents(SupportedTransports.REST));
endpoints.addAll(resources);
}
logger.info("KieServer (id {}) started successfully", KieServerEnvironment.getServerId());
return kieServer;
}
Aggregations