code: public void environmentStop(EnvironmentClassLoader loader)
    {
      Object resource = _resourceRef.get();
      if (resource == null)
        return;
      
      Method destroy = getStopMethod(resource.getClass());
  
      if (destroy == null)
        return;
      
      try {
        destroy.invoke(resource, (Object []) null);
      } catch (Throwable e) {
        log.log(Level.WARNING, e.toString(), e);
      }
    }
docs: Handles the case where a class loader is dropped.