code: public void onShutdown(){
          if (instance==null) return;
          try {
              this.camelContext.stop();
          }
          catch (Exception ex) {
              logger.severeException(ex.getMessage(), ex);
          }
      }
docs: Method can be invoked when the server
  shuts down