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

#instrumenterObject

Returns the value of attribute instrumenter.



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

def instrumenter
  @instrumenter
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

#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



40
41
42
43
44
45
46
# File 'lib/agent/am_objectholder.rb', line 40

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
# File 'lib/agent/am_objectholder.rb', line 21

def initializeObjects
	@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
	@instrumenter 		= 		ManageEngine::APMInstrumenter.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 ] "
end

#shutdownagentObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/agent/am_objectholder.rb', line 48

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