Class: JettyRails::Adapters::RailsJmsAdapter
- Inherits:
-
RailsAdapter
- Object
- AbstractAdapter
- RailsAdapter
- JettyRails::Adapters::RailsJmsAdapter
- Defined in:
- lib/jetty_rails/adapters/rails_jms_adapter.rb
Overview
This adapter extends the standard Rails adapter with an additional listener for JMS queues
Constant Summary collapse
- @@defaults =
Defaults to expecting OpenMQ jars in lib_dir/jms_dir at startup
{ :jms_dir => "jms", :queue_name => "rails_queue", :mq_host => "localhost", :mq_port => 7676 }
Instance Attribute Summary
Attributes inherited from AbstractAdapter
Instance Method Summary collapse
- #event_listeners ⇒ Object
-
#initialize(config) ⇒ RailsJmsAdapter
constructor
A new instance of RailsJmsAdapter.
- #queue_manager_factory ⇒ Object
Methods inherited from RailsAdapter
Methods inherited from AbstractAdapter
Constructor Details
#initialize(config) ⇒ RailsJmsAdapter
Returns a new instance of RailsJmsAdapter.
16 17 18 19 |
# File 'lib/jetty_rails/adapters/rails_jms_adapter.rb', line 16 def initialize(config) super @@defaults.merge(config) require_jms_jars() end |
Instance Method Details
#event_listeners ⇒ Object
21 22 23 |
# File 'lib/jetty_rails/adapters/rails_jms_adapter.rb', line 21 def event_listeners super << Rack::JMS::QueueContextListener.new(queue_manager_factory()) end |
#queue_manager_factory ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/jetty_rails/adapters/rails_jms_adapter.rb', line 25 def queue_manager_factory factory = jndiless_default_queue_manager_factory_class() factory.queue_name = config[:queue_name] factory.mq_host = config[:mq_host] factory.mq_port = config[:mq_port] factory.new end |