System.out.println("Getting child");
   protected void maintainRelatives(Invocation invocation)   {                              //Get the InvocationHandler for this invocation      JMSInvocationHandler thisHandler = ((JMSMethodInvocation)invocation).getHandler();                   //We use a clone to avoid a deadlock where requests      //are made to close parent and child concurrently            Set clone = null;      Set children = thisHandler.getChildren();      synchronized (children)      {         clone = new HashSet(children);      }            // Cycle through the children this will do a depth      // first close      for (Iterator i = clone.iterator(); i.hasNext();)      {         JMSInvocationHandler childHandler = (JMSInvocationHandler) i.next();         System.out.println("Getting child");         Closeable child = (Closeable) childHandler.getDelegate();                      try         {            child.closing();            child.close();         }         catch (Throwable ignored)         {            // Add a log interceptor to the child if you want the error            ignored.printStackTrace();         }      }            // Remove from the parent      JMSInvocationHandler parentHandler = thisHandler.getParent();      if (parentHandler != null)          parentHandler.removeChild(thisHandler);   }