Update mcollective.init script according to OSCI-969
[packages/precise/mcollective.git] / lib / mcollective / connector / base.rb
1 module MCollective
2   # Connector plugins handle the communications with the middleware, you can provide your own to speak
3   # to something other than Stomp, your plugins must inherit from MCollective::Connector::Base and should
4   # provide the following methods:
5   #
6   # connect       - Creates a connection to the middleware, no arguments should get its parameters from the config
7   # receive       - Receive data from the middleware, should act like a blocking call only returning if/when data
8   #                 was received.  It should get data from all subscribed channels/topics.  Individual messages
9   #                 should be returned as MCollective::Request objects with the payload provided
10   # publish       - Takes a target and msg, should send the message to the supplied target topic or destination
11   # subscribe     - Adds a subscription to a specific message source
12   # unsubscribe   - Removes a subscription to a specific message source
13   # disconnect    - Disconnects from the middleware
14   #
15   # These methods are all that's needed for a new connector protocol and should hopefully be simple
16   # enough to not have tied us to Stomp.
17   module Connector
18     class Base
19       def self.inherited(klass)
20         PluginManager << {:type => "connector_plugin", :class => klass.to_s}
21       end
22     end
23   end
24 end