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 Applications based
on message type. From the HL7 perspective, an Application is
something that does something with a message.
| Modifier and Type | Field and Description |
|---|---|
static int |
SO_TIMEOUT
Socket timeout for simple server
|
| Constructor and Description |
|---|
SimpleServer(HapiContext hapiContext,
int port,
boolean tls)
Creates a new instance of SimpleServer that listens on a given server socket.
|
SimpleServer(int port)
Creates a new instance of SimpleServer that listens on the given port,
using the
MinLowerLayerProtocol and a standard PipeParser. |
SimpleServer(int port,
boolean tls)
Creates a new instance of SimpleServer that listens on the given port,
using the
MinLowerLayerProtocol and a standard PipeParser. |
SimpleServer(int port,
LowerLayerProtocol llp,
Parser parser)
Creates a new instance of SimpleServer that listens on the given port.
|
SimpleServer(int port,
LowerLayerProtocol llp,
Parser parser,
boolean tls)
Creates a new instance of SimpleServer that listens on the given port.
|
SimpleServer(int port,
LowerLayerProtocol llp,
Parser parser,
boolean tls,
ExecutorService executorService)
Creates a new instance of SimpleServer using a custom {link
ExecutorService. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterStartup()
Prepare server by initializing the server socket
|
protected void |
afterTermination()
Close down socket
|
protected void |
handle()
Loop that waits for a connection and starts a ConnectionManager when it
gets one.
|
static void |
main(String[] args)
Run server from command line.
|
getRemoteConnection, getRemoteConnections, keepRunning, loadApplicationsFromFile, newConnection, registerApplication, registerApplication, registerApplication, registerApplication, registerConnectionListener, setExceptionHandler, unregisterApplication, unregisterApplicationgetExecutorService, getServiceExitedWithException, isRunning, prepareTermination, run, setServiceExitedWithException, setShutdownTimeout, start, startAndWait, stop, stopAndWait, waitForTerminationpublic static final int SO_TIMEOUT
public SimpleServer(int port)
MinLowerLayerProtocol and a standard PipeParser.public SimpleServer(int port, boolean tls)
MinLowerLayerProtocol and a standard PipeParser.public SimpleServer(int port, LowerLayerProtocol llp, Parser parser)
public SimpleServer(int port, LowerLayerProtocol llp, Parser parser, boolean tls)
public SimpleServer(int port, LowerLayerProtocol llp, Parser parser, boolean tls, ExecutorService executorService)
ExecutorService. This ExecutorService instance will
not be shut down after the server stops!public SimpleServer(HapiContext hapiContext, int port, boolean tls)
IllegalStateException - If serverSocket is already boundprotected void afterStartup()
afterStartup in class HL7ServiceHL7Service.afterStartup()protected void handle()
protected void afterTermination()
afterTermination in class HL7ServiceCopyright © 2001–2017 University Health Network. All rights reserved.