Public Member Functions

cern.cmw.mom.pubsub.Publisher Interface Reference

Inheritance diagram for cern.cmw.mom.pubsub.Publisher:
cern.cmw.mom.pubsub.impl.DefaultPublisherImpl

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

Referenced by cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.close().

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
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
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
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
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
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
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.
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.
void cern.cmw.mom.pubsub.Publisher.setExceptionListener ( ExceptionListener  listener  ) 

Set the listener for exceptions handling

Parameters:
listener The exceptions listener

Referenced by cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy.AlarmSystemInterfaceProxy().


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties