class Fluent::Plugin::Base

Constants

State

Attributes

under_plugin_development[RW]

Public Class Methods

new() click to toggle source
Calls superclass method Fluent::Configurable.new
# File lib/fluent/plugin/base.rb, line 31
def initialize
  super
  @_state = State.new(false, false, false, false, false, false, false, false, false)
  @under_plugin_development = false
end

Public Instance Methods

after_shutdown() click to toggle source
# File lib/fluent/plugin/base.rb, line 73
def after_shutdown
  @_state.after_shutdown = true
  self
end
after_shutdown?() click to toggle source
# File lib/fluent/plugin/base.rb, line 112
def after_shutdown?
  @_state.after_shutdown
end
after_start() click to toggle source
# File lib/fluent/plugin/base.rb, line 53
def after_start
  @_state.after_start = true
  self
end
after_started?() click to toggle source
# File lib/fluent/plugin/base.rb, line 96
def after_started?
  @_state.after_start
end
before_shutdown() click to toggle source
# File lib/fluent/plugin/base.rb, line 63
def before_shutdown
  @_state.before_shutdown = true
  self
end
before_shutdown?() click to toggle source
# File lib/fluent/plugin/base.rb, line 104
def before_shutdown?
  @_state.before_shutdown
end
close() click to toggle source
# File lib/fluent/plugin/base.rb, line 78
def close
  @_state.close = true
  self
end
closed?() click to toggle source
# File lib/fluent/plugin/base.rb, line 116
def closed?
  @_state.close
end
configure(conf) click to toggle source
Calls superclass method Fluent::Configurable#configure
# File lib/fluent/plugin/base.rb, line 41
def configure(conf)
  super
  @_state ||= State.new(false, false, false, false, false, false, false, false, false)
  @_state.configure = true
  self
end
configured?() click to toggle source
# File lib/fluent/plugin/base.rb, line 88
def configured?
  @_state.configure
end
has_router?() click to toggle source
# File lib/fluent/plugin/base.rb, line 37
def has_router?
  false
end
inspect() click to toggle source
# File lib/fluent/plugin/base.rb, line 124
def inspect
  # Plugin instances are sometimes too big to dump because it may have too many thins (buffer,storage, ...)
  # Original commit comment says that:
  #   To emulate normal inspect behavior `ruby -e'o=Object.new;p o;p (o.__id__<<1).to_s(16)'`.
  #   https://github.com/ruby/ruby/blob/trunk/gc.c#L788
  "#<%s:%014x>" % [self.class.name, '0x%014x' % (__id__ << 1)]
end
shutdown() click to toggle source
# File lib/fluent/plugin/base.rb, line 68
def shutdown
  @_state.shutdown = true
  self
end
shutdown?() click to toggle source
# File lib/fluent/plugin/base.rb, line 108
def shutdown?
  @_state.shutdown
end
start() click to toggle source
# File lib/fluent/plugin/base.rb, line 48
def start
  @_state.start = true
  self
end
started?() click to toggle source
# File lib/fluent/plugin/base.rb, line 92
def started?
  @_state.start
end
stop() click to toggle source
# File lib/fluent/plugin/base.rb, line 58
def stop
  @_state.stop = true
  self
end
stopped?() click to toggle source
# File lib/fluent/plugin/base.rb, line 100
def stopped?
  @_state.stop
end
terminate() click to toggle source
# File lib/fluent/plugin/base.rb, line 83
def terminate
  @_state.terminate = true
  self
end
terminated?() click to toggle source
# File lib/fluent/plugin/base.rb, line 120
def terminated?
  @_state.terminate
end