Class: RedStorm::SimpleTopology::SpoutDefinition

Inherits:
ComponentDefinition show all
Defined in:
lib/red_storm/simple_topology.rb

Instance Attribute Summary

Attributes inherited from ComponentDefinition

#clazz, #constructor_args, #id, #parallelism

Attributes inherited from Configurator

#config

Instance Method Summary collapse

Methods inherited from ComponentDefinition

#initialize, #is_java?, #output_fields

Methods inherited from Configurator

#initialize, #method_missing, #set

Constructor Details

This class inherits a constructor from RedStorm::SimpleTopology::ComponentDefinition

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RedStorm::Configurator

Instance Method Details

#new_instance(base_class_path) ⇒ Object

WARNING non-dry see BoltDefinition#new_instance



41
42
43
44
45
46
47
48
49
50
# File 'lib/red_storm/simple_topology.rb', line 41

def new_instance(base_class_path)
  if @clazz.name == "Java::RedstormStormJruby::JRubyShellSpout"
    @clazz.new(constructor_args, @output_fields)
  elsif is_java?
    @clazz.new(*constructor_args)
  else
    JRubySpout.new(base_class_path, @clazz.name, @output_fields)
  end
  # is_java? ? @clazz.new : JRubySpout.new(base_class_path, @clazz.name)
end