@Test public void initWithJbpmExtensionEnabled() { JbpmKieServerExtension jbpmExtension = mock(JbpmKieServerExtension.class); when(registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME)).thenReturn(jbpmExtension); enableExtension(); System.setProperty(TASK_ASSIGNING_USER_SYSTEM_NAME, USER_SYSTEM_NAME); extension.init(kieServer, registry); assertKieServerMessageWasAdded(Severity.WARN, addExtensionMessagePrefix(String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME)), 1, 0, false); }
@Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { LOGGER.debug("Initializing " + EXTENSION_NAME + " extension."); this.kieServer = kieServer; this.registry = registry; KieServerExtension jbpmExtension = registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME); if (jbpmExtension != null) { String msg = String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME); LOGGER.warn(msg); kieServer.addServerMessage(new Message(Severity.WARN, addExtensionMessagePrefix(msg))); } initRuntimeClient(); try { validateAndSetSolverConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(SOLVER_CONFIGURATION_ERROR, e.getMessage()), e); } try { validateAndSetUserSystemServiceConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(USER_SYSTEM_CONFIGURATION_ERROR, e.getMessage()), e); } this.executorService = Executors.newScheduledThreadPool(4); try { this.taskAssigningService = createTaskAssigningService(readAndValidateTaskAssigningServiceConfig()); this.services.add(taskAssigningService); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(String.format(TASK_ASSIGNING_SERVICE_CONFIGURATION_ERROR, e.getMessage()), e)); } this.initialized = true; }
TaskAssigningPlanningKieServerExtension implements KieServerExtension { @Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { LOGGER.debug("Initializing " + EXTENSION_NAME + " extension."); this.kieServer = kieServer; this.registry = registry; KieServerExtension jbpmExtension = registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME); if (jbpmExtension != null) { String msg = String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME); LOGGER.warn(msg); kieServer.addServerMessage(new Message(Severity.WARN, addExtensionMessagePrefix(msg))); } initRuntimeClient(); try { validateAndSetSolverConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(SOLVER_CONFIGURATION_ERROR, e.getMessage()), e); } try { validateAndSetUserSystemServiceConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(USER_SYSTEM_CONFIGURATION_ERROR, e.getMessage()), e); } this.executorService = Executors.newScheduledThreadPool(4); try { this.taskAssigningService = createTaskAssigningService(readAndValidateTaskAssigningServiceConfig()); this.services.add(taskAssigningService); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(String.format(TASK_ASSIGNING_SERVICE_CONFIGURATION_ERROR, e.getMessage()), e)); } this.initialized = true; } }
TaskAssigningPlanningKieServerExtension implements KieServerExtension { @Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { LOGGER.debug("Initializing " + EXTENSION_NAME + " extension."); this.kieServer = kieServer; this.registry = registry; KieServerExtension jbpmExtension = registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME); if (jbpmExtension != null) { String msg = String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME); LOGGER.warn(msg); kieServer.addServerMessage(new Message(Severity.WARN, addExtensionMessagePrefix(msg))); } initRuntimeClient(); try { validateAndSetSolverConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(SOLVER_CONFIGURATION_ERROR, e.getMessage()), e); } try { validateAndSetUserSystemServiceConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(USER_SYSTEM_CONFIGURATION_ERROR, e.getMessage()), e); } this.executorService = Executors.newScheduledThreadPool(4); try { this.taskAssigningService = createTaskAssigningService(readAndValidateTaskAssigningServiceConfig()); this.services.add(taskAssigningService); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(String.format(TASK_ASSIGNING_SERVICE_CONFIGURATION_ERROR, e.getMessage()), e)); } this.initialized = true; }  }
TaskAssigningPlanningKieServerExtension implements KieServerExtension { @Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { LOGGER.debug("Initializing " + EXTENSION_NAME + " extension."); this.kieServer = kieServer; this.registry = registry; KieServerExtension jbpmExtension = registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME); if (jbpmExtension != null) { String msg = String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME); LOGGER.warn(msg); kieServer.addServerMessage(new Message(Severity.WARN, addExtensionMessagePrefix(msg))); } initRuntimeClient(); try { validateAndSetSolverConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(SOLVER_CONFIGURATION_ERROR, e.getMessage()), e); } try { validateAndSetUserSystemServiceConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(USER_SYSTEM_CONFIGURATION_ERROR, e.getMessage()), e); } this.executorService = Executors.newScheduledThreadPool(4); try { this.taskAssigningService = createTaskAssigningService(readAndValidateTaskAssigningServiceConfig()); this.services.add(taskAssigningService); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(String.format(TASK_ASSIGNING_SERVICE_CONFIGURATION_ERROR, e.getMessage()), e)); } this.initialized = true; }  @Override boolean isActive(); @Override void init(KieServerImpl kieServer, KieServerRegistry registry); @Override boolean isInitialized(); @Override void createContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override void updateContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override boolean isUpdateContainerAllowed(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override void disposeContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override List<Object> getAppComponents(SupportedTransports type); @Override T getAppComponents(Class<T> serviceType); @Override String getImplementedCapability(); @Override List<Object> getServices(); @Override String getExtensionName(); @Override Integer getStartOrder(); @Override String toString(); @Override void serverStarted(); @Override void destroy(KieServerImpl kieServer, KieServerRegistry registry); @Override List<Message> healthCheck(boolean report); }
TaskAssigningPlanningKieServerExtension implements KieServerExtension { @Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { LOGGER.debug("Initializing " + EXTENSION_NAME + " extension."); this.kieServer = kieServer; this.registry = registry; KieServerExtension jbpmExtension = registry.getServerExtension(JbpmKieServerExtension.EXTENSION_NAME); if (jbpmExtension != null) { String msg = String.format(UNDESIRED_EXTENSIONS_RUNNING_ERROR, JbpmKieServerExtension.EXTENSION_NAME); LOGGER.warn(msg); kieServer.addServerMessage(new Message(Severity.WARN, addExtensionMessagePrefix(msg))); } initRuntimeClient(); try { validateAndSetSolverConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(SOLVER_CONFIGURATION_ERROR, e.getMessage()), e); } try { validateAndSetUserSystemServiceConfiguration(); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(USER_SYSTEM_CONFIGURATION_ERROR, e.getMessage()), e); } this.executorService = Executors.newScheduledThreadPool(4); try { this.taskAssigningService = createTaskAssigningService(readAndValidateTaskAssigningServiceConfig()); this.services.add(taskAssigningService); } catch (TaskAssigningValidationException e) { throw new KieServicesException(String.format(String.format(TASK_ASSIGNING_SERVICE_CONFIGURATION_ERROR, e.getMessage()), e)); } this.initialized = true; }  @Override boolean isActive(); @Override void init(KieServerImpl kieServer, KieServerRegistry registry); @Override boolean isInitialized(); @Override void createContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override void updateContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override boolean isUpdateContainerAllowed(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override void disposeContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters); @Override List<Object> getAppComponents(SupportedTransports type); @Override T getAppComponents(Class<T> serviceType); @Override String getImplementedCapability(); @Override List<Object> getServices(); @Override String getExtensionName(); @Override Integer getStartOrder(); @Override String toString(); @Override void serverStarted(); @Override void destroy(KieServerImpl kieServer, KieServerRegistry registry); @Override List<Message> healthCheck(boolean report);  }