Package org.redisson
Class BaseRemoteService
- java.lang.Object
-
- org.redisson.BaseRemoteService
-
- Direct Known Subclasses:
RedissonRemoteService
,TasksService
public abstract class BaseRemoteService extends Object
- Author:
- Nikita Koksharov
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cancelRequestMapName
protected String
cancelResponseMapName
protected Codec
codec
protected CommandAsyncExecutor
commandExecutor
protected String
executorId
protected String
name
protected RedissonClient
redisson
protected String
responseQueueName
-
Constructor Summary
Constructors Constructor Description BaseRemoteService(Codec codec, RedissonClient redisson, String name, CommandAsyncExecutor commandExecutor, String executorId, ConcurrentMap<String,ResponseEntry> responses)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract RFuture<Boolean>
addAsync(String requestQueueName, RemoteServiceRequest request, RemotePromise<Object> result)
protected void
awaitResultAsync(RemoteInvocationOptions optionsCopy, RemotePromise<Object> result, RFuture<RRemoteServiceResponse> responseFuture)
protected io.netty.buffer.ByteBuf
encode(Object obj)
protected RequestId
generateRequestId()
<T> T
get(Class<T> remoteInterface)
<T> T
get(Class<T> remoteInterface, long executionTimeout, TimeUnit executionTimeUnit)
<T> T
get(Class<T> remoteInterface, long executionTimeout, TimeUnit executionTimeUnit, long ackTimeout, TimeUnit ackTimeUnit)
<T> T
get(Class<T> remoteInterface, RemoteInvocationOptions options)
protected String
getAckName(String requestId)
protected String
getAckName(RequestId requestId)
protected List<String>
getMethodSignatures(Method method)
String
getRequestQueueName(Class<?> remoteInterface)
String
getResponseQueueName(String executorId)
protected <T extends RRemoteServiceResponse>
RPromise<T>pollResultResponse(long timeout, RequestId requestId, RemoteServiceRequest request)
protected abstract RFuture<Boolean>
removeAsync(String requestQueueName, RequestId taskId)
protected <T> void
scheduleCheck(String mapName, RequestId requestId, RPromise<T> cancelRequest)
-
-
-
Field Detail
-
codec
protected final Codec codec
-
redisson
protected final RedissonClient redisson
-
name
protected final String name
-
commandExecutor
protected final CommandAsyncExecutor commandExecutor
-
executorId
protected final String executorId
-
cancelRequestMapName
protected final String cancelRequestMapName
-
cancelResponseMapName
protected final String cancelResponseMapName
-
responseQueueName
protected final String responseQueueName
-
-
Constructor Detail
-
BaseRemoteService
public BaseRemoteService(Codec codec, RedissonClient redisson, String name, CommandAsyncExecutor commandExecutor, String executorId, ConcurrentMap<String,ResponseEntry> responses)
-
-
Method Detail
-
encode
protected io.netty.buffer.ByteBuf encode(Object obj)
-
get
public <T> T get(Class<T> remoteInterface)
-
get
public <T> T get(Class<T> remoteInterface, long executionTimeout, TimeUnit executionTimeUnit, long ackTimeout, TimeUnit ackTimeUnit)
-
get
public <T> T get(Class<T> remoteInterface, RemoteInvocationOptions options)
-
awaitResultAsync
protected void awaitResultAsync(RemoteInvocationOptions optionsCopy, RemotePromise<Object> result, RFuture<RRemoteServiceResponse> responseFuture)
-
pollResultResponse
protected <T extends RRemoteServiceResponse> RPromise<T> pollResultResponse(long timeout, RequestId requestId, RemoteServiceRequest request)
-
scheduleCheck
protected <T> void scheduleCheck(String mapName, RequestId requestId, RPromise<T> cancelRequest)
-
generateRequestId
protected RequestId generateRequestId()
-
addAsync
protected abstract RFuture<Boolean> addAsync(String requestQueueName, RemoteServiceRequest request, RemotePromise<Object> result)
-
removeAsync
protected abstract RFuture<Boolean> removeAsync(String requestQueueName, RequestId taskId)
-
-