Exemplo n.º 1
0
  public void stop() {
    log.info("Stopping sample Axis2 server");
    try {
      listenerManager.stop();
      listenerManager.destroy();
      cfgCtx.cleanupContexts();

    } catch (AxisFault axisFault) {
      log.error("Error while shutting down the listener manager", axisFault);
    }
    started = false;
  }
  /** {@inheritDoc} */
  public void destroy() {

    try {
      // only if we have created the server
      if (serverConfigurationInformation.isCreateNewInstance()) {

        // destroy listener manager
        if (listenerManager != null) {
          listenerManager.destroy();
        }

        stopJmxAdapter();
        RMIRegistryController.getInstance().shutDown();

        // we need to call this method to clean the temp files we created.
        if (configurationContext != null) {
          configurationContext.terminate();
        }
      }
      initialized = false;
    } catch (Exception e) {
      log.error("Error stopping the Axis2 Based Server Environment", e);
    }
  }