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

cern::cmw::mom::pubsub::Publisher Interface Reference

Inheritance diagram for cern::cmw::mom::pubsub::Publisher:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void setExceptionListener (ExceptionListener listener)
void close ()
BytesMessage createBytesMessage () throws JMSException
MapMessage createMapMessage () throws JMSException
Message createMessage () throws JMSException
ObjectMessage createObjectMessage () throws JMSException
StreamMessage createStreamMessage () throws JMSException
TextMessage createTextMessage () throws JMSException
void publish (String topic, Message message) throws JMSException, NamingException
void publish (String topic, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException, NamingException

Detailed Description

Public interface. Provide methods to create and publish messages on topics. The standard JMS specified message types are supported :

Two kinds of exception are thrown :

This example shows a simple publication of a TextMessage on a topic:

<blockquote>

 try {
   Publisher p = PubSubFactory.publisher();
 } catch (MOMException momEx) { ... }
 // ...
 try {
   TextMessage msg = p.createTextMessage();
   msg.setText("This is the text");
   p.publish("CMW.DEVICES.PowerConverter.PC1.Current", msg);
   // ...
   p.close();
 }
 catch (JMSException jmsEx) { ... }
 catch (NamingException namingEx) { ... }
 </blockquote>

Version:
1.0 23 Jan 2001
Author:
Controls Middleware Project
See also:
PubSubFactory

Subscriber

cern.cmw.mom.mapping.MappingService


Member Function Documentation

void cern::cmw::mom::pubsub::Publisher::close  ) 
 

Close the publisher singleton instance and dealloacate any resource

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

BytesMessage cern::cmw::mom::pubsub::Publisher::createBytesMessage  )  throws JMSException
 

Create an instance of BytesMessage.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
BytesMessage the BytesMessage instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

MapMessage cern::cmw::mom::pubsub::Publisher::createMapMessage  )  throws JMSException
 

Create an instance of MapMessage.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
MapMessage the MapMessage instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

Message cern::cmw::mom::pubsub::Publisher::createMessage  )  throws JMSException
 

Create an instance of Message.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
Message the Message instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

ObjectMessage cern::cmw::mom::pubsub::Publisher::createObjectMessage  )  throws JMSException
 

Create an instance of ObjectMessage.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
ObjectMessage the ObjectMessage instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

StreamMessage cern::cmw::mom::pubsub::Publisher::createStreamMessage  )  throws JMSException
 

Create an instance of StreamMessage.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
StreamMessage the StreamMessage instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

TextMessage cern::cmw::mom::pubsub::Publisher::createTextMessage  )  throws JMSException
 

Create an instance of TextMessage.

Exceptions:
JMSException if JMS fails to create the message due to some internal JMS error.
Returns:
TextMessage the TextMessage instance

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

void cern::cmw::mom::pubsub::Publisher::publish String  topic,
Message  message,
int  deliveryMode,
int  priority,
long  timeToLive
throws JMSException, NamingException
 

Publish a message to the given topic.

Parameters:
topic The String representation of the topic
message The Message object to publish
deliveryMode The Message persistence (true, false)
priority The Message priority (0..9)
timeToLive The Message time to live (msec)
Exceptions:
JMSException if JMS fails to publish the message due to some internal JMS error.
NamingException if there is a violation in the namespace policy.

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

void cern::cmw::mom::pubsub::Publisher::publish String  topic,
Message  message
throws JMSException, NamingException
 

Publish a message to the given topic.

Parameters:
topic The String representation of the topic
message The Message object to publish
Exceptions:
JMSException if JMS fails to publish the message due to some internal JMS error.
NamingException if there is a violation in the namespace policy.

Implemented in cern::cmw::mom::pubsub::impl::DefaultPublisherImpl.

void cern::cmw::mom::pubsub::Publisher::setExceptionListener ExceptionListener  listener  ) 
 

Set the listener for exceptions handling

Parameters:
listener The exceptions listener


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