public class SyncConnection extends ConnectionBase implements Connection
Connection.Event, Connection.Factory, Connection.Flag, Connection.Listener, Connection.Modality, Connection.Property, Connection.Socket, Connection.Statespec| Constructor and Description |
|---|
SyncConnection(ConnectionSpec connectionSpec)
This constructor will pass the connection spec to the super class constructor and
create and install the
Protocol handler delegate instance for this SyncConnection. |
| Modifier and Type | Method and Description |
|---|---|
Connection.Modality |
getModality() |
Response |
serviceRequest(Command cmd,
byte[]... args)
A blocking call to service the specified request.
|
addListener, connect, disconnect, getInputStream, getOutputStream, getProtocolHandler, getSpec, initializeAsyncConnection, initializeComponents, initializeOnConnect, initializeSocketStreams, initializeSyncConnection, isConnected, newInputStream, newOutputStream, newProtocolHandler, notifyConnected, notifyDisconnected, notifyFaulted, notifyListeners, notifyShuttingDown, onConnectionFault, queueRequest, reconnect, removeListener, shutdown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getSpec, queueRequest, removeListenerpublic SyncConnection(ConnectionSpec connectionSpec) throws ClientRuntimeException, ProviderException
Protocol handler delegate instance for this SyncConnection.
If you definitely need to specify the redis server version, and the protocol implementation for that
version exists, you should use this constructor. Otherwise, it is recommended that the
SyncConnection(ConnectionSpec)be used.
This constructor will open the socket connection immediately.
connectionSpec - redisversion - ClientRuntimeException - due to either dns (host connectivity) or any IO issues related to establishing
the socket connection to the specified server.ProviderException - if the version specified is not supported.public final Connection.Modality getModality()
public Response serviceRequest(Command cmd, byte[]... args) throws RedisException
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 ConnectionserviceRequest in class ConnectionBaseRedisExceptionCopyright © 2009–2021. All rights reserved.