public abstract class AbstractJMSTransport extends AbstractTransport implements TransportLayer
TransportLayer that exchanges messages through JMS destinations.| Modifier and Type | Field and Description |
|---|---|
static String |
CLIENT_ID_KEY |
static String |
CONNECTION_METADATA_KEY |
static String |
DESTINATION_NAME_KEY |
| Constructor and Description |
|---|
AbstractJMSTransport() |
| Modifier and Type | Method and Description |
|---|---|
Transportable |
doReceive()
Called by receive(), which then adds common metadata.
|
void |
doSend(Transportable theMessage)
The method send() delegates to this method after checking whether we are
connected.
|
Map<String,Object> |
getCommonMetadata()
Returns metadata under the static keys defined by this class.
|
abstract javax.jms.Connection |
getConnection() |
protected abstract String |
getDestinationName() |
protected abstract javax.jms.Message |
getMessage() |
protected abstract javax.jms.Message |
receiveJMS() |
protected abstract void |
sendJMS(javax.jms.Message theMessage)
Sends a message to the underlying Destination
|
protected javax.jms.Message |
toMessage(Transportable theSource)
Fills a JMS message object with text and metadata from the given
Transportable. |
protected Transportable |
toTransportable(javax.jms.Message theMessage)
Copies data from the given Message into a Transportable.
|
connect, disconnect, doConnect, doDisconnect, isConnected, receive, sendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, disconnect, isConnected, receive, sendpublic static final String CLIENT_ID_KEY
public static final String CONNECTION_METADATA_KEY
public static final String DESTINATION_NAME_KEY
public AbstractJMSTransport()
theConnection - JMS connection over which messages are exchangedtheDestination - JMS destination to which messages are produced and
from which messages are consumedprotected abstract String getDestinationName() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic abstract javax.jms.Connection getConnection()
protected abstract javax.jms.Message getMessage() throws javax.jms.JMSException
javax.jms.JMSExceptionprotected abstract void sendJMS(javax.jms.Message theMessage) throws javax.jms.JMSException
theMessage - javax.jms.JMSExceptionprotected abstract javax.jms.Message receiveJMS() throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void doSend(Transportable theMessage) throws TransportException
AbstractTransportdoSend in class AbstractTransportTransportExceptionca.uhn.hl7v2.protocol.Transport#doSend(ca.uhn.hl7v2.protocol.Transportable)protected javax.jms.Message toMessage(Transportable theSource) throws TransportException
Transportable. The default implementation obtains a
the Message from getMessage(), and expects this to be a TextMessage.
Override this method if you want to use a different message type.theSource - a Transportable from which to obtain data for filling the
given MessageTransportExceptionprotected Transportable toTransportable(javax.jms.Message theMessage) throws TransportException
theMessage - a JMS Message from which to obtain dataTransportExceptionpublic Transportable doReceive() throws TransportException
AbstractTransportdoReceive in class AbstractTransportTransportExceptionca.uhn.hl7v2.protocol.AbstractTransport#doReceive()public Map<String,Object> getCommonMetadata()
getCommonMetadata in interface TransportLayergetCommonMetadata in class AbstractTransportTransportLayer.getCommonMetadata()Copyright © 2001–2017 University Health Network. All rights reserved.