public void suspend ( String id ) { TraceState ts = traceState . get ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Suspend trace state = " + ts + " id = " + id ) ; } if ( ts != null ) { setExpire ( ts ) ; try { suspendedStateLock . lock ( ) ; // Check if id already used if ( suspendedState . containsKey ( id ) && log . isLoggable ( Level . FINEST ) ) { log . finest ( "WARNING: Overwriting previous suspended trace state = " + suspendedState . get ( id ) + " id = " + id ) ; } suspendedState . put ( id , ts ) ; traceState . remove ( ) ; } finally { suspendedStateLock . unlock ( ) ; } } }
This method suspends any current trace state associated with this thread and associates it with the supplied id . This state can then be re - activated using the resume method .