Class: ManageEngine::APMObjectHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/agent/am_objectholder.rb

Constant Summary collapse

@@objects =
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def agent
  @agent
end

#agent_initializedObject

Returns the value of attribute agent_initialized.



18
19
20
# File 'lib/agent/am_objectholder.rb', line 18

def agent_initialized
  @agent_initialized
end

#collectorObject (readonly)

Returns the value of attribute collector.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def collector
  @collector
end

#configObject (readonly)

Returns the value of attribute config.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def config
  @config
end

#connectorObject (readonly)

Returns the value of attribute connector.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def connector
  @connector
end

#constantsObject (readonly)

Returns the value of attribute constants.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def constants
  @constants
end

#formatterObject

Returns the value of attribute formatter.



18
19
20
# File 'lib/agent/am_objectholder.rb', line 18

def formatter
  @formatter
end

#last_dispatch_timeObject

Returns the value of attribute last_dispatch_time.



18
19
20
# File 'lib/agent/am_objectholder.rb', line 18

def last_dispatch_time
  @last_dispatch_time
end

#logObject (readonly)

Returns the value of attribute log.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def log
  @log
end

#parserObject

Returns the value of attribute parser.



18
19
20
# File 'lib/agent/am_objectholder.rb', line 18

def parser
  @parser
end

#shutdownObject

Returns the value of attribute shutdown.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def shutdown
  @shutdown
end

#storeObject

Returns the value of attribute store.



18
19
20
# File 'lib/agent/am_objectholder.rb', line 18

def store
  @store
end

#txn_utilObject (readonly)

Returns the value of attribute txn_util.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def txn_util
  @txn_util
end

#utilObject (readonly)

Returns the value of attribute util.



17
18
19
# File 'lib/agent/am_objectholder.rb', line 17

def util
  @util
end

Class Method Details

.instanceObject



46
47
48
49
50
51
52
# File 'lib/agent/am_objectholder.rb', line 46

def self.instance
			if(@@objects==nil)
@@objects = ManageEngine::APMObjectHolder.new
@@objects.initializeObjects
			end
		return @@objects
end

Instance Method Details

#initializeObjectsObject

Don’t Change the Order of Initialize



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/agent/am_objectholder.rb', line 21

def initializeObjects
    begin
      @agent_initialized  =   false
      @shutdown       =   false
      @constants      =     ManageEngine::APMConstants.new
      @log        =     ManageEngine::APMLogger.new
      @util         =   ManageEngine::APMUtil.new
      @util.setLogger @log
      @config       =     ManageEngine::APMConfig.new
      @connector      =     ManageEngine::APMConnector.new
      @store        =   ManageEngine::APMMetricsStore.new
      @collector      =   ManageEngine::APMMetricsCollector.new
      @txn_util = ManageEngine::TransactionUtil.new
      @formatter      =     ManageEngine::APMMetricsFormatter.new
      @parser       =     ManageEngine::APMMetricsParser.new
      @agent        =     ManageEngine::APMAgent.new
      @last_dispatch_time =   @@objects.util.currenttimemillis
      @@objects.log.debug "[APMObjectHolder] [ All Objects Initialized ] "
    rescue Exception => e
      puts "Error initializing APM Insight Ruby agent. #{e.message}"
      @shutdown = true
      @agent_initialized = false
    end
end

#shutdownagentObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/agent/am_objectholder.rb', line 54

def shutdownagent
	###@agent_initialized=false
	#@shutdown = true
	#@constants = nil
	#@util = nil
	#@config = nil
	#@connector = nil
	#@store = nil
	#@collector=nil
	#@instrumenter = nil
	#@formatter = nil
	#@parser = nil
	#@agent = nil
	#@log.info "[ APMObjectHolder ][ All Objects deleted ] "
	#@log = nil
end