{ if (log.isTraceEnabled()) { log.trace("Closing..."); }
{
   public Object invoke(Invocation invocation) throws Throwable   {      String methodName = ((MethodInvocation) invocation).getMethod().getName();      boolean isClosing = methodName.equals("closing");      boolean isClose = methodName.equals("close");                  if (isClosing)      {                  if (checkClosingAlreadyDone())         {            return null;         }      }      else if (isClose)      {                  if (log.isTraceEnabled()) { log.trace("Closing..."); }         if(checkCloseAlreadyDone())         {            return null;         }      }      else      {         inuse();      }      if (isClosing)      {         maintainRelatives(invocation);      }      try      {         return invocation.invokeNext();      }      finally      {         if (isClosing)         {            closing();         }         else if (isClose)         {            closed();         }         else         {            done();         }      }   }