public void start(NonStopConfiguration configuration) {
    nonStopConfigManager.registerForThread(configuration);

    if (configuration.isEnabled()) {
      nonStopManager.begin(configuration.getTimeoutMillis());
    }
  }
  public void stop() {
    NonStopConfiguration configuration = nonStopConfigManager.deregisterForThread();

    if (configuration != null && configuration.isEnabled()) {
      nonStopManager.finish();
    }
  }
 @Override
 public void shutdown() {
   nonStopManager.shutdown();
   ToolkitInternal toolkit = null;
   try {
     toolkit = getInitializedToolkit();
   } catch (Exception e) {
     // Ignore if toolkit failed to initialize
   }
   if (toolkit != null) {
     toolkit.shutdown();
   }
   nonStopInitiailzationService.shutdown();
 }