public class FaultedConnection extends Object implements Connection
FaultedConnection is a support class for implementors of JRedis API.Connection.Event, Connection.Factory, Connection.Flag, Connection.Listener, Connection.Modality, Connection.Property, Connection.Socket, Connection.State| Constructor and Description |
|---|
FaultedConnection(ConnectionSpec connSpec,
String errMsg)
instantiates a faulted connection for the given
ConnectionSpec |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(Connection.Listener connListener)
Connection.Event propagation.
|
ConnectionSpec |
getSpec()
The
ConnectionSpec of a Connection must be invariant during its life-cycle. |
Future<Response> |
queueRequest(Command cmd,
byte[]... args)
A non-blocking call to service the specified request at some point in the future.
|
boolean |
removeListener(Connection.Listener connListener)
Optional event propagation method.
|
Response |
serviceRequest(Command cmd,
byte[]... args)
A blocking call to service the specified request.
|
public FaultedConnection(ConnectionSpec connSpec, String errMsg)
ConnectionSpecconnSpec - errMsg - public ConnectionSpec getSpec()
ConnectionConnectionSpec of a Connection must be invariant during its life-cycle.getSpec in interface ConnectionConnectionSpec for this Connection.public Response serviceRequest(Command cmd, byte[]... args) throws RedisException, ClientRuntimeException, ProviderException
ConnectionProtocol interface
and can (and should) be addressed at the implementation level (for example when creating
handler instances using a specification set, including max wait for synchronous response.)
Connection.Modality.Asynchronous handlers must always throw a ClientRuntimeException
for this method which violates the contract for Connection.Modality.Asynchronous handlers.
serviceRequest in interface ConnectionRedisExceptionClientRuntimeExceptionProviderExceptionpublic Future<Response> queueRequest(Command cmd, byte[]... args) throws ClientRuntimeException, ProviderException
ConnectionFuture object of parametric type Response
When the request is serviced, call to Future.get() will return the request response.
Connection.Modality.Synchronous handlers must always throw a ClientRuntimeException
for this method which violates the contract for Connection.Modality.Synchronous handlers.
If request resulted in a redis error (RedisException), the exception will be set as the cause of
the corresponding ExecutionException of the Future object returned.
queueRequest in interface ConnectionFuture Response.ClientRuntimeExceptionProviderExceptionFuture,
ExecutionExceptionpublic final boolean addListener(Connection.Listener connListener)
ConnectionaddListener in interface Connectionpublic final boolean removeListener(Connection.Listener connListener)
ConnectionConnection.Listeners.removeListener in interface ConnectionCopyright © 2009–2021. All rights reserved.