public void shutdown() {
    logger.finest("Shutting down OperationService");

    invocationRegistry.shutdown();
    invocationMonitor.shutdown();
    operationExecutor.shutdown();
    asyncResponseHandler.shutdown();
    slowOperationDetector.shutdown();

    try {
      invocationMonitor.awaitTermination(TERMINATION_TIMEOUT_MILLIS);
    } catch (InterruptedException e) {
      // restore the interrupt.
      // todo: we need a better mechanism for dealing with interruption and waiting for termination
      Thread.currentThread().interrupt();
      EmptyStatement.ignore(e);
    }
  }
  public void start() {
    logger.finest("Starting OperationService");

    ManagedExecutorService asyncExecutor =
        nodeEngine
            .getExecutionService()
            .register(
                ExecutionService.ASYNC_EXECUTOR,
                Runtime.getRuntime().availableProcessors(),
                ASYNC_QUEUE_CAPACITY,
                ExecutorType.CONCRETE);

    this.invocationContext =
        new Invocation.Context(
            asyncExecutor,
            nodeEngine.getClusterService().getClusterClock(),
            nodeEngine.getClusterService(),
            node.connectionManager,
            node.nodeEngine.getExecutionService(),
            nodeEngine.getProperties().getMillis(OPERATION_CALL_TIMEOUT_MILLIS),
            invocationRegistry,
            invocationMonitor,
            nodeEngine.getLocalMember().getUuid(),
            nodeEngine.getLogger(Invocation.class),
            node,
            nodeEngine,
            nodeEngine.getPartitionService(),
            this,
            operationExecutor,
            retryCount,
            serializationService,
            nodeEngine.getThisAddress());

    invocationMonitor.start();
    operationExecutor.start();
    asyncResponseHandler.start();
    slowOperationDetector.start();
  }
 @Override
 public List<SlowOperationDTO> getSlowOperationDTOs() {
   return slowOperationDetector.getSlowOperationDTOs();
 }