Module: JMS::QueueBrowser

Defined in:
lib/jms/queue_browser.rb

Overview

Interface javax.jms.QueueBrowser

Instance Method Summary collapse

Instance Method Details

#each(params = {}, &block) ⇒ Object

For each message on the queue call the supplied Proc

Raises:

  • (ArgumentError)


4
5
6
7
8
9
10
11
# File 'lib/jms/queue_browser.rb', line 4

def each(params={}, &block)
  raise(ArgumentError, 'JMS::QueueBrowser::each requires a code block to be executed for each message received') unless block

  e = self.getEnumeration
  while e.hasMoreElements
    block.call(e.nextElement)
  end
end