public class PooledVinciClient extends Object
Constructor and Description |
---|
PooledVinciClient(String serviceName,
int maxPoolSize)
Create a PooledVinciClient that will establish at most maxPoolSize connections to the
designated service.
|
Modifier and Type | Method and Description |
---|---|
void |
close(boolean wait)
Close this pooled client.
|
String |
getServiceName()
Get the service name to which this client connects.
|
Transportable |
sendAndReceive(Transportable in)
Send a request to the service and receive the response.
|
Transportable |
sendAndReceive(Transportable in,
int socketTimeout)
Send a request to the service and receive the response, using the provided socketTimeout in
place of the client-provided one.
|
Transportable |
sendAndReceive(Transportable in,
TransportableFactory f)
Send a request to the service and receive the response, using the provided transportable
factory in place of the client-provided one.
|
Transportable |
sendAndReceive(Transportable in,
TransportableFactory f,
int socketTimeout)
Send a request to the service and receive the response, using the provided transportable
factory and socketTimeout in place of the client-provided ones.
|
void |
setConnectTimeout(int connectTimeoutMillis)
Set a connect timeout that will be used in place of BaseClient.DEFAULT_CONNECT_TIMEOUT
|
void |
setContext(VinciContext context)
Set a VinciContext that will be used by this PooledVinciClient instead of the default global
context.
|
void |
setSocketTimeout(int socketTimeoutMillis)
Set a socket timeout that will be used in place of BaseClient.DEFAULT_SOCKET_TIMEOUT
|
void |
setTransportableFactory(TransportableFactory factory)
Set a transportable factory that will be used in place of the VinciFrame factory.
|
public PooledVinciClient(String serviceName, int maxPoolSize)
serviceName
- -maxPoolSize
- -public void setContext(VinciContext context)
context
- -public void setConnectTimeout(int connectTimeoutMillis)
connectTimeoutMillis
- -public void setSocketTimeout(int socketTimeoutMillis)
socketTimeoutMillis
- -public void setTransportableFactory(TransportableFactory factory)
factory
- -public String getServiceName()
public Transportable sendAndReceive(Transportable in) throws IOException, ServiceException
in
- -IOException
- -ServiceException
- -public Transportable sendAndReceive(Transportable in, TransportableFactory f) throws IOException, ServiceException
in
- -f
- -IOException
- -ServiceException
- -public Transportable sendAndReceive(Transportable in, TransportableFactory f, int socketTimeout) throws IOException, ServiceException
in
- -f
- -socketTimeout
- -IOException
- -ServiceException
- -public Transportable sendAndReceive(Transportable in, int socketTimeout) throws IOException, ServiceException
in
- -socketTimeout
- -IOException
- -ServiceException
- -public void close(boolean wait)
wait
- If true, this method will block until all in-progress requests have completed,
otherwise this method will return immediately (though in progress requests will still
be allowed to complete)Copyright © 2018. All rights reserved.