Package ca.uhn.hl7v2.protocol.impl
Class AbstractJMSTransport
java.lang.Object
ca.uhn.hl7v2.protocol.impl.AbstractTransport
ca.uhn.hl7v2.protocol.impl.AbstractJMSTransport
- All Implemented Interfaces:
TransportLayer
- Direct Known Subclasses:
JMSQueueTransport,JMSTopicTransport
A
TransportLayer that exchanges messages through JMS destinations.- Version:
- $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:26 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalled by receive(), which then adds common metadata.voiddoSend(Transportable theMessage) The method send() delegates to this method after checking whether we are connected.Returns metadata under the static keys defined by this class.abstract javax.jms.Connectionprotected abstract Stringprotected abstract javax.jms.Messageprotected abstract javax.jms.Messageprotected abstract voidsendJMS(javax.jms.Message theMessage) Sends a message to the underlying Destinationprotected javax.jms.MessagetoMessage(Transportable theSource) Fills a JMS message object with text and metadata from the givenTransportable.protected TransportabletoTransportable(javax.jms.Message theMessage) Copies data from the given Message into a Transportable.Methods inherited from class ca.uhn.hl7v2.protocol.impl.AbstractTransport
connect, disconnect, doConnect, doDisconnect, isConnected, receive, sendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.protocol.TransportLayer
connect, disconnect, isConnected, receive, send
-
Field Details
-
CLIENT_ID_KEY
- See Also:
-
CONNECTION_METADATA_KEY
- See Also:
-
DESTINATION_NAME_KEY
- See Also:
-
-
Constructor Details
-
AbstractJMSTransport
public AbstractJMSTransport()
-
-
Method Details
-
getDestinationName
- Returns:
- the name of the destination at which messages are written and read
- Throws:
javax.jms.JMSException
-
getConnection
- Returns:
- the QueueConnection or TopicConnection over which messages are transported
-
getMessage
- Returns:
- a new JMS Message created on the sending Session.
- Throws:
javax.jms.JMSException
-
sendJMS
Sends a message to the underlying Destination- Parameters:
theMessage-- Throws:
javax.jms.JMSException
-
receiveJMS
- Returns:
- the next available message from the underlying Destination
- Throws:
javax.jms.JMSException
-
doSend
Description copied from class:AbstractTransportThe method send() delegates to this method after checking whether we are connected.- Specified by:
doSendin classAbstractTransport- Throws:
TransportException- See Also:
-
toMessage
Fills a JMS message object with text and metadata from the givenTransportable. 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.- Parameters:
theSource- a Transportable from which to obtain data for filling the given Message- Returns:
- a Message containing data from the given Transportable
- Throws:
TransportException
-
toTransportable
Copies data from the given Message into a Transportable. The default implementation expects a TextMessage, but this can be overridden.- Parameters:
theMessage- a JMS Message from which to obtain data- Returns:
- a Transportable containing data from the given Message
- Throws:
TransportException
-
doReceive
Description copied from class:AbstractTransportCalled by receive(), which then adds common metadata.- Specified by:
doReceivein classAbstractTransport- Returns:
- Transportable the next available message
- Throws:
TransportException- See Also:
-
getCommonMetadata
Returns metadata under the static keys defined by this class.- Specified by:
getCommonMetadatain interfaceTransportLayer- Overrides:
getCommonMetadatain classAbstractTransport- Returns:
- metadata to be added to the metadata of all incoming messages. This provides a way of associating connection information with incoming messages (eg the IP address of the remote server).
- See Also:
-