@ Override public boolean unregisterMonitor ( Object annotatedObject ) { // Clear the listener data if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "unregisteringMonitor = " + annotatedObject ) ; } Set < ProbeListener > listeners = removeListenersForMonitor ( annotatedObject ) ; if ( listeners == null ) { return false ; } // Remove the listeners associated with the inactive monitor and // find out which classes need to be transformed to remove stale probes Collection < Class < ? > > effectedClasses = processRemovedListeners ( listeners ) ; // Update the classes to remove dead probes (optional) if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "effectedClasses.size() = " + effectedClasses . size ( ) ) ; } this . transformer . instrumentWithProbes ( effectedClasses ) ; Set set = moduleInstanceToBundleMap . entrySet ( ) ; Iterator i = set . iterator ( ) ; while ( i . hasNext ( ) ) { Map . Entry mapE = ( Map . Entry ) i . next ( ) ; if ( mapE != null && mapE . getValue ( ) . equals ( annotatedObject . getClass ( ) . getName ( ) ) ) { PmiAbstractModule s = ( PmiAbstractModule ) mapE . getKey ( ) ; s . unregister ( ) ; } } return true ; }
Unregister the specified monitor . Unregistering a monitor may cause one or more probes to be deactivated and the associated classes retransformed .