public void notifySessionClosed(){
  if (LOGGER.isTraceEnabled())   LOGGER.logTrace(this + ": entering notifySessionClosed");
  boolean notifyOfClosedEvent=false;
synchronized (this) {
    boolean alreadyTerminated=isTerminated();
    Iterator<TransactionContext> it=allContexts.iterator();
    while (it.hasNext()) {
      TransactionContext b=(TransactionContext)it.next();
      if (LOGGER.isTraceEnabled())       LOGGER.logTrace(this + ": delegating session close to " + b);
      b.sessionClosed();
    }
    closed=true;
    if (isTerminated() && !alreadyTerminated)     notifyOfClosedEvent=true;
  }
  if (notifyOfClosedEvent) {
    if (LOGGER.isTraceEnabled())     LOGGER.logTrace(this + ": all contexts terminated, firing TerminatedEvent");
    fireTerminatedEvent();
  }
}

public void notifySessionClosed ( ) { if ( LOGGER . isTraceEnabled ( ) ) LOGGER . logTrace ( this + ": entering notifySessionClosed" ) ; boolean notifyOfClosedEvent = false ; synchronized ( this ) { boolean alreadyTerminated = isTerminated ( ) ; Iterator < TransactionContext > it = allContexts . iterator ( ) ; while ( it . hasNext ( ) ) { TransactionContext b = ( TransactionContext ) it . next ( ) ; if ( LOGGER . isTraceEnabled ( ) ) LOGGER . logTrace ( this + ": delegating session close to " + b ) ; b . sessionClosed ( ) ; } closed = true ; if ( isTerminated ( ) && ! alreadyTerminated ) notifyOfClosedEvent = true ; } if ( notifyOfClosedEvent ) { if ( LOGGER . isTraceEnabled ( ) ) LOGGER . logTrace ( this + ": all contexts terminated, firing TerminatedEvent" ) ; fireTerminatedEvent ( ) ; } }
notification that the session handle has been closed by the application .
