/** * Pre suspend. Do nothing. * @param listener callback listener */ @Override public void preSuspend(ServerActivityCallback listener) { listener.done(); }
/** * Stops the service. Unregisters service activity and clears transaction listener. * @param context stop context */ public void stop(StopContext context) { final SuspendController suspendController = suspendControllerInjectedValue.getValue(); suspendController.unRegisterActivity(this); final LocalTransactionContext localTransactionContext = localTransactionContextInjectedValue.getValue(); localTransactionContext.removeCreationListener(this); }
@Override public void start(final StartContext context) throws StartException { final BatchEnvironment batchEnvironment = this.batchEnvironment = batchEnvironmentInjector.getValue(); // Get the class loader from the environment classLoader = batchEnvironment.getClassLoader(); suspendControllerInjector.getValue().registerActivity(serverActivity); }
@Override public void start(StartContext context) throws StartException { suspendControllerInjectedValue.getValue().registerActivity(suspendListener); if(suspendControllerInjectedValue.getValue().getState() == SuspendController.State.RUNNING) { defaultHandler.setSuspended(false); } else { defaultHandler.setSuspended(true); } ControlledProcessStateService controlledProcessStateService = controlledProcessStateServiceInjectedValue.getValue(); //may be null for tests if(controlledProcessStateService != null && controlledProcessStateService.getCurrentState() == ControlledProcessState.State.STARTING) { gateHandlerWrapper = new GateHandlerWrapper(queueRequestsOnStart ? -1 : defaultResponseCode); controlledProcessStateService.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { controlledProcessStateService.removePropertyChangeListener(this); if(gateHandlerWrapper != null) { gateHandlerWrapper.open(); gateHandlerWrapper = null; } rootHandler = null; } }); } server.getValue().registerHost(this); UndertowLogger.ROOT_LOGGER.hostStarting(name); }
@Override public void preSuspend(ServerActivityCallback listener) { synchronized (MessageDrivenComponent.this) { if (deliveryActive) { deactivate(); } } listener.done(); }
public synchronized void stop(StopContext context) { suspendControllerInjector.getValue().unRegisterActivity(recoverySuspendController); try { recoveryManagerService.stop(); } catch (Exception e) { // todo log } recoveryManagerService.destroy(); recoveryManagerService = null; recoverySuspendController = null; }
/** * Starts the service. Registers server activity, sets transaction listener on local transaction context, and creates and * installs deployment controller service. * * @param context start context */ public void start(StartContext context) { final SuspendController suspendController = suspendControllerInjectedValue.getValue(); suspendController.registerActivity(this); final LocalTransactionContext localTransactionContext = localTransactionContextInjectedValue.getValue(); localTransactionContext.registerCreationListener(this); }
@Override public void suspended(ServerActivityCallback listener) { listener.done(); }
@Override public void done() { synchronized (this) { if (this.deliveryActive) { this.deactivate(); } this.started = false; } if (this.pool != null) { this.pool.stop(); } suspendController.unRegisterActivity(serverActivity); super.done(); }
@Override public void init() { if (endpoint == null) { throw EjbLogger.ROOT_LOGGER.endpointUnAvailable(this.getComponentName()); } super.init(); suspendController.registerActivity(serverActivity); if (this.pool != null) { this.pool.start(); } }
@Override public void suspended(ServerActivityCallback serverActivityCallback) { serverActivityCallback.done(); }
@Override public void stop(final StopContext context) { // Remove the server activity suspendControllerInjector.getValue().unRegisterActivity(serverActivity); final ExecutorService service = executorInjector.getValue(); final Runnable task = () -> { // Should already be stopped, but just to be safe we'll make one more attempt serverActivity.stopRunningJobs(false); batchEnvironment = null; classLoader = null; context.complete(); }; try { service.execute(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } }
suspendControllerInjector.getValue().registerActivity(recoverySuspendController);
public void suspended(ServerActivityCallback listener) { suspended = true; listener.done(); }
@Override public void stop(StopContext context) { server.getValue().unregisterHost(this); pathHandler.clearPaths(); if(gateHandlerWrapper != null) { gateHandlerWrapper.open(); gateHandlerWrapper = null; } UndertowLogger.ROOT_LOGGER.hostStopping(name); suspendControllerInjectedValue.getValue().unRegisterActivity(suspendListener); }
@Override public void preSuspend(final ServerActivityCallback serverActivityCallback) { serverActivityCallback.done(); }
@Override public void preSuspend(ServerActivityCallback serverActivityCallback) { recoveryManagerService.suspend(); serverActivityCallback.done(); }
@Override public void preSuspend(ServerActivityCallback listener) { defaultHandler.setSuspended(true); listener.done(); }
@Override public void suspended(final ServerActivityCallback serverActivityCallback) { try { stopRunningJobs(isRestartOnResume()); } finally { serverActivityCallback.done(); } }
/** * Completes suspension: stop deployment controller. */ private void doneSuspended() { final ServerActivityCallback oldListener = listener; if (oldListener != null && listenerUpdater.compareAndSet(this, oldListener, null)) { deploymentRepositoryInjectedValue.getValue().suspend(); oldListener.done(); EjbLogger.ROOT_LOGGER.suspensionComplete(); } }