public void closeNotification()
      throws SIResourceException, SIConnectionLostException,
             SIErrorException, SIConnectionDroppedException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "closeNotification");

      // Determine if we need to actually perform the close (we might already be closed).
      // This needs to be synchronized to avoid a race condition into close.      
      LinkedList<ProxyQueue> closeList = null;
      synchronized(this)
      {
         if (!closed)
         {
            // Mark ourself as closed.
            closed = true;
            
            // Make a copy of the map's values to avoid a concurrent modification
            // exception later.  Then clear the map.
            closeList = new LinkedList<ProxyQueue>();
            closeList.addAll(idToProxyQueueMap.values());
         } 
      }
      
      // If we actually carried out a close operation then closeList will
      // be non-null.
      if (closeList != null)
      {
         // Close each proxy queue in turn.  This is not synchronized with this
         // objects monitor to avoid the deadlock described above.
         SIException caughtException = null;
         Iterator iterator = closeList.iterator();
         while(iterator.hasNext())
         {
            ProxyQueue queue = (ProxyQueue)iterator.next();
            
            try
            {
               if (queue.getDestinationSessionProxy() instanceof ConsumerSessionProxy)
                  ((ConsumerSessionProxy)queue.getDestinationSessionProxy()).close(true);
               else
                  queue.getDestinationSessionProxy().close();
            }
            catch(SIException e)
            {
               // No FFDC code needed.
               caughtException = e;
            }
         }
         
         // If we caught an exception when closing one of the proxy queues, report it
         // by throwing an exception of our own, linking one of the exceptions we caught.         
         if (caughtException != null)
         {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "exception caught when closing queues");
            SIConnectionLostException closeException = new SIConnectionLostException(
               nls.getFormattedMessage("ERROR_CLOSING_PROXYQUEUE_GROUP_SICO1025", new Object[] {caughtException}, null) // d192293
            );
            closeException.initCause(caughtException);
            throw closeException;
         }         
      }
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "closeNotification");
	}
public void closeNotification ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "closeNotification" ) ; LinkedList < ProxyQueue > closeList = null ; synchronized ( this ) { if ( ! closed ) { closed = true ; closeList = new LinkedList < ProxyQueue > ( ) ; closeList . addAll ( idToProxyQueueMap . values ( ) ) ; } } if ( closeList != null ) { SIException caughtException = null ; Iterator iterator = closeList . iterator ( ) ; while ( iterator . hasNext ( ) ) { ProxyQueue queue = ( ProxyQueue ) iterator . next ( ) ; try { if ( queue . getDestinationSessionProxy ( ) instanceof ConsumerSessionProxy ) ( ( ConsumerSessionProxy ) queue . getDestinationSessionProxy ( ) ) . close ( true ) ; else queue . getDestinationSessionProxy ( ) . close ( ) ; } catch ( SIException e ) { caughtException = e ; } } if ( caughtException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "exception caught when closing queues" ) ; SIConnectionLostException closeException = new SIConnectionLostException ( nls . getFormattedMessage ( "ERROR_CLOSING_PROXYQUEUE_GROUP_SICO1025" , new Object [ ] { caughtException } , null ) ) ; closeException . initCause ( caughtException ) ; throw closeException ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "closeNotification" ) ; }
begin D179183