Package ca.uhn.hl7v2.app
Class TwoPortService
java.lang.Object
ca.uhn.hl7v2.concurrent.Service
ca.uhn.hl7v2.app.HL7Service
ca.uhn.hl7v2.app.TwoPortService
- All Implemented Interfaces:
Runnable
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
-
Constructor Summary
ConstructorsConstructorDescriptionTwoPortService(int inboundPort, int outboundPort) TwoPortService(int inboundPort, int outboundPort, boolean tls) TwoPortService(HapiContext hapiContext, int inboundPort, int outboundPort, boolean tls) Creates a new instance of TwoPortServiceTwoPortService(Parser parser, LowerLayerProtocol llp, int inboundPort, int outboundPort, boolean tls) Creates a new instance of TwoPortServiceTwoPortService(Parser parser, LowerLayerProtocol llp, int inboundPort, int outboundPort, boolean tls, ExecutorService executorService) Creates a new instance of TwoPortService -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLaunches two threads that concurrently listen on the inboundPort and outboundPort.protected voidTerminate the two acceptor threadsprotected ca.uhn.hl7v2.app.AcceptorThreadcreateAcceptThread(int port) protected voidhandle()Polls for accepted socketsstatic voidRun server from command line.Methods inherited from class ca.uhn.hl7v2.app.HL7Service
getRemoteConnection, getRemoteConnections, keepRunning, loadApplicationsFromFile, newConnection, registerApplication, registerApplication, registerApplication, registerApplication, registerConnectionListener, setExceptionHandler, setParserExeptionHandler, unregisterApplication, unregisterApplicationMethods inherited from class ca.uhn.hl7v2.concurrent.Service
getExecutorService, getServiceExitedWithException, isRunning, prepareTermination, run, setServiceExitedWithException, setShutdownTimeout, start, startAndWait, stop, stopAndWait, waitForTermination
-
Constructor Details
-
TwoPortService
-
TwoPortService
-
TwoPortService
public TwoPortService(Parser parser, LowerLayerProtocol llp, int inboundPort, int outboundPort, boolean tls) Creates a new instance of TwoPortService -
TwoPortService
Creates a new instance of TwoPortService -
TwoPortService
public TwoPortService(Parser parser, LowerLayerProtocol llp, int inboundPort, int outboundPort, boolean tls, ExecutorService executorService) Creates a new instance of TwoPortService
-
-
Method Details
-
afterStartup
Launches two threads that concurrently listen on the inboundPort and outboundPort.- Overrides:
afterStartupin classHL7Service- See Also:
-
afterTermination
Terminate the two acceptor threads- Overrides:
afterTerminationin classHL7Service- See Also:
-
handle
Polls for accepted sockets -
createAcceptThread
-
main
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 persuper.loadApplicationsFromFile(...)). Uses the default LowerLayerProtocol.
-