public class HohRawClientMultithreaded extends AbstractRawClient implements IClientMultithreaded
Raw message sender using the HL7 over HTTP specification which uses a
ScheduledExecutorService
to provide advanced functionality such as
persistent connections which time out and close automatically.
This connector uses an executor service which can start worker threads, so use caution if embedding within a J2EE container.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_SOCKET_TIMEOUT
Default
Socket Timeout , 10000ms |
DEFAULT_CHARSET, DEFAULT_CONNECTION_TIMEOUT, DEFAULT_RESPONSE_TIMEOUT
Constructor and Description |
---|
HohRawClientMultithreaded()
Constructor
|
HohRawClientMultithreaded(String theHost,
int thePort,
String thePath)
Constructor
|
HohRawClientMultithreaded(String theHost,
int thePort,
String theUriPath,
ScheduledExecutorService theExecutorService)
Constructor
|
HohRawClientMultithreaded(URL theUrl)
Constructor
|
HohRawClientMultithreaded(URL theUrl,
ScheduledExecutorService theExecutorService)
Constructor
|
Modifier and Type | Method and Description |
---|---|
long |
getSocketTimeout()
Returns the number of millis to keep an idle socket open before closing it.
|
protected Socket |
provideSocket()
Subclasses must override to provide a connected socket
|
protected void |
returnSocket(Socket theSocket)
Returns a socket to the pool.
|
void |
setSocketTimeout(long theSocketTimeout)
Sets the number of millis to keep an idle socket open before closing it.
|
closeSocket, connect, getHost, getPort, getSocketFactory, getSoTimeout, getUriPath, getUrl, getUrlString, isKeepAlive, sendAndReceive, setAuthorizationCallback, setCharset, setHost, setKeepAlive, setPort, setResponseTimeout, setSigner, setSocketFactory, setSoTimeout, setUriPath, setUrl, setUrlString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHost, getPort, getSocketFactory, getSoTimeout, getUriPath, getUrl, getUrlString, isKeepAlive, setAuthorizationCallback, setCharset, setHost, setKeepAlive, setPort, setResponseTimeout, setSigner, setSocketFactory, setSoTimeout, setUriPath, setUrl, setUrlString
public static final long DEFAULT_SOCKET_TIMEOUT
Socket Timeout
, 10000mspublic HohRawClientMultithreaded()
public HohRawClientMultithreaded(String theHost, int thePort, String thePath)
theHost
- The HOST (name/address). E.g. "192.168.1.1"thePort
- The PORT. E.g. "8080"thePath
- The path being requested (must either be blank or start with
'/' and contain a path). E.g. "/Apps/Receiver.jsp"public HohRawClientMultithreaded(String theHost, int thePort, String theUriPath, ScheduledExecutorService theExecutorService)
theHost
- The HOST (name/address). E.g. "192.168.1.1"thePort
- The PORT. E.g. "8080"theUriPath
- The URI path being requested (must either be blank or start with
'/' and contain a path). E.g. "/Apps/Receiver.jsp"theExecutorService
- The executor service to use for detecting stale socketspublic HohRawClientMultithreaded(URL theUrl)
theUrl
- The URL to connect totheExecutorService
- The executor service to use for detecting stale socketspublic HohRawClientMultithreaded(URL theUrl, ScheduledExecutorService theExecutorService)
theUrl
- The URL to connect totheExecutorService
- The executor service to use for detecting stale socketsprotected Socket provideSocket() throws IOException
AbstractRawClient
provideSocket
in class AbstractRawClient
IOException
protected void returnSocket(Socket theSocket)
returnSocket
in class AbstractRawClient
public long getSocketTimeout()
Returns the number of millis to keep an idle socket open before closing it.
getSocketTimeout
in interface IClientMultithreaded
public void setSocketTimeout(long theSocketTimeout)
Sets the number of millis to keep an idle socket open before closing it.
This value may be changed at any time. Default is
DEFAULT_SOCKET_TIMEOUT
A value of -1 indicates that connections do not time out (use with caution).
Note that this parameter is respected on a best-effort basis, timeouts may be different, especially under heavy load
setSocketTimeout
in interface IClientMultithreaded
Copyright © 2012–2017 University Health Network. All rights reserved.