Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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.

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

HashMap< String, PublisherPoolItempublishersPool = 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 CorbaPublisher


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)

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


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 CorbaPublisher

String com::cosylab::acs::jms::ACSJMSTopicPublisher::topicName [private]
 

The name of the topic passed in the constructor


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:10:10 2009 for ACS Java API by doxygen 1.3.8