Class: TorqueBox::Messaging::Commands::MessageProcessorHost
- Inherits:
-
Container::FoundationCommand
- Object
- Container::FoundationCommand
- TorqueBox::Messaging::Commands::MessageProcessorHost
- Defined in:
- lib/torquebox/messaging/commands/message_processor_host.rb
Instance Attribute Summary collapse
-
#deploy_files ⇒ Object
Returns the value of attribute deploy_files.
Instance Method Summary collapse
- #after_start(container) ⇒ Object
- #before_stop(container) ⇒ Object
- #configure(container) ⇒ Object
-
#initialize ⇒ MessageProcessorHost
constructor
A new instance of MessageProcessorHost.
- #parser_options(opts) ⇒ Object
Constructor Details
#initialize ⇒ MessageProcessorHost
Returns a new instance of MessageProcessorHost.
33 34 35 36 37 38 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 33 def initialize() super @deploy_files = [] @deployments = [] @naming_service = nil end |
Instance Attribute Details
#deploy_files ⇒ Object
Returns the value of attribute deploy_files.
32 33 34 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 32 def deploy_files @deploy_files end |
Instance Method Details
#after_start(container) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 47 def after_start(container) @deploy_files.each do |file| deployment = container.deploy( file ) unit = container.deployment_unit( deployment.name ) builder = TorqueBox::Messaging::MetaData::Builder.new() builder.evaluate_file( file ) builder.processors.each do |processor| org.torquebox.mc::AttachmentUtils.multipleAttach( unit, processor, processor.name ) end = org.torquebox.base.::RubyApplicationMetaData.new .setApplicationName( "none" ) .setEnvironmentName( ENV['TORQUEBOX_ENV'] || 'development' ) .setRoot( org.jboss.vfs::VFS.getChild( Dir.pwd ) ) unit.addAttachment( org.torquebox.base.::RubyApplicationMetaData.java_class, ) container.process_deployments(true) puts "deployed #{file}" @deployments << deployment end end |
#before_stop(container) ⇒ Object
67 68 69 70 71 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 67 def before_stop(container) @deployments.reverse.each do |deployment| container.undeploy( deployment ) end end |
#configure(container) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 40 def configure(container) TorqueBox::Naming.configure do |config| config.host = @naming_service end container.enable( TorqueBox::Messaging::MessageProcessorHost ) end |
#parser_options(opts) ⇒ Object
73 74 75 76 77 78 79 80 81 |
# File 'lib/torquebox/messaging/commands/message_processor_host.rb', line 73 def (opts) opts.on( '-d', '--deploy FILE', 'Deploy a message-processor configuration' ) do |file| @deploy_files << file end opts.on( '-n', '--naming HOST', 'External naming service connection' ) do |naming_service| @naming_service = naming_service end super( opts ) end |