@AvailableWhenTenantIsPaused protected void pauseServicesForTenant(final PlatformServiceAccessor platformServiceAccessor, final long tenantId) throws UpdateException { // clustered services try { pauseScheduler(platformServiceAccessor, tenantId); deleteSessionsOfTenantExceptTechnicalUser(platformServiceAccessor, tenantId); // on all nodes setTenantClassloaderAndUpdateStateOfTenantServicesWithLifecycle(platformServiceAccessor, tenantId, new PauseServiceStrategy()); } catch (final SSchedulerException e) { throw new UpdateException("Unable to pause the scheduler.", e); } }
@AvailableWhenTenantIsPaused protected void pauseServicesForTenant(final PlatformServiceAccessor platformServiceAccessor, final long tenantId) throws UpdateException { // clustered services try { pauseScheduler(platformServiceAccessor, tenantId); deleteSessionsOfTenantExceptTechnicalUser(platformServiceAccessor, tenantId); // on all nodes setTenantClassloaderAndUpdateStateOfTenantServicesWithLifecycle(platformServiceAccessor, tenantId, new PauseServiceStrategy()); } catch (final SSchedulerException e) { throw new UpdateException("Unable to pause the scheduler.", e); } }
private void resumeServicesForTenant(final PlatformServiceAccessor platformServiceAccessor, final long tenantId) throws UpdateException { // clustered services try { final TenantServiceAccessor tenantServiceAccessor = platformServiceAccessor.getTenantServiceAccessor(tenantId); TenantRestarter tenantRestarter = new TenantRestarter(platformServiceAccessor, tenantServiceAccessor); List<TenantRestartHandler> tenantRestartHandlers = tenantRestarter.executeBeforeServicesStart(); resumeScheduler(platformServiceAccessor, tenantId); // on all nodes setTenantClassloaderAndUpdateStateOfTenantServicesWithLifecycle(platformServiceAccessor, tenantId, new ResumeServiceStrategy()); tenantRestarter .executeAfterServicesStartAfterCurrentTransaction(tenantRestartHandlers); } catch (final RestartException e) { throw new UpdateException("Unable to resume all elements of the work service.", e); } catch (final SSchedulerException e) { throw new UpdateException("Unable to resume the scheduler.", e); } catch (STransactionNotFoundException e) { throw new UpdateException("Unable to resume the tenant restart handlers.", e); } }
private void resumeServicesForTenant(final PlatformServiceAccessor platformServiceAccessor, final long tenantId) throws UpdateException { // clustered services try { final TenantServiceAccessor tenantServiceAccessor = platformServiceAccessor.getTenantServiceAccessor(tenantId); TenantRestarter tenantRestarter = new TenantRestarter(platformServiceAccessor, tenantServiceAccessor); List<TenantRestartHandler> tenantRestartHandlers = tenantRestarter.executeBeforeServicesStart(); resumeScheduler(platformServiceAccessor, tenantId); // on all nodes setTenantClassloaderAndUpdateStateOfTenantServicesWithLifecycle(platformServiceAccessor, tenantId, new ResumeServiceStrategy()); tenantRestarter .executeAfterServicesStartAfterCurrentTransaction(tenantRestartHandlers); } catch (final RestartException e) { throw new UpdateException("Unable to resume all elements of the work service.", e); } catch (final SSchedulerException e) { throw new UpdateException("Unable to resume the scheduler.", e); } catch (STransactionNotFoundException e) { throw new UpdateException("Unable to resume the tenant restart handlers.", e); } }