code: @Override
    public final void onBeforeScopeDestruction (@Nonnull final IScope aScopeToBeDestroyed) throws Exception
    {
      if (LOGGER.isDebugEnabled ())
        LOGGER.debug ("onBeforeScopeDestruction for '" + toString () + "' in scope " + aScopeToBeDestroyed.toString ());
  
      // Check init state
      if (isInInstantiation ())
      {
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("Object currently in instantiation is destroyed soon: " + toString ());
      }
      else
        if (!isInstantiated ())
        {
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("Object not instantiated is destroyed soon: " + toString ());
        }
  
      // Check destruction state
      if (isInPreDestruction ())
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("Object already in pre destruction is destroyed soon again: " + toString ());
      }
      else
        if (isInDestruction ())
        {
          if (LOGGER.isErrorEnabled ())
            LOGGER.error ("Object already in destruction is destroyed soon again: " + toString ());
        }
        else
          if (isDestroyed ())
          {
            if (LOGGER.isErrorEnabled ())
              LOGGER.error ("Object already destroyed is destroyed soon again: " + toString ());
          }
  
      setInPreDestruction (true);
  
      onBeforeDestroy (aScopeToBeDestroyed);
  
      // do not reset PreDestruction - happens in onScopeDestruction
    }
docs: /*
  Implementation of {@link IScopeDestructionAware}. Calls the protected
  {@link #onBeforeDestroy()} method.