Class: Wakame::Actions::ReloadService
- Inherits:
-
Wakame::Action
- Object
- Wakame::Action
- Wakame::Actions::ReloadService
- Defined in:
- lib/wakame/actions/reload_service.rb
Constant Summary
Constants included from AttributeHelper
AttributeHelper::CONVERT_CLASSES, AttributeHelper::PRIMITIVE_CLASSES
Instance Attribute Summary
Attributes inherited from Wakame::Action
Instance Method Summary collapse
-
#initialize(service_instance) ⇒ ReloadService
constructor
A new instance of ReloadService.
- #run ⇒ Object
Methods inherited from Wakame::Action
#actor_request, #agent_monitor, #all_subactions_complete?, #bind_triggered_rule, #flush_subactions, #master, #notes, #notify, #notify_queue, #on_canceled, #on_failed, #service_cluster, #status=, #subactions, #sync_actor_request, #trigger_action, #walk_subactions
Methods included from ThreadImmutable
#bind_thread, included, #target_thread, #target_thread?, #thread_check
Methods included from AttributeHelper
Constructor Details
#initialize(service_instance) ⇒ ReloadService
Returns a new instance of ReloadService.
4 5 6 |
# File 'lib/wakame/actions/reload_service.rb', line 4 def initialize(service_instance) @service_instance = service_instance end |
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wakame/actions/reload_service.rb', line 8 def run raise "Agent is not bound on this service : #{@service_instance}" if @service_instance.agent.nil? raise "The assigned agent for the service instance #{@service_instance.instance_id} is not online." unless @service_instance.agent.status == Service::Agent::STATUS_ONLINE # Skip to act when the service is having below status. #if @service_instance.status == Service::STATUS_STARTING || @service_instance.status == Service::STATUS_ONLINE # raise "Canceled as the service is being or already ONLINE: #{@service_instance.property}" #end master.send_agent_command(Packets::ServiceReload.new(@service_instance.instance_id), @service_instance.agent.agent_id) end |