cgl.narada.samples.jms
Class Chat

java.lang.Object
  extended by cgl.narada.samples.jms.Chat
All Implemented Interfaces:
MessageListener

public class Chat
extends Object
implements MessageListener

This program is a demonstration of the features support by the new JMS implementation and is adapted from the Chat example contained in O'Reilly's Java Message Service Book.


Constructor Summary
Chat(Properties connectionProperties, String transportType, String userName)
           
 
Method Summary
 void close()
           
 void initializeChatSession(TopicConnectionFactory conFactory, String username)
           
static void main(String[] args)
           
 void onMessage(Message message)
           
 void set(TopicConnection con, TopicSession pubSess, TopicSession subSess, TopicPublisher pub, String username)
           
 void startConnection()
           
 void stopConnection()
           
 void subscribe()
           
 void unsubscribe()
           
 void writeMessage(String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chat

public Chat(Properties connectionProperties,
            String transportType,
            String userName)
     throws Exception
Throws:
Exception
Method Detail

initializeChatSession

public void initializeChatSession(TopicConnectionFactory conFactory,
                                  String username)
                           throws Exception
Throws:
Exception

startConnection

public void startConnection()
                     throws JMSException
Throws:
JMSException

stopConnection

public void stopConnection()
                    throws JMSException
Throws:
JMSException

set

public void set(TopicConnection con,
                TopicSession pubSess,
                TopicSession subSess,
                TopicPublisher pub,
                String username)

onMessage

public void onMessage(Message message)
Specified by:
onMessage in interface MessageListener

writeMessage

public void writeMessage(String text)
                  throws JMSException
Throws:
JMSException

unsubscribe

public void unsubscribe()

subscribe

public void subscribe()

close

public void close()
           throws JMSException
Throws:
JMSException

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project