Refine search
@Override public void stop(final StopContext stopContext) { // The service stop can trigger the web app context destruction which involves blocking tasks like servlet context destruction, startup servlet // destruction lifecycles and such. Hence this needs to be done asynchronously to prevent the MSC threads from blocking stopContext.asynchronous(); serverExecutor.getValue().submit(new Runnable() { @Override public void run() { try { stopContext(); } finally { stopContext.complete(); } } }); }
@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(); } }
/** {@inheritDoc} */ public void stop(final StopContext context) { super.stop(context); if (SarLogger.ROOT_LOGGER.isTraceEnabled()) { SarLogger.ROOT_LOGGER.tracef("Stopping Service: %s", context.getController().getName()); } final Runnable task = new Runnable() { @Override public void run() { try { invokeLifecycleMethod(stopMethod, context); } catch (Exception e) { SarLogger.ROOT_LOGGER.error(SarLogger.ROOT_LOGGER.failedExecutingLegacyMethod("stop()"), e); } finally { context.complete(); } } }; try { executorSupplier.get().submit(task); } catch (RejectedExecutionException e) { task.run(); } finally { context.asynchronous(); } }
@Override public void stop(final StopContext context) { if (executorServicesConsumer != null) executorServicesConsumer.accept(null); if (executor != null) { context.asynchronous(); new Thread(() -> { super.shutdown(); executor = null; context.complete(); }).start(); } }
public void stop(final StopContext stopContext) { ExecutorService executorService = executor.getValue(); Runnable r = new Runnable() { @Override public void run() { try { stopService(); } finally { stopContext.complete(); } } }; try { executorService.execute(r); } catch (RejectedExecutionException e) { r.run(); } finally { stopContext.asynchronous(); } }
@Override public void stop(StopContext context) { if (IIOPLogger.ROOT_LOGGER.isDebugEnabled()) { IIOPLogger.ROOT_LOGGER.debugf("Stopping service %s", context.getController().getName().getCanonicalName()); } final SocketBinding socketBinding = iiopSocketBindingInjector.getOptionalValue(); final SocketBinding sslSocketBinding = iiopSSLSocketBindingInjector.getOptionalValue(); if (socketBinding != null) { socketBinding.getSocketBindings().getNamedRegistry().unregisterBinding(socketBinding.getName()); } if (sslSocketBinding != null) { sslSocketBinding.getSocketBindings().getNamedRegistry().unregisterBinding(sslSocketBinding.getName()); } // stop the ORB asynchronously. final ORBDestroyer destroyer = new ORBDestroyer(this.orb, context); try { executorInjector.getValue().execute(destroyer); } catch (RejectedExecutionException e) { destroyer.run(); } finally { context.asynchronous(); } }
protected void stopAsync(final StopContext context, final String deploymentName, final ServiceName serviceName) { ExecutorService executorService = getLifecycleExecutorService(); Runnable r = new Runnable() { @Override public void run() { try { DEPLOYMENT_CONNECTOR_LOGGER.debugf("Stopping service %s", serviceName); WritableServiceBasedNamingStore.pushOwner(serviceName); unregisterAll(deploymentName); } finally { WritableServiceBasedNamingStore.popOwner(); context.complete(); } } }; try { executorService.execute(r); } catch (RejectedExecutionException e) { r.run(); } finally { context.asynchronous(); } }
/** * Unbind the entry from the injected context. * * @param context The stop context */ public void stop(StopContext context) { final ServiceBasedNamingStore namingStore = namingStoreValue.getValue(); namingStore.remove(controller.getName()); ROOT_LOGGER.tracef("Unbound resource %s into naming store %s (service name %s)", name, namingStore, context.getController().getName()); }
@Override public void stop(StopContext context) { getIdentityProviderService().getValue().removeTrustedDomain(this.domainName); context.getController().setMode(ServiceController.Mode.REMOVE); }
public synchronized void stop(StopContext context) { log.debugf("Stopping Arquillian Test Runner"); try { if (jmxTestRunner != null) { jmxTestRunner.unregisterMBean(injectedMBeanServer.getValue()); } } catch (Exception ex) { log.errorf(ex, "Cannot stop Arquillian Test Runner"); } finally { context.getController().getServiceContainer().removeListener(listener); } }
@Override public void stop(StopContext context) { ROOT_LOGGER.debugf("stopped AdminObjectService %s", context.getController().getName()); }
public synchronized void stop(final StopContext context) { final String deploymentName = context.getController().getName().getSimpleName(); final String managementName = deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME); ServerLogger.DEPLOYMENT_LOGGER.stoppedDeployment(managementName, deploymentName, (int) (context.getElapsedTime() / 1000000L)); deploymentUnit = null; }
@Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { if(event == LifecycleEvent.REMOVED) { context.complete(); } } });
@Override public void stop( StopContext stopContext ) { //stop all the services which correspond to the inner stores ServiceContainer serviceContainer = stopContext.getController().getServiceContainer(); for (String storeName : nestedStoresValues.keySet()) { ServiceName serviceName = ModeShapeServiceNames.binaryStorageNestedServiceName(repositoryName, storeName); Service<?> service = serviceContainer.getService(serviceName).getService(); service.stop(stopContext); } } }
@Override public void stop(StopContext context) { this.stopContext = context; context.asynchronous(); worker.shutdown(); worker = null; }
@Override public void stop(StopContext context) { if(binderService.release()) { //we are the last user, it needs to shut down context.asynchronous(); sharedBindingController.addListener(new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { if(event == LifecycleEvent.REMOVED) { context.complete(); } } }); } }
protected void stopInternal(StopContext context) { if (getLifecycleState().isAfter(BeanState.DESCRIBED)) { InstancesService.removeInstance(context.getController().getServiceContainer(), getLifecycleState(), getBean()); removeCallbacks(true); removeCallbacks(false); } executeUninstalls(); }
@Override public synchronized void stop(StopContext context) { ServiceController<?> serviceController = context.getController(); LOGGER.tracef("Stopping: %s in mode %s", serviceController.getName(), serviceController.getMode()); resolver = null; }