Sha256: f17e787a43aec47d83567b3073bcae082f14cf0c487f6c1f2bd6b7436ef16fdb

Contents?: true

Size: 1.62 KB

Versions: 22

Compression:

Stored size: 1.62 KB

Contents

require 'agent/handler/sequence_book'

module ManageEngine
  module Agent
    class TrackerHandler
      
      def self.invokeTracker tracker
        begin
          @obj = ManageEngine::APMObjectHolder.instance
          
          if !@obj.config.agent_enabled || tracker == nil
            return nil
          end
          
          seqBook = Thread.current[:apminsight]
          if seqBook != nil
            if seqBook.listenFlag == 1
              return nil
            end
          else
            seqBook = ::APMInsight::Agent::SequenceBook.new
            Thread.current[:apminsight] = seqBook
          end
          
          tracker = seqBook.attachTracker(tracker)
          
          return tracker
        rescue Exception=>ex
          # Logging to be done here, Not sure whether its safe to do
          if (@obj != nil)
            @obj.log.logException "[TrackerHandler] Exception occurred at invoketracker.", ex
          end
          return nil
        end
      end
      
      
      # Closes tracker properly and set everything ready to process next tracker
      # If roottracker closes, sequence book is cleaned and data are push to store
      def self.exitTracker tracker
        begin
          if tracker != nil
            seqBook = Thread.current[:apminsight]
            if seqBook != nil
              seqBook.closeTracker tracker
            end
          end
        rescue Exception=>ex
          if (@obj != nil)
            @obj.log.logException "[TrackerHandler] Exception occurred at exittracker.", ex
          end
        end
      end
      
    end # Class TrackerHandler
    
  end # module Agent
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
site24x7_apminsight-1.9.3 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.9.2 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.9.1 lib/agent/handler/tracker_handler.rb
apminsight-1.9.0 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.9.0 lib/agent/handler/tracker_handler.rb
apminsight-1.8.8 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.8 lib/agent/handler/tracker_handler.rb
apminsight-1.8.7 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.7 lib/agent/handler/tracker_handler.rb
apminsight-1.8.6 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.6 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.5.1 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.5 lib/agent/handler/tracker_handler.rb
apminsight-1.8.3 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.3 lib/agent/handler/tracker_handler.rb
apminsight-1.8.2 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.2 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.1 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.8.0 lib/agent/handler/tracker_handler.rb
site24x7_apminsight-1.7.3.0 lib/agent/handler/tracker_handler.rb