protected synchronized void close ( OutboundConnection connection ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , connection ) ; // Paranoia: Check that this connection believes that it belongs in this group. if ( connection . getConnectionData ( ) . getConnectionDataGroup ( ) != this ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "connection does not belong to this group" , connection . getConnectionData ( ) . getConnectionDataGroup ( ) ) ; throw new SIErrorException ( nls . getFormattedMessage ( "CONNDATAGROUP_INTERNAL_SICJ0062" , null , "CONNDATAGROUP_INTERNAL_SICJ0062" ) ) ; // D226223 } ConnectionData data ; boolean isNowIdle = false ; synchronized ( connectionData ) { data = connection . getConnectionData ( ) ; data . decrementUseCount ( ) ; if ( data . getUseCount ( ) == 0 ) { // If no one is using this connection, then remove it from our group and // add it to the idle pool. connectionData . remove ( data ) ; isNowIdle = true ; } } if ( isNowIdle ) { IdleConnectionPool . getInstance ( ) . add ( data . getConnection ( ) , groupEndpointDescriptor ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Close a conversation on the specified connection . The connection must be part of this group . If the connection has no more conversations left using it then it is added to the idle pool .