ca.uhn.hl7v2.app
Class TwoPortService

java.lang.Object
  extended by ca.uhn.hl7v2.app.HL7Service
      extended by ca.uhn.hl7v2.app.TwoPortService
All Implemented Interfaces:
java.lang.Runnable

public class TwoPortService
extends HL7Service

A TCP/IP-based HL7 Service that uses separate ports for inbound and outbound messages. A connection is only activated when the same remote host connects to both the inbound and outbound ports.

Author:
Bryan Tripp

Field Summary
 
Fields inherited from class ca.uhn.hl7v2.app.HL7Service
llp, parser
 
Constructor Summary
TwoPortService(Parser parser, LowerLayerProtocol llp, int inboundPort, int outboundPort)
          Creates a new instance of TwoPortService
 
Method Summary
static void main(java.lang.String[] args)
          Run server from command line.
 void run()
          Initially sets up server sockets and starts separate threads to accept connections on them.
 
Methods inherited from class ca.uhn.hl7v2.app.HL7Service
getRemoteConnection, getRemoteConnections, isRunning, keepRunning, loadApplicationsFromFile, newConnection, registerApplication, registerConnectionListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoPortService

public TwoPortService(Parser parser,
                      LowerLayerProtocol llp,
                      int inboundPort,
                      int outboundPort)
Creates a new instance of TwoPortService

Method Detail

run

public void run()
Initially sets up server sockets and starts separate threads to accept connections on them. Then loops, calling this.accept() super.newConnection().

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class HL7Service

main

public static void main(java.lang.String[] args)
Run server from command line. Inbound and outbound port numbers should be provided as arguments, and a file containing a list of Applications to use can also be specified as an optional argument (as per super.loadApplicationsFromFile(...)). Uses the default LowerLayerProtocol.



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