Class: Backstage::Service

Inherits:
Object show all
Includes:
HasMBean, Resource, TorqueBoxManaged
Defined in:
lib/services/models/service.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

#association_chain, included, #resource, #to_hash

Methods included from TorqueBoxManaged

#app, #app_name, #name, #status

Methods included from HasMBean

#<=>, #full_name, included, #initialize, #mbean_info, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backstage::HasMBean

Class Method Details

.filterObject



23
24
25
# File 'lib/services/models/service.rb', line 23

def self.filter
  "torquebox.services:*"
end

.to_hash_attributesObject



27
28
29
# File 'lib/services/models/service.rb', line 27

def self.to_hash_attributes
  super + [:name, :app, :app_name, :status]
end

Instance Method Details

#available_actionsObject



41
42
43
# File 'lib/services/models/service.rb', line 41

def available_actions
  status == 'Started' ? %w{ stop } : %w{ start }
end

#startObject



31
32
33
34
# File 'lib/services/models/service.rb', line 31

def start
  super
  self
end

#stopObject



36
37
38
39
# File 'lib/services/models/service.rb', line 36

def stop
  super
  self
end