

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>() |
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:
publish(Topic,Message) for Heartbeat, Category, clientspublish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) for SourcesFor 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 ;-)
| com::cosylab::acs::jms::ACSJMSTopicPublisher::ACSJMSTopicPublisher | ( | Topic | topic, | |
| ContainerServicesBase | containerServices | |||
| ) | throws JMSException [inline] |
Constructor
| topic | The topic to publish messages into | |
| containerServices | The container service |
| JMSException | In case of error building the SimpleSupplier |
References com::cosylab::acs::jms::ACSJMSProducer::containerServices, publishersPool, and topicName.
| 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.
References publishersPool, com::cosylab::acs::jms::ACSJMSTopicPublisher::PublisherPoolItem::sendMessage(), and topicName.
| void com::cosylab::acs::jms::ACSJMSTopicPublisher::send | ( | Message | message | ) | throws JMSException [inline] |
References publish().
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().
String com::cosylab::acs::jms::ACSJMSTopicPublisher::topicName [private] |
The name of the topic passed in the constructor
Referenced by ACSJMSTopicPublisher(), and publish().
1.6.2