Class: TorqueBox::Service

Inherits:
Object
  • Object
show all
Defined in:
core/lib/torquebox/service.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) list



28
29
30
31
32
33
34
35
36
37
38
# File 'core/lib/torquebox/service.rb', line 28

def list
  prefix = service_prefix.canonical_name
  suffix = '.create'
  service_names = TorqueBox::MSC.service_names.select do |service_name|
    name = service_name.canonical_name
    name.start_with?(prefix) && name.end_with?(suffix)
  end
  service_names.map do |service_name|
    TorqueBox::MSC.get_service(service_name).value
  end
end

+ (Object) lookup(name)



63
64
65
66
67
# File 'core/lib/torquebox/service.rb', line 63

def lookup(name)
  service_name = service_prefix.append(name).append('create')
  service = TorqueBox::MSC.get_service(service_name)
  service.nil? ? nil : service.value
end

+ (Object) service_prefix



71
72
73
# File 'core/lib/torquebox/service.rb', line 71

def service_prefix
  TorqueBox::MSC.deployment_unit.service_name.append('service')
end