protected List<PlatformLifecycleService> getPlatformServicesToStart(NodeConfiguration platformConfiguration) throws StartNodeException { return platformConfiguration.getLifecycleServices(); }
public List<TenantRestartHandler> executeBeforeServicesStart() throws RestartException { List<TenantRestartHandler> tenantRestartHandlers = platformServiceAccessor.getPlatformConfiguration().getTenantRestartHandlers(); for (TenantRestartHandler tenantRestartHandler : tenantRestartHandlers) { tenantRestartHandler.beforeServicesStart(platformServiceAccessor, tenantServiceAccessor); } return tenantRestartHandlers; }
final List<PlatformLifecycleService> otherServicesToStop = getPlatformServicesToStart(nodeConfiguration); final TechnicalLoggerService logger = platformAccessor.getTechnicalLoggerService(); if (nodeConfiguration.shouldStartScheduler()) { if (nodeConfiguration.shouldClearSessions()) { final TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenant.getId()); tenantServiceAccessor.getSessionService().deleteSessions();
void afterServicesStartOfRestartHandlersOfTenant(final PlatformServiceAccessor platformAccessor, final Map<STenant, List<TenantRestartHandler>> tenantRestartHandlersOfTenants) { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); if (platformConfiguration.shouldResumeElements()) { // Here get all elements that are not "finished" // * FlowNodes that have flag: stateExecuting to true: call execute on them (connectors were executing) // * Process instances with token count == 0 (either not started again or finishing) -> same thing connectors were executing // * transitions that are in state created: call execute on them // * flow node that are completed and not deleted : call execute to make it create transitions and so on // * all element that are in not stable state for (Entry<STenant, List<TenantRestartHandler>> tenantRestartHandlers : tenantRestartHandlersOfTenants.entrySet()) { TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenantRestartHandlers.getKey().getId()); new TenantRestarter(platformAccessor, tenantServiceAccessor).executeAfterServicesStart(tenantRestartHandlers.getValue()); } } }
void restartHandlersOfPlatform(final PlatformServiceAccessor platformAccessor) throws Exception { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); for (final RestartHandler restartHandler : platformConfiguration.getRestartHandlers()) { platformAccessor.getTransactionService().executeInTransaction(() -> { restartHandler.execute(); return null; }); } }
void startScheduler(final PlatformServiceAccessor platformAccessor, final List<STenant> tenants) throws SBonitaException, BonitaHomeNotSetException, BonitaHomeConfigurationException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); final SchedulerService schedulerService = platformAccessor.getSchedulerService(); if (platformConfiguration.shouldStartScheduler() && !schedulerService.isStarted()) { schedulerService.initializeScheduler(); addPlatformJobListeners(platformAccessor, schedulerService); addTenantJobListeners(platformAccessor, tenants, schedulerService); schedulerService.start(); } }
private void addPlatformJobListeners(final PlatformServiceAccessor platformAccessor, final SchedulerService schedulerService) throws SSchedulerException { PlatformJobListenerManager platformJobListenerManager = new PlatformJobListenerManager(schedulerService); platformJobListenerManager.registerListener(platformAccessor.getPlatformConfiguration().getJobListeners()); }
final List<PlatformLifecycleService> otherServicesToStop = getPlatformServicesToStart(nodeConfiguration); final TechnicalLoggerService logger = platformAccessor.getTechnicalLoggerService(); if (nodeConfiguration.shouldStartScheduler()) { if (nodeConfiguration.shouldClearSessions()) { final TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenant.getId()); tenantServiceAccessor.getSessionService().deleteSessions();
void afterServicesStartOfRestartHandlersOfTenant(final PlatformServiceAccessor platformAccessor, final Map<STenant, List<TenantRestartHandler>> tenantRestartHandlersOfTenants) { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); if (platformConfiguration.shouldResumeElements()) { // Here get all elements that are not "finished" // * FlowNodes that have flag: stateExecuting to true: call execute on them (connectors were executing) // * Process instances with token count == 0 (either not started again or finishing) -> same thing connectors were executing // * transitions that are in state created: call execute on them // * flow node that are completed and not deleted : call execute to make it create transitions and so on // * all element that are in not stable state for (Entry<STenant, List<TenantRestartHandler>> tenantRestartHandlers : tenantRestartHandlersOfTenants.entrySet()) { TenantServiceAccessor tenantServiceAccessor = platformAccessor.getTenantServiceAccessor(tenantRestartHandlers.getKey().getId()); new TenantRestarter(platformAccessor, tenantServiceAccessor).executeAfterServicesStart(tenantRestartHandlers.getValue()); } } }
void restartHandlersOfPlatform(final PlatformServiceAccessor platformAccessor) throws Exception { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); for (final RestartHandler restartHandler : platformConfiguration.getRestartHandlers()) { platformAccessor.getTransactionService().executeInTransaction(() -> { restartHandler.execute(); return null; }); } }
void startScheduler(final PlatformServiceAccessor platformAccessor, final List<STenant> tenants) throws SBonitaException, BonitaHomeNotSetException, BonitaHomeConfigurationException, IOException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); final SchedulerService schedulerService = platformAccessor.getSchedulerService(); if (platformConfiguration.shouldStartScheduler() && !schedulerService.isStarted()) { schedulerService.initializeScheduler(); addPlatformJobListeners(platformAccessor, schedulerService); addTenantJobListeners(platformAccessor, tenants, schedulerService); schedulerService.start(); } }
private void addPlatformJobListeners(final PlatformServiceAccessor platformAccessor, final SchedulerService schedulerService) throws SSchedulerException { PlatformJobListenerManager platformJobListenerManager = new PlatformJobListenerManager(schedulerService); platformJobListenerManager.registerListener(platformAccessor.getPlatformConfiguration().getJobListeners()); }
final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); Map<STenant, List<TenantRestartHandler>> restartHandlers = new HashMap<>(); if (platformConfiguration.shouldResumeElements()) {
public List<TenantRestartHandler> executeBeforeServicesStart() throws RestartException { List<TenantRestartHandler> tenantRestartHandlers = platformServiceAccessor.getPlatformConfiguration().getTenantRestartHandlers(); for (TenantRestartHandler tenantRestartHandler : tenantRestartHandlers) { tenantRestartHandler.beforeServicesStart(platformServiceAccessor, tenantServiceAccessor); } return tenantRestartHandlers; }
protected List<PlatformLifecycleService> getPlatformServicesToStart(NodeConfiguration platformConfiguration) throws StartNodeException { return platformConfiguration.getLifecycleServices(); }
final NodeConfiguration platformConfiguration = platformAccessor.getPlatformConfiguration(); Map<STenant, List<TenantRestartHandler>> restartHandlers = new HashMap<>(); if (platformConfiguration.shouldResumeElements()) {