code: @Override
    public final void onScopeDestruction (@Nonnull final IScope aScopeInDestruction) throws Exception
    {
      if (LOGGER.isDebugEnabled ())
        LOGGER.debug ("onScopeDestruction for '" + toString () + "' in scope " + aScopeInDestruction.toString ());
  
      // Check init state
      if (isInInstantiation ())
      {
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("Object currently in instantiation is now destroyed: " + toString ());
      }
      else
        if (!isInstantiated ())
        {
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("Object not instantiated is now destroyed: " + toString ());
        }
  
      // Check destruction state
      if (!isInPreDestruction ())
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("Object should be in pre destruction phase but is not: " + toString ());
      }
      if (isInDestruction ())
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("Object already in destruction is now destroyed again: " + toString ());
      }
      else
        if (isDestroyed ())
        {
          if (LOGGER.isErrorEnabled ())
            LOGGER.error ("Object already destroyed is now destroyed again: " + toString ());
        }
  
      setInDestruction (true);
      // Set after destruction is set to true
      setInPreDestruction (false);
  
      try
      {
        onDestroy (aScopeInDestruction);
      }
      finally
      {
        // Ensure scope is marked as "destroyed"
        setDestroyed (true);
  
        // Ensure field is reset even in case of an exception
        setInDestruction (false);
      }
    }
docs: /*
  Implementation of {@link IScopeDestructionAware}. Calls the protected
  {@link #onDestroy()} method.