public static int forceCleanup ( Thread t ) { int i = 0 ; for ( Map . Entry < ConnectionPool , Set < ConnPair > > e : conns . entrySet ( ) ) { for ( ConnPair c : e . getValue ( ) ) { if ( c . thread . equals ( t ) ) { try { // This will in turn remove it from the static Map. c . conn . getHandler ( ) . invoke ( c . conn , Connection . class . getMethod ( "close" ) , null ) ; } catch ( Throwable e1 ) { e1 . printStackTrace ( ) ; } i ++ ; } } } return i ; }
Called by the engine to trigger the cleanup at the end of a payload thread .