Module Core::Interfaces::ServiceProvider
In: core/interfaces.rb

The ServiceProviders are components that expose ‘services’ that other components of the application can use. Examples of providers:

  • Interfaceerator: provides services to convert XML strings to graphical

interface elements (through the classes in Core::Model::Support)

  • Multiverse: provides services to access the information stored in the

different universes loaded

  • Commands: provides services to access user defined commands

ServiceProvider implementations are located in the Core::ServiceProvider module

Methods

Public Class methods

Service providers must take a variety of configuration parameters, for instance a :controller will point to the instantiatin controller and can be used by the provider to request services from other providers

[Source]

# File core/interfaces.rb, line 134
      def initialize(params={}) raise 'unimplemented!' end

Public Instance methods

Retrieve information of a specific service, this information includes a description and probably syntax specifications so the Controller can perform input validation before the request is transfered to the provider

[Source]

# File core/interfaces.rb, line 153
      def get_service_info(service_key) raise 'unimplemented!' end

Retrieve a list of all the services provided by this provider. The list consists of an array of service_key elements. This will be used by the Controller when a request for service is made to locate the right ServiceProvider to supply it.

[Source]

# File core/interfaces.rb, line 140
      def get_service_list()
        services = []
        self.public_methods.each do |method|
          next unless method =~ /^service_/
          services << $'.to_sym
        end
        return services
      end

Request a service to this provider. A service key and arguments for the service are accepted.

[Source]

# File core/interfaces.rb, line 157
      def request_service(key, *args)
        method = "service_#{key}"
        self.send(method, *args)
      end

[Validate]