moos.ssds.jms
Class Subscriber

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

public class Subscriber
extends java.lang.Object

Author:
brian To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
protected  javax.naming.Context jndiContext
           
protected  javax.jms.Message message
           
protected  javax.jms.TopicConnection topicConnection
           
protected  javax.jms.TopicConnectionFactory topicConnectionFactory
           
protected  java.lang.String topicname
           
protected  javax.jms.TopicSession topicSession
           
protected  javax.jms.TopicSubscriber topicSubscriber
           
 
Constructor Summary
Subscriber(java.lang.String topicName, javax.jms.MessageListener messageListener)
          Constructor
 
Method Summary
 void close()
          Closes the topic connection.
 void connect()
           
 javax.jms.MessageListener getMessageListener()
          Accessor for the MessageListener
 java.lang.String getTopicname()
          Accessor for the topic name
 boolean isConnected()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topicname

protected java.lang.String topicname

jndiContext

protected javax.naming.Context jndiContext

topicConnectionFactory

protected javax.jms.TopicConnectionFactory topicConnectionFactory

topicSession

protected javax.jms.TopicSession topicSession

topicConnection

protected javax.jms.TopicConnection topicConnection

message

protected javax.jms.Message message

topicSubscriber

protected javax.jms.TopicSubscriber topicSubscriber
Constructor Detail

Subscriber

public Subscriber(java.lang.String topicName,
                  javax.jms.MessageListener messageListener)
Constructor

Parameters:
topicName - The name of the topic to subscribe to. For JBoss this needs to be "topic/someTopic" whereas most other J2EE servers would use "someTopic"
messageListener - The MessageListener to be used to handle the message.
Method Detail

getMessageListener

public javax.jms.MessageListener getMessageListener()
Accessor for the MessageListener

Returns:
The class used to process the messages recieved by this SubscriberComponent

getTopicname

public java.lang.String getTopicname()
Accessor for the topic name

Returns:
The topic name that this SubscriberComponent is subscribed to.

isConnected

public boolean isConnected()

connect

public void connect()

close

public void close()
Closes the topic connection. Should be called when the class is no longer used.