Module: Droonga::Pluggable

Included in:
Collector, Distributor, Handler, InputAdapter, OutputAdapter
Defined in:
lib/droonga/pluggable.rb

Defined Under Namespace

Classes: UnknownPlugin

Instance Method Summary collapse

Instance Method Details

#process(command, *arguments) ⇒ Object

Raises:



40
41
42
43
44
45
46
47
48
# File 'lib/droonga/pluggable.rb', line 40

def process(command, *arguments)
  plugin = find_plugin(command)
  $log.trace("#{log_tag}: process: start: <#{command}>",
             :plugin => plugin.class)
  raise UnknownPlugin.new(command) if plugin.nil?
  plugin.process(command, *arguments)
  $log.trace("#{log_tag}: process: done: <#{command}>",
             :plugin => plugin.class)
end

#processable?(command) ⇒ Boolean

Returns:



36
37
38
# File 'lib/droonga/pluggable.rb', line 36

def processable?(command)
  not find_plugin(command).nil?
end

#shutdownObject



28
29
30
31
32
33
34
# File 'lib/droonga/pluggable.rb', line 28

def shutdown
  $log.trace("#{log_tag}: shutdown: plugin: start")
  @plugins.each do |plugin|
    plugin.shutdown
  end
  $log.trace("#{log_tag}: shutdown: plugin: done")
end