|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.semaine.jms.IOBase
public class IOBase
This class handles the low-level interaction with the JMS provider for the components of the SEMAINE system.
Nested Class Summary | |
---|---|
static class |
IOBase.ConnectionStatus
|
static class |
IOBase.Event
|
Field Summary | |
---|---|
protected Connection |
connection
|
protected JMSException |
exception
|
protected boolean |
isConnectionStarted
|
protected java.lang.String |
jmsPassword
|
protected java.lang.String |
jmsUrl
|
protected java.lang.String |
jmsUser
|
protected Session |
session
|
protected 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 | |
---|---|
protected static Connection |
createConnection(java.lang.String serverUrl,
java.lang.String serverUser,
java.lang.String serverPassword)
Create a new Connection to a JMS server. |
Connection |
getConnection()
|
static Connection |
getConnection(java.lang.String serverUrl,
java.lang.String serverUser,
java.lang.String serverPassword,
IOBase iobase)
Get a Connection to a JMS server. |
static IOBase.ConnectionStatus |
getConnectionStatus(Connection c)
Try to determine the status of the connection. |
java.lang.String |
getJMSPassword()
Get the password used when connecting to the JMS server. |
java.lang.String |
getJMSUrl()
Get the URL of the JMS server connected to. |
java.lang.String |
getJMSUser()
Get the user name used when connecting to the JMS server. |
Session |
getSession()
|
Topic |
getTopic()
|
java.lang.String |
getTopicName()
Get the name of the topic. |
static boolean |
isEmbeddedBroker()
|
void |
startConnection()
|
static void |
useEmbeddedBroker()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String jmsUrl
protected java.lang.String jmsUser
protected java.lang.String jmsPassword
protected Connection connection
protected Session session
protected Topic topic
protected java.lang.String topicName
protected boolean isConnectionStarted
protected JMSException exception
Constructor Detail |
---|
public IOBase(java.lang.String topicName) throws JMSException
jms.url
, default value tcp://localhost:61616
;jms.user
, default value null
;jms.password
, default value null
.
topicName
- the name of the topic to send to.
JMSException
java.lang.NullPointerException
- if any of the parameters jmsUrl or topicName are null.public IOBase(java.lang.String jmsUrl, java.lang.String jmsUser, java.lang.String jmsPassword, java.lang.String topicName) throws JMSException
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.
JMSException
java.lang.NullPointerException
- if any of the parameters jmsUrl or topicName are null.Method Detail |
---|
public static void useEmbeddedBroker() throws java.lang.Exception
java.lang.Exception
public static boolean isEmbeddedBroker()
public static Connection getConnection(java.lang.String serverUrl, java.lang.String serverUser, java.lang.String serverPassword, IOBase iobase) throws JMSException
serverUrl
- the server url, e.g. "tcp://localhost:61616"serverUser
- the user name, or nullserverPassword
- the password, or nulliobase
- an iobase object that wants to be notified if an exception occurs, or null.
JMSException
- if the connection cannot be created for some reason.protected static Connection createConnection(java.lang.String serverUrl, java.lang.String serverUser, java.lang.String serverPassword) throws JMSException
#getConnection(String, String, String)
instead to re-use an existing connection if possible.
serverUrl
- the server url, e.g. "tcp://localhost:61616"serverUser
- the user name, or nullserverPassword
- the password, or null
JMSException
- if the connection cannot be created for some reason.public static IOBase.ConnectionStatus getConnectionStatus(Connection c)
c
- a connection.
public java.lang.String getTopicName()
JMSException
public java.lang.String getJMSUrl()
public java.lang.String getJMSUser()
public java.lang.String getJMSPassword()
public Connection getConnection()
public Session getSession()
public Topic getTopic()
public void startConnection() throws JMSException
JMSException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |