eu.semaine.jms
Class IOBase

java.lang.Object
  extended by eu.semaine.jms.IOBase
Direct Known Subclasses:
MetaMessenger, Receiver, Sender

public class IOBase
extends java.lang.Object

This class handles the low-level interaction with the JMS provider for the components of the SEMAINE system.

Author:
marc

Nested Class Summary
static class IOBase.Event
           
 
Field Summary
protected  javax.jms.Connection connection
           
protected  boolean isConnectionStarted
           
protected  java.lang.String jmsPassword
           
protected  java.lang.String jmsUrl
           
protected  java.lang.String jmsUser
           
protected  javax.jms.Session session
           
protected  javax.jms.Topic topic
           
protected  java.lang.String topicName
           
 
Constructor Summary
IOBase(java.lang.String topicName)
          Create a new JMS IOBase connection with the given topic on the default JMS server.
IOBase(java.lang.String jmsUrl, java.lang.String jmsUser, java.lang.String jmsPassword, java.lang.String topicName)
          Create a new JMS IOBase connection with the given topic on the given JMS server.
 
Method Summary
 javax.jms.Connection getConnection()
           
 java.lang.String getJMSUrl()
          Get the URL of the JMS server connected to.
 javax.jms.Session getSession()
           
 javax.jms.Topic getTopic()
           
 java.lang.String getTopicName()
          Get the name of the topic.
 void startConnection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmsUrl

protected java.lang.String jmsUrl

jmsUser

protected java.lang.String jmsUser

jmsPassword

protected java.lang.String jmsPassword

connection

protected javax.jms.Connection connection

session

protected javax.jms.Session session

topic

protected javax.jms.Topic topic

topicName

protected java.lang.String topicName

isConnectionStarted

protected boolean isConnectionStarted
Constructor Detail

IOBase

public IOBase(java.lang.String topicName)
       throws javax.jms.JMSException
Create a new JMS IOBase connection with the given topic on the default JMS server. The default JMS server is determined as follows:

Parameters:
topicName - the name of the topic to send to.
Throws:
javax.jms.JMSException
java.lang.NullPointerException - if any of the parameters jmsUrl or topicName are null.

IOBase

public IOBase(java.lang.String jmsUrl,
              java.lang.String jmsUser,
              java.lang.String jmsPassword,
              java.lang.String topicName)
       throws javax.jms.JMSException
Create a new JMS IOBase connection with the given topic on the given JMS server.

Parameters:
jmsUrl - the url where to contact the JMS server
jmsUser - the username to use (can be null)
jmsPassword - the password to use (can be null)
topicName - the name of the topic to send to.
Throws:
javax.jms.JMSException
java.lang.NullPointerException - if any of the parameters jmsUrl or topicName are null.
Method Detail

getTopicName

public java.lang.String getTopicName()
Get the name of the topic.

Returns:
a string containing the topic name.
Throws:
javax.jms.JMSException

getJMSUrl

public java.lang.String getJMSUrl()
Get the URL of the JMS server connected to.

Returns:
a string containing the url

getConnection

public javax.jms.Connection getConnection()

getSession

public javax.jms.Session getSession()

getTopic

public javax.jms.Topic getTopic()

startConnection

public void startConnection()
                     throws javax.jms.JMSException
Throws:
javax.jms.JMSException