ca.uhn.hl7v2.app
Class SimpleServer

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

public class SimpleServer
extends HL7Service

A simple TCP/IP-based HL7 server. This server listens for connections on a particular port, and creates a ConnectionManager for each incoming connection.

A single SimpleServer can only service requests that use a single class of LowerLayerProtocol (specified at construction time).

The ConnectionManager uses a PipeParser of the version specified in the constructor

ConnectionManagers currently only support original mode processing.

The ConnectionManager routes messages to various "Application"s based on message type. From the HL7 perspective, an Application is something that does something with a message.

Author:
Bryan Tripp

Field Summary
static int SO_TIMEOUT
          Socket timeout for simple server
 
Fields inherited from class ca.uhn.hl7v2.app.HL7Service
llp, parser
 
Constructor Summary
SimpleServer(int port, LowerLayerProtocol llp, Parser parser)
          Creates a new instance of SimpleServer that listens on the given port.
 
Method Summary
static void main(java.lang.String[] args)
          Run server from command line.
 void run()
          Loop that waits for a connection and starts a ConnectionManager when it gets one.
 
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
 

Field Detail

SO_TIMEOUT

public static final int SO_TIMEOUT
Socket timeout for simple server

See Also:
Constant Field Values
Constructor Detail

SimpleServer

public SimpleServer(int port,
                    LowerLayerProtocol llp,
                    Parser parser)
Creates a new instance of SimpleServer that listens on the given port. Exceptions are logged using ca.uhn.hl7v2.Log;

Method Detail

run

public void run()
Loop that waits for a connection and starts a ConnectionManager when it gets one.

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. Port number should be passed as an argument, and a file containing a list of Applications to use can also be specified as an optional argument (as per loadApplicationsFromFile(...)). Uses the default LowerLayerProtocol.



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