private synchronized void removeChainInternal ( ChainData chaindata ) { String chainName = chaindata . getName ( ) ; ChainData [ ] chains = null ; for ( String groupName : chainGroups . keySet ( ) ) { chains = chainGroups . get ( groupName ) . getChains ( ) ; int j = 0 ; for ( ; j < chains . length ; j ++ ) { if ( chainName . equals ( chains [ j ] . getName ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Removing chain from chain group, " + groupName ) ; } break ; // out of for } } // If the chain was removed from this group, update the group. if ( j < chains . length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Updating chain group with new chain config list, " + groupName ) ; } ChainData [ ] newChains = new ChainData [ chains . length - 1 ] ; // copy chains listed before this one... int k = 0 ; for ( ; k < j ; k ++ ) { newChains [ k ] = chains [ k ] ; } // copy chains listed after this one... for ( ++ j ; j < chains . length ; k ++ , j ++ ) { newChains [ k ] = chains [ j ] ; } chainGroups . put ( groupName , createChainGroupData ( groupName , newChains ) ) ; } } // Remove the chain configuration. chainDataMap . remove ( chainName ) ; }
Remove the chain from the framework and disconnect it from any groups that contain it .