Class: Backstage::Topic

Inherits:
Destination show all
Defined in:
lib/destinations/models/topic.rb

Instance Attribute Summary collapse

Attributes inherited from Destination

#enumerable_options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Destination

#app, #app_name, #available_actions, #browsable_message_count, #clear, #display_name, display_name, #each, #jms_destination, #jndi_name, #pause, #resume, #status, to_hash_attributes

Methods included from Resource

#association_chain, #available_actions, included, #resource, #to_hash

Methods included from HasMBean

#<=>, #full_name, included, #initialize, #mbean_info, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backstage::HasMBean

Instance Attribute Details

#consumer_topicObject

Returns the value of attribute consumer_topic.



19
20
21
# File 'lib/destinations/models/topic.rb', line 19

def consumer_topic
  @consumer_topic
end

Class Method Details

.filterObject



25
26
27
# File 'lib/destinations/models/topic.rb', line 25

def self.filter
  'org.hornetq:address="jms.topic.*",*,name="jms.topic.*",type=Queue' 
end

.jms_prefixObject



21
22
23
# File 'lib/destinations/models/topic.rb', line 21

def self.jms_prefix
  'jms.topic.'
end

Instance Method Details

#consumer_countObject



48
49
50
# File 'lib/destinations/models/topic.rb', line 48

def consumer_count
  consumer_topics.size
end

#consumer_topicsObject



29
30
31
32
33
34
35
36
# File 'lib/destinations/models/topic.rb', line 29

def consumer_topics
  unless @consumer_topics
    @consumer_topics = self.class.all( %Q{org.hornetq:address="#{name}",*,type=Queue} )
    @consumer_topics = @consumer_topics.reject { |t| t.full_name == full_name }
    @consumer_topics.each { |t| t.consumer_topic = true }
  end
  @consumer_topics
end