/** * @param theServerSocket a ServerSocket on which to listen for connections that will * be used for both locally-driven and remotely-driven message exchanges * @param theRouter used to send incoming messages to appropriate <code>Application</code>s * @param theStorage used to commit incoming messages to safe storage before returning * an accept ACK */ public HL7Server(ServerSocket theServerSocket, ApplicationRouter theRouter, SafeStorage theStorage) { myServerSocket = theServerSocket; myRouter = theRouter; myStorage = theStorage; initProcessorList(); }
if (args.length == 2) { int port = Integer.parseInt(args[0]); server = new HL7Server(new ServerSocket(port), router, storage); appURL = args[1]; } else { int localPort = Integer.parseInt(args[0]); int remotePort = Integer.parseInt(args[1]); server = new HL7Server(new ServerSocket(localPort), new ServerSocket(remotePort), router, storage); appURL = args[2]; ApplicationLoader.loadApplications(router, getURL(appURL)); server.start(null); //any address OK
/** * Accepts a single inbound connection if the same ServerSocket is used for * all message exchanges, or a connection from each if two ServerSockets are * being used. * * @param theAddress the IP address from which to accept connections (null means * accept from any address). Connection attempts from other addresses will * be ignored. * @return a <code>Processor</code> connected to the given address * @throws TransportException */ public Processor accept(String theAddress) throws TransportException { TransportLayer transport = getTransport(myServerSocket, theAddress); ProcessorContext context = null; if (myServerSocket2 == null) { //we're doing inbound & outbound on the same port transport.connect(); context = new ProcessorContextImpl(myRouter, transport, myStorage); } else { TransportLayer transport2 = getTransport(myServerSocket2, theAddress); DualTransportConnector connector = new DualTransportConnector(transport, transport2); connector.connect(); context = new ProcessorContextImpl(myRouter, transport, transport2, myStorage); } return new ProcessorImpl(context, true); }
if (args.length == 2) { int port = Integer.parseInt(args[0]); server = new HL7Server(new ServerSocket(port), router, storage); appURL = args[1]; } else { int localPort = Integer.parseInt(args[0]); int remotePort = Integer.parseInt(args[1]); server = new HL7Server(new ServerSocket(localPort), new ServerSocket(remotePort), router, storage); appURL = args[2]; ApplicationLoader.loadApplications(router, getURL(appURL)); server.start(null); //any address OK
/** * Accepts a single inbound connection if the same ServerSocket is used for * all message exchanges, or a connection from each if two ServerSockets are * being used. * * @param theAddress the IP address from which to accept connections (null means * accept from any address). Connection attempts from other addresses will * be ignored. * @return a <code>Processor</code> connected to the given address * @throws TransportException */ public Processor accept(String theAddress) throws TransportException { TransportLayer transport = getTransport(myServerSocket, theAddress); ProcessorContext context = null; if (myServerSocket2 == null) { //we're doing inbound & outbound on the same port transport.connect(); context = new ProcessorContextImpl(myRouter, transport, myStorage); } else { TransportLayer transport2 = getTransport(myServerSocket2, theAddress); DualTransportConnector connector = new DualTransportConnector(transport, transport2); connector.connect(); context = new ProcessorContextImpl(myRouter, transport, transport2, myStorage); } return new ProcessorImpl(context, true); }
/** * @param theServerSocket a ServerSocket on which to listen for connections that will * be used for both locally-driven and remotely-driven message exchanges * @param theRouter used to send incoming messages to appropriate <code>Application</code>s * @param theStorage used to commit incoming messages to safe storage before returning * an accept ACK */ public HL7Server(ServerSocket theServerSocket, ApplicationRouter theRouter, SafeStorage theStorage) { myServerSocket = theServerSocket; myRouter = theRouter; myStorage = theStorage; initProcessorList(); }
/** * @param theLocallyDriven a ServerSocket on which to listen for connections that will * be used for locally-initiated message exchanges * @param theRemotelyDriven a ServerSocket on which to listen for connections that will * be used for remotely-initiated message exchanges * @param theRouter used to send incoming messages to appropriate <code>Application</code>s * @param theStorage used to commit incoming messages to safe storage before returning * an accept ACK */ public HL7Server(ServerSocket theLocallyDriven, ServerSocket theRemotelyDriven, ApplicationRouter theRouter, SafeStorage theStorage) { myServerSocket = theLocallyDriven; myServerSocket2 = theRemotelyDriven; myRouter = theRouter; myStorage = theStorage; initProcessorList(); }
/** * @param theLocallyDriven a ServerSocket on which to listen for connections that will * be used for locally-initiated message exchanges * @param theRemotelyDriven a ServerSocket on which to listen for connections that will * be used for remotely-initiated message exchanges * @param theRouter used to send incoming messages to appropriate <code>Application</code>s * @param theStorage used to commit incoming messages to safe storage before returning * an accept ACK */ public HL7Server(ServerSocket theLocallyDriven, ServerSocket theRemotelyDriven, ApplicationRouter theRouter, SafeStorage theStorage) { myServerSocket = theLocallyDriven; myServerSocket2 = theRemotelyDriven; myRouter = theRouter; myStorage = theStorage; initProcessorList(); }