|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.xbus.technical.mq.MQConnection
public class MQConnection
MQConnection
manages connections and sessions for messagequeues.
It implements two Design-Patterns:
MQConnection
is created
for every thread. This instance can be fetched with
getInstance()
.
Method Summary | |
---|---|
static void |
clear()
|
void |
close()
Closes the connection. |
void |
commit()
Commits all actions on the queues associated with this MQConnection (normally all queues of the current thread). |
javax.jms.TextMessage |
createTextMessage()
Creates and returns a JMS- TextMessage . |
javax.jms.QueueBrowser |
getBrowser(XBUSSystem system)
Creates and returns a JMS- QueueBrowser for the given queue. |
static MQConnection |
getInstance()
Delivers an instance of MQConnection . |
java.lang.String |
getPhysQueuename(XBUSSystem system)
Reads the name of the message queue from the configuration. |
javax.jms.QueueReceiver |
getReceiver(XBUSSystem system)
Creates and returns a JMS- QueueReceiver for the given
queue. |
javax.jms.QueueSender |
getSender(XBUSSystem system)
Creates and returns a JMS- QueueSender for the given queue. |
void |
initialize()
Initializes the MQConnection. |
void |
open()
Opens the JMS-QueueSession and JMS-QueueConnection for sending and receiving messages. |
void |
rollback()
Performs a rollback for all actions on the queues associated with this MQConnection (normally all queues of the current thread). |
protected void |
setDeleteInformation(XBUSSystem source,
java.lang.String messageId)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void open() throws XException
open
in interface TAResource
XException
- if something goes wrongpublic static MQConnection getInstance() throws XException
MQConnection
.
If it is the first call for the actual thread, a new
MQConnection
-object gets created. Subsequent calls in this
thread will deliver the object, that has been created by the first call.
XException
public void commit() throws XException
MQConnection
(normally all queues of the current thread).
commit
in interface TAResource
XException
- if something goes wrongpublic void rollback() throws XException
MQConnection
(normally all queues of the current thread).
rollback
in interface TAResource
XException
- if something goes wrongpublic void close() throws XException
close
in interface TAResource
XException
- if something goes wrongpublic void initialize()
public javax.jms.QueueSender getSender(XBUSSystem system) throws XException
QueueSender
for the given queue.
XException
public javax.jms.QueueReceiver getReceiver(XBUSSystem system) throws XException
QueueReceiver
for the given
queue.
system
- name of an interface
XException
public javax.jms.QueueBrowser getBrowser(XBUSSystem system) throws XException
QueueBrowser
for the given queue.
XException
public javax.jms.TextMessage createTextMessage() throws XException
TextMessage
.
XException
protected void setDeleteInformation(XBUSSystem source, java.lang.String messageId)
public static void clear()
public java.lang.String getPhysQueuename(XBUSSystem system) throws XException
system
- the name of the sender/receiver
XException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |