Module: TorqueBox::Messaging::Backgroundable::Util Private
- Defined in:
- lib/torquebox/messaging/backgroundable.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .instance_methods_include?(klass, method) ⇒ Boolean private
- .methods_include?(methods, method) ⇒ Boolean private
- .private_instance_methods_include?(klass, method) ⇒ Boolean private
- .private_singleton_methods_include?(klass, method) ⇒ Boolean private
- .protected_instance_methods_include?(klass, method) ⇒ Boolean private
- .protected_singleton_methods_include?(klass, method) ⇒ Boolean private
- .publish_message(receiver, method, args, options = { }) ⇒ Object private
- .singleton_methods_include?(klass, method) ⇒ Boolean private
Class Method Details
.instance_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
227 228 229 230 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 227 def instance_methods_include?(klass, method) methods_include?(klass.instance_methods, method) || private_instance_methods_include?(klass, method) end |
.methods_include?(methods, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
240 241 242 243 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 240 def methods_include?(methods, method) method = (RUBY_VERSION =~ /^1\.8\./ ? method.to_s : method.to_sym) methods.include?(method) end |
.private_instance_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
232 233 234 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 232 def private_instance_methods_include?(klass, method) methods_include?(klass.private_instance_methods, method) end |
.private_singleton_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
219 220 221 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 219 def private_singleton_methods_include?(klass, method) methods_include?(klass.private_methods, method) end |
.protected_instance_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
236 237 238 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 236 def protected_instance_methods_include?(klass, method) methods_include?(klass.protected_instance_methods, method) end |
.protected_singleton_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
223 224 225 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 223 def protected_singleton_methods_include?(klass, method) methods_include?(klass.protected_methods, method) end |
.publish_message(receiver, method, args, options = { }) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 197 def (receiver, method, args, = { }) queue_name = Task.queue_name( "torquebox_backgroundable" ) queue = Queue.new( queue_name ) future = Future.new( queue ) [:encoding] = :marshal queue.publish( {:receiver => receiver, :future_id => future.correlation_id, :future_queue => queue_name, :future_ttl => [:future_ttl], :method => method, :args => args}, ) future rescue javax.jms.InvalidDestinationException => ex raise RuntimeError.new("The Backgroundable queue is not available. Did you disable it by setting its concurrency to 0?") end |
.singleton_methods_include?(klass, method) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
214 215 216 217 |
# File 'lib/torquebox/messaging/backgroundable.rb', line 214 def singleton_methods_include?(klass, method) methods_include?(klass.singleton_methods, method) || private_singleton_methods_include?(klass, method) end |