moos.ssds.jms
Class PublisherComponent

java.lang.Object
  extended bymoos.ssds.jms.PublisherComponent

public class PublisherComponent
extends java.lang.Object

PublisherComponent provides an easy to use class that handles JMS publish-subscribe messaging. A PublisherComponent can publish to multiple topics. The goal of this is to povide messsaging without requiring the developer to use JMS api's

Usage:


Version:
: $Revision: 1.5 $

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement. This information should not be published or distributed to third parties without specific written permission from MBARI.


Copyright 2002 MBARI.
MBARI Proprietary Information. All rights reserved.



Author:
: $Author: kgomes $

Constructor Summary
PublisherComponent()
          This is the default constructor
PublisherComponent(java.lang.String topicName)
          This is a constructor that starts a connection to a JMS server
 
Method Summary
 void finalize()
          This is the finalize method that is run by the garbage collector just before destroying the object.
 java.lang.String getTopicname()
          Getter method to retrieve the name of the topic that this publisher is sending its messagest to
 boolean publish(java.io.Serializable obj)
          This is the method that the client will call when it is ready to publish a serialized object to a topic
 void setTopicname(java.lang.String topicName)
          This function specifies the topic name to publish to.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublisherComponent

public PublisherComponent(java.lang.String topicName)
This is a constructor that starts a connection to a JMS server

Parameters:
topicName - is a String that represents the JNDI name of the topic that this PublisherComponent will be sending messages to

PublisherComponent

public PublisherComponent()
This is the default constructor

Method Detail

publish

public boolean publish(java.io.Serializable obj)
This is the method that the client will call when it is ready to publish a serialized object to a topic

Parameters:
obj - This is the serialized object that will be published to the JMS topic
Returns:
A boolean to indicate if the publish was successful (true) or not (false)

setTopicname

public void setTopicname(java.lang.String topicName)
This function specifies the topic name to publish to. Calling this method will stop and restart the publisher with a new topic name.

Parameters:
topicName - The name of the JMS topic name to publish to

getTopicname

public java.lang.String getTopicname()
Getter method to retrieve the name of the topic that this publisher is sending its messagest to

Returns:
String that is the topic name of the topic this PublisherComponent is sending message to

finalize

public void finalize()
This is the finalize method that is run by the garbage collector just before destroying the object. It is used to clean up connections, etc.