code: public void destroy() {
          // just for the case
          synchronized (this) {
              for (Destroyable destroyable : destroyListeners) {
                  try {
                      destroyable.preDestroy();
                  } catch (Exception ex) {
                      logger.error("Failed to properly destroy bean", ex);
                  }
              }
              destroyListeners.clear();
          }
      }
docs: Called on context shutdown to call all registered destroyable instances.
  By default called on jvm shutdown, but may be called manually to synchronise with
  some other container shutdown (e.g. web container)
  Safe to call many times, but all destroy instances will be processed only on first call.
  Thread safe.