ca.uhn.hl7v2.protocol.impl
Class JMSTransport

java.lang.Object
  extended by ca.uhn.hl7v2.protocol.impl.AbstractTransport
      extended by ca.uhn.hl7v2.protocol.impl.JMSTransport
All Implemented Interfaces:
TransportLayer

public class JMSTransport
extends AbstractTransport
implements TransportLayer

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
static java.lang.String INBOUND_CLIENT_ID_KEY
           
static java.lang.String INBOUND_CONNECTION_METADATA_KEY
           
static java.lang.String INBOUND_DESTINATION_NAME_KEY
           
static java.lang.String OUTBOUND_CLIENT_ID_KEY
           
static java.lang.String OUTBOUND_CONNECTION_METADATA_KEY
           
static java.lang.String OUTBOUND_DESTINATION_NAME_KEY
           
 
Constructor Summary
JMSTransport()
           
JMSTransport(JMSDestination theInboundDestination, JMSDestination theOutboundDestination)
           
 
Method Summary
 void doConnect()
          Performs connection as described in TransportLayer.connect().
 void doDisconnect()
          Performs disconnection as described in TransportLayer.disconnect().
 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.
 java.util.Map getCommonMetadata()
          Returns metadata under the static keys defined by this class.
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.
 
Methods inherited from class ca.uhn.hl7v2.protocol.impl.AbstractTransport
connect, disconnect, isConnected, receive, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.uhn.hl7v2.protocol.TransportLayer
connect, disconnect, isConnected, receive, send
 

Field Detail

INBOUND_DESTINATION_NAME_KEY

public static final java.lang.String INBOUND_DESTINATION_NAME_KEY
See Also:
Constant Field Values

INBOUND_CLIENT_ID_KEY

public static final java.lang.String INBOUND_CLIENT_ID_KEY
See Also:
Constant Field Values

INBOUND_CONNECTION_METADATA_KEY

public static final java.lang.String INBOUND_CONNECTION_METADATA_KEY
See Also:
Constant Field Values

OUTBOUND_DESTINATION_NAME_KEY

public static final java.lang.String OUTBOUND_DESTINATION_NAME_KEY
See Also:
Constant Field Values

OUTBOUND_CLIENT_ID_KEY

public static final java.lang.String OUTBOUND_CLIENT_ID_KEY
See Also:
Constant Field Values

OUTBOUND_CONNECTION_METADATA_KEY

public static final java.lang.String OUTBOUND_CONNECTION_METADATA_KEY
See Also:
Constant Field Values
Constructor Detail

JMSTransport

public JMSTransport(JMSDestination theInboundDestination,
                    JMSDestination theOutboundDestination)
Parameters:
theInboundDestination - wrapper around the Queue or Topic to which outgoing messages are to be sent
theOutboundDestination - wrapper around the Queue or Topic from which incoming messages are to be retrieved

JMSTransport

public JMSTransport()
Parameters:
theConnection - JMS connection over which messages are exchanged
theDestination - JMS destination to which messages are produced and from which messages are consumed
Method Detail

doSend

public void doSend(Transportable theMessage)
            throws TransportException
Description copied from class: AbstractTransport
The method send() delegates to this method after checking whether we are connected.

Specified by:
doSend in class AbstractTransport
Throws:
TransportException
See Also:
ca.uhn.hl7v2.protocol.Transport#doSend(ca.uhn.hl7v2.protocol.Transportable)

toMessage

protected javax.jms.Message toMessage(Transportable theSource)
                               throws TransportException
Fills a JMS message object with text and metadata from the given 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.

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

protected Transportable toTransportable(javax.jms.Message theMessage)
                                 throws TransportException
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

public Transportable doReceive()
                        throws TransportException
Description copied from class: AbstractTransport
Called by receive(), which then adds common metadata.

Specified by:
doReceive in class AbstractTransport
Returns:
Transportable the next available message
Throws:
TransportException
See Also:
ca.uhn.hl7v2.protocol.AbstractTransport#doReceive()

getCommonMetadata

public java.util.Map getCommonMetadata()
Returns metadata under the static keys defined by this class.

Specified by:
getCommonMetadata in interface TransportLayer
Overrides:
getCommonMetadata in class AbstractTransport
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:
TransportLayer.getCommonMetadata()

doConnect

public void doConnect()
               throws TransportException
Description copied from class: AbstractTransport
Performs connection as described in TransportLayer.connect(). The connect() method of this class delegates to doConnect() after some internal housekeeping.

Specified by:
doConnect in class AbstractTransport
Throws:
TransportException
See Also:
AbstractTransport.doConnect()

doDisconnect

public void doDisconnect()
                  throws TransportException
Description copied from class: AbstractTransport
Performs disconnection as described in TransportLayer.disconnect(). The disconnect() method of this class delegates to doDisconnect() after some internal housekeeping.

Specified by:
doDisconnect in class AbstractTransport
Throws:
TransportException
See Also:
AbstractTransport.doDisconnect()


Copyright © 2001-2011 University Health Network. All Rights Reserved.