|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.uhn.hl7v2.concurrent.Service
ca.uhn.hl7v2.app.HL7Service
ca.uhn.hl7v2.app.SimpleServer
public class SimpleServer
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.
| 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)
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class ca.uhn.hl7v2.app.HL7Service |
|---|
getRemoteConnection, getRemoteConnections, keepRunning, loadApplicationsFromFile, newConnection, registerApplication, registerConnectionListener |
| Methods inherited from class ca.uhn.hl7v2.concurrent.Service |
|---|
getExecutorService, getServiceExitedWithException, isRunning, prepareTermination, run, setServiceExitedWithException, setShutdownTimeout, start, stop, stopAndWait, waitForTermination |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SO_TIMEOUT
| Constructor Detail |
|---|
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!
| Method Detail |
|---|
protected void afterStartup()
afterStartup in class HL7ServiceHL7Service.afterStartup()protected void handle()
handle in class Serviceprotected void afterTermination()
afterTermination in class HL7Servicepublic static void main(String[] args)
loadApplicationsFromFile(...)). Uses the default
LowerLayerProtocol.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||