public boolean contextInfoRequired ( String eventType , long requestNumber ) { boolean needContextInfo = false ; List < ProbeExtension > probeExtnList = RequestProbeService . getProbeExtensions ( ) ; for ( int i = 0 ; i < probeExtnList . size ( ) ; i ++ ) { ProbeExtension probeExtension = probeExtnList . get ( i ) ; if ( requestNumber % probeExtension . getRequestSampleRate ( ) == 0 ) { if ( probeExtension . getContextInfoRequirement ( ) == ContextInfoRequirement . ALL_EVENTS ) { needContextInfo = true ; break ; } else if ( probeExtension . getContextInfoRequirement ( ) == ContextInfoRequirement . EVENTS_MATCHING_SPECIFIED_EVENT_TYPES && ( probeExtension . invokeForEventTypes ( ) == null || probeExtension . invokeForEventTypes ( ) . contains ( eventType ) ) ) { needContextInfo = true ; break ; } } } return needContextInfo ; }
This method will check if context information is required or not by processing through each active ProbeExtensions available in PE List