Class: Pione::RuleEngine::RootHandler

Inherits:
FlowHandler show all
Defined in:
lib/pione/rule-engine/root-handler.rb

Overview

RootHandler is a special handler for RootRule.

Constant Summary

Constants included from Log::MessageLog

Log::MessageLog::MESSAGE_QUEUE

Instance Attribute Summary

Attributes inherited from BasicHandler

#base_location, #caller_id, #digest, #domain_id, #domain_location, #dry_run, #env, #inputs, #outputs, #package_id, #param_set, #plain_env, #rule_condition, #rule_definition, #rule_name

Instance Method Summary collapse

Methods inherited from FlowHandler

#copy_data_into_domain, #lift_output_data, #remove_data_from_domain, #remove_finished_tuple, #restore_data_tuples_from_domain_location, #touch_data_in_domain, #validate_outputs

Methods inherited from BasicHandler

#apply_touch_operation, #create_data_by_touch_operation, #eval_rule_condition, #find_outputs_from_space, #handle, #initialize, #make_location, #make_output_location, #make_output_tuple, #make_rule_process_record, #make_task_process_record, #publish_outputs, #setup_env, #show_outputs, #update_time_by_touch_operation, #write_data_null

Methods included from Log::MessageLog

#debug_message, #debug_message_begin, #debug_message_end, debug_mode, debug_mode=, debug_mode?, message, quiet_mode, quiet_mode=, quiet_mode?, #show, #user_message, #user_message_begin, #user_message_end

Methods included from TupleSpace::TupleSpaceInterface

#process_log, #processing_error, #set_tuple_space, tuple_space_operation, #tuple_space_server, #with_process_log

Constructor Details

This class inherits a constructor from Pione::RuleEngine::BasicHandler

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/pione/rule-engine/root-handler.rb', line 5

def execute
  # import initial input tuples from input domain
  @inputs.flatten.each {|input| copy_data_into_domain(input, @domain_id)}
  # execute the rule
  outputs = super
  # export outputs to output domain
  outputs.flatten.each {|output| copy_data_into_domain(output, '/output')}
  # substantiate symbolic links
  # substantiate_date

  return outputs
end

#substantiate_dateObject

Substantiate symbolic links to files.



19
20
21
22
23
24
25
# File 'lib/pione/rule-engine/root-handler.rb', line 19

def substantiate_date
  @outputs.flatten.compact.each do |output|
    if output.location.cached? and output.link?
      FileCache.get(output.location).turn(output.location)
    end
  end
end