Class: LanGrove::Adaptor::Base
- Defined in:
- lib/langrove/adaptor/adaptor_base.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #connector(params, &block) ⇒ Object
-
#initialize(root, config, deamon_name) ⇒ Base
constructor
A new instance of Base.
- #listen(handler, protocol, server) ⇒ Object
- #reload ⇒ Object
- #reload_adaptor ⇒ Object
- #stop ⇒ Object
- #stop_adaptor ⇒ Object
- #validate_config ⇒ Object
- #validate_config_adaptor ⇒ Object
Methods inherited from Base
Constructor Details
Instance Method Details
#connector(params, &block) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 37 def connector( params, &block ) # # OVERRIDE # # To define the adaptor device to which clients # connect. # raise LanGrove::PluginException.new( "#{self.class}.connector() - missing implementation." ) end |
#listen(handler, protocol, server) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 91 def listen( handler, protocol, server ) connector( { :handler => handler, :protocol => protocol } ) do |connected_handler| # # A newly connected Handler # connected_handler.assign( { :root => @root, :handler => handler, :protocol => protocol, :server => server } ) connected_handler.start_handler end end |
#reload ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 17 def reload # # OVERRIDE # # Daemon has been called to HUP # end |
#reload_adaptor ⇒ Object
63 64 65 66 67 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 63 def reload_adaptor reload end |
#stop ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 7 def stop # # OVERRIDE # # Daemon has been called to stop # end |
#stop_adaptor ⇒ Object
57 58 59 60 61 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 57 def stop_adaptor stop end |
#validate_config ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 27 def validate_config # # OVERRIDE # @config end |
#validate_config_adaptor ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/langrove/adaptor/adaptor_base.rb', line 79 def validate_config_adaptor unless @config.nil? or @config[:plugin].nil? @config[:plugin] = @root.config.get_plugin_config( @config[:plugin] ) end validate_config end |