public SimpleServer newServer(int port, boolean tls) { return new SimpleServer(this, port, tls); }
/** * Loop that waits for a connection and starts a ConnectionManager when it * gets one. */ @Override protected void handle() { if (acceptor.getServiceExitedWithException() != null) { setServiceExitedWithException(acceptor.getServiceExitedWithException()); } try { // Wait some period of time for connections AcceptedSocket newSocket = queue.poll(500, TimeUnit.MILLISECONDS); if (newSocket != null) { log.info("Accepted connection from {}:{} on local port {}", new Object[] { newSocket.socket.getInetAddress().getHostAddress(), newSocket.socket.getPort(), port }); ActiveConnection c = new ActiveConnection(getParser(), getLlp(), newSocket.socket, getExecutorService()); newConnection(c); } } catch (InterruptedException ie) { // just timed out } catch (Exception e) { log.error("Error while accepting connections: ", e); } }
SimpleServer server = new SimpleServer(port); if (appFile != null) server.loadApplicationsFromFile(appFile); server.start(); } catch (Exception e) { e.printStackTrace();
SimpleServer server = new SimpleServer(port, llp, parser); server.registerApplication("ADT", "A01", handler); server.registerApplication("ADT", "A02", handler); server.start(); server.stop();
/** * Prepare server by initializing the server socket * * @see ca.uhn.hl7v2.app.HL7Service#afterStartup() */ @Override protected void afterStartup() { try { super.afterStartup(); log.info("Starting SimpleServer running on port {}", port); SocketFactory ss = this.hapiContext.getSocketFactory(); acceptor = new AcceptorThread(port, tls, getExecutorService(), queue, ss); acceptor.start(); } catch (Exception e) { log.error("Failed starting SimpleServer on port", port); throw new RuntimeException(e); } }
/** * Loop that waits for a connection and starts a ConnectionManager when it * gets one. */ @Override protected void handle() { if (acceptor.getServiceExitedWithException() != null) { setServiceExitedWithException(acceptor.getServiceExitedWithException()); } try { // Wait some period of time for connections AcceptedSocket newSocket = queue.poll(500, TimeUnit.MILLISECONDS); if (newSocket != null) { log.info("Accepted connection from {}:{} on local port {}", new Object[] { newSocket.socket.getInetAddress().getHostAddress(), newSocket.socket.getPort(), port }); ActiveConnection c = new ActiveConnection(getParser(), getLlp(), newSocket.socket, getExecutorService()); newConnection(c); } } catch (InterruptedException ie) { // just timed out } catch (Exception e) { log.error("Error while accepting connections: ", e); } }
SimpleServer server = new SimpleServer(port); if (appFile != null) server.loadApplicationsFromFile(appFile); server.start(); } catch (Exception e) { e.printStackTrace();
/** * Prepare server by initializing the server socket * * @see ca.uhn.hl7v2.app.HL7Service#afterStartup() */ @Override protected void afterStartup() { try { super.afterStartup(); log.info("Starting SimpleServer running on port {}", port); SocketFactory ss = this.hapiContext.getSocketFactory(); acceptor = new AcceptorThread(port, tls, getExecutorService(), queue, ss); acceptor.start(); } catch (Exception e) { log.error("Failed starting SimpleServer on port", port); throw new RuntimeException(e); } }
public SimpleServer newServer(int port, boolean tls) { return new SimpleServer(this, port, tls); }