eu.semaine.jms
Class IOBase
java.lang.Object
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
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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:
- jms URL: read from system property
jms.url
, default value tcp://localhost:61616
;
- jms User: read from system property
jms.user
, default value null
;
- jms Password: read from system property
jms.password
, default value null
.
- 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 serverjmsUser
- 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.
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