com::cosylab::acs::jms::ACSJMSTopicPublisher Class Reference

Inheritance diagram for com::cosylab::acs::jms::ACSJMSTopicPublisher:
Inheritance graph
[legend]
Collaboration diagram for com::cosylab::acs::jms::ACSJMSTopicPublisher:
Collaboration graph
[legend]

List of all members.

Classes

class  PublisherPoolItem

Public Member Functions

 ACSJMSTopicPublisher (Topic topic, ContainerServicesBase containerServices) throws JMSException
Topic getTopic () throws JMSException
void publish (Message message) throws JMSException
void publish (Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
void publish (Topic topic, Message message) throws JMSException
void publish (Topic topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
void close () throws JMSException
void send (Message message) throws JMSException

Private Attributes

String topicName

Static Private Attributes

static HashMap< String,
PublisherPoolItem
publishersPool = new HashMap<String, PublisherPoolItem>()

Detailed Description

To avoid creating a CorbaPublisher for each message to publish, an pool of CorbaPublisher has been introduced by means of a HashMap. The key of the HasMap is the name of the NC. To made the publisher reusable for all the topics, the HashMap is static.

The DefaultPublisherImpl instantiates an object of this class and publishes messages passing the topic i.e. it never calls the method without topic. In particular it calls:

For our point of view the two methods have the same functioning because we do not use the deliveryMode, priority and timeToLive at least for now ;-)

See also:
cern.cmw.mom.pubsub.impl.DefaultPublisherImpl
Author:
kzagar

Constructor & Destructor Documentation

com::cosylab::acs::jms::ACSJMSTopicPublisher::ACSJMSTopicPublisher ( Topic  topic,
ContainerServicesBase  containerServices 
) throws JMSException [inline]

Constructor

Parameters:
topic The topic to publish messages into
containerServices The container service
Exceptions:
JMSException In case of error building the SimpleSupplier

References com::cosylab::acs::jms::ACSJMSProducer::containerServices, publishersPool, and topicName.


Member Function Documentation

void com::cosylab::acs::jms::ACSJMSTopicPublisher::close (  )  throws JMSException [inline]
Topic com::cosylab::acs::jms::ACSJMSTopicPublisher::getTopic (  )  throws JMSException [inline]
void com::cosylab::acs::jms::ACSJMSTopicPublisher::publish ( Topic  topic,
Message  message,
int  deliveryMode,
int  priority,
long  timeToLive 
) throws JMSException [inline]
void com::cosylab::acs::jms::ACSJMSTopicPublisher::publish ( Topic  topic,
Message  message 
) throws JMSException [inline]
void com::cosylab::acs::jms::ACSJMSTopicPublisher::publish ( Message  message,
int  deliveryMode,
int  priority,
long  timeToLive 
) throws JMSException [inline]
void com::cosylab::acs::jms::ACSJMSTopicPublisher::publish ( Message  message  )  throws JMSException [inline]

Publish a message in the topic

The topic is the topic whose name has been passed in the constructor. However for this implementation there is no difference when the topic has been built because all the topics are in the pool. The name of the topic built in the constructor can be accessed through the topicName field.

See also:
javax.jms.TopicPublisher::publish(javax.jms.Message)

References publishersPool, com::cosylab::acs::jms::ACSJMSTopicPublisher::PublisherPoolItem::sendMessage(), and topicName.

Referenced by publish(), and send().

void com::cosylab::acs::jms::ACSJMSTopicPublisher::send ( Message  message  )  throws JMSException [inline]

References publish().


Member Data Documentation

HashMap<String, PublisherPoolItem> com::cosylab::acs::jms::ACSJMSTopicPublisher::publishersPool = new HashMap<String, PublisherPoolItem>() [static, private]

The publishers The key is the name of the NC (i.e. the name of the topic) The value is the SimpleSupplier

Referenced by ACSJMSTopicPublisher(), close(), and publish().

The name of the topic passed in the constructor

Referenced by ACSJMSTopicPublisher(), and publish().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2