@Test public void healthCheck() { prepareExtension(); extension.init(kieServer, registry); List<Message> messages = extension.healthCheck(true); assertEquals(1, messages.size()); assertEquals(Severity.INFO, messages.get(0).getSeverity()); assertEquals(HEALTH_CHECK_IS_ALIVE_MESSAGE, messages.get(0).getMessages().iterator().next()); }
@Override public List<Message> healthCheck(boolean report) { List<Message> messages = KieServerExtension.super.healthCheck(report); try { Map<String, Object> params = new HashMap<>(); params.put(TO_TASK_ID, -1L); taskAssigningRuntimeServiceBase.executeFindTasksQuery(params); if (report) { messages.add(new Message(Severity.INFO, HEALTH_CHECK_IS_ALIVE_MESSAGE)); } } catch (Exception e) { messages.add(new Message(Severity.ERROR, String.format(HEALTH_CHECK_ERROR, e.getMessage()))); } return messages; }
TaskAssigningRuntimeKieServerExtension implements KieServerExtension { @Override public List<Message> healthCheck(boolean report) { List<Message> messages = KieServerExtension.super.healthCheck(report); try { Map<String, Object> params = new HashMap<>(); params.put(TO_TASK_ID, -1L); taskAssigningRuntimeServiceBase.executeFindTasksQuery(params); if (report) { messages.add(new Message(Severity.INFO, HEALTH_CHECK_IS_ALIVE_MESSAGE)); } } catch (Exception e) { messages.add(new Message(Severity.ERROR, String.format(HEALTH_CHECK_ERROR, e.getMessage()))); } return messages; } }
TaskAssigningRuntimeKieServerExtension implements KieServerExtension { @Override public List<Message> healthCheck(boolean report) { List<Message> messages = KieServerExtension.super.healthCheck(report); try { Map<String, Object> params = new HashMap<>(); params.put(TO_TASK_ID, -1L); taskAssigningRuntimeServiceBase.executeFindTasksQuery(params); if (report) { messages.add(new Message(Severity.INFO, HEALTH_CHECK_IS_ALIVE_MESSAGE)); } } catch (Exception e) { messages.add(new Message(Severity.ERROR, String.format(HEALTH_CHECK_ERROR, e.getMessage()))); } return messages; }  }
TaskAssigningRuntimeKieServerExtension implements KieServerExtension { @Override public List<Message> healthCheck(boolean report) { List<Message> messages = KieServerExtension.super.healthCheck(report); try { Map<String, Object> params = new HashMap<>(); params.put(TO_TASK_ID, -1L); taskAssigningRuntimeServiceBase.executeFindTasksQuery(params); if (report) { messages.add(new Message(Severity.INFO, HEALTH_CHECK_IS_ALIVE_MESSAGE)); } } catch (Exception e) { messages.add(new Message(Severity.ERROR, String.format(HEALTH_CHECK_ERROR, e.getMessage()))); } return messages; }  @Override boolean isInitialized(); @Override boolean isActive(); @Override void init(KieServerImpl kieServer, KieServerRegistry registry); @Override void destroy(KieServerImpl kieServer, KieServerRegistry registry); @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 List<Message> healthCheck(boolean report); }
TaskAssigningRuntimeKieServerExtension implements KieServerExtension { @Override public List<Message> healthCheck(boolean report) { List<Message> messages = KieServerExtension.super.healthCheck(report); try { Map<String, Object> params = new HashMap<>(); params.put(TO_TASK_ID, -1L); taskAssigningRuntimeServiceBase.executeFindTasksQuery(params); if (report) { messages.add(new Message(Severity.INFO, HEALTH_CHECK_IS_ALIVE_MESSAGE)); } } catch (Exception e) { messages.add(new Message(Severity.ERROR, String.format(HEALTH_CHECK_ERROR, e.getMessage()))); } return messages; }  @Override boolean isInitialized(); @Override boolean isActive(); @Override void init(KieServerImpl kieServer, KieServerRegistry registry); @Override void destroy(KieServerImpl kieServer, KieServerRegistry registry); @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 List<Message> healthCheck(boolean report); static final String EXTENSION_NAME; }