/** {@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);
    }
  }