Package org.redisson
Class RedissonRemoteService
- java.lang.Object
-
- org.redisson.BaseRemoteService
-
- org.redisson.RedissonRemoteService
-
- All Implemented Interfaces:
RRemoteService
- Direct Known Subclasses:
RedissonExecutorRemoteService
public class RedissonRemoteService extends BaseRemoteService implements RRemoteService
- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RedissonRemoteService.Entry
-
Field Summary
-
Fields inherited from class org.redisson.BaseRemoteService
cancelRequestMapName, cancelResponseMapName, codec, commandExecutor, executorId, name, redisson, responseQueueName
-
-
Constructor Summary
Constructors Constructor Description RedissonRemoteService(Codec codec, RedissonClient redisson, String name, CommandExecutor commandExecutor, String executorId, ConcurrentMap<String,ResponseEntry> responses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RFuture<Boolean>
addAsync(String requestQueueName, RemoteServiceRequest request, RemotePromise<Object> result)
<T> void
deregister(Class<T> remoteInterface)
Deregister all workers for remote serviceint
getFreeWorkers(Class<?> remoteInterface)
Returns free workers amount available for tasksprotected RFuture<RemoteServiceRequest>
getTask(String requestId, RMap<String,RemoteServiceRequest> tasks)
<T> void
register(Class<T> remoteInterface, T object)
Register remote service with single worker<T> void
register(Class<T> remoteInterface, T object, int workers)
Register remote service with custom workers amount<T> void
register(Class<T> remoteInterface, T object, int workers, ExecutorService executor)
Register remote service with custom workers amount and executor for running themprotected RFuture<Boolean>
removeAsync(String requestQueueName, RequestId taskId)
-
Methods inherited from class org.redisson.BaseRemoteService
awaitResultAsync, encode, generateRequestId, get, get, get, get, getAckName, getAckName, getMethodSignatures, getRequestQueueName, getResponseQueueName, pollResultResponse, scheduleCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.redisson.api.RRemoteService
get, get, get, get
-
-
-
-
Constructor Detail
-
RedissonRemoteService
public RedissonRemoteService(Codec codec, RedissonClient redisson, String name, CommandExecutor commandExecutor, String executorId, ConcurrentMap<String,ResponseEntry> responses)
-
-
Method Detail
-
addAsync
protected RFuture<Boolean> addAsync(String requestQueueName, RemoteServiceRequest request, RemotePromise<Object> result)
- Specified by:
addAsync
in classBaseRemoteService
-
removeAsync
protected RFuture<Boolean> removeAsync(String requestQueueName, RequestId taskId)
- Specified by:
removeAsync
in classBaseRemoteService
-
register
public <T> void register(Class<T> remoteInterface, T object)
Description copied from interface:RRemoteService
Register remote service with single worker- Specified by:
register
in interfaceRRemoteService
- Type Parameters:
T
- type of remote service- Parameters:
remoteInterface
- - remote service interfaceobject
- - remote service object
-
deregister
public <T> void deregister(Class<T> remoteInterface)
Description copied from interface:RRemoteService
Deregister all workers for remote service- Specified by:
deregister
in interfaceRRemoteService
- Type Parameters:
T
- type of remote service- Parameters:
remoteInterface
- - remote service interface
-
getFreeWorkers
public int getFreeWorkers(Class<?> remoteInterface)
Description copied from interface:RRemoteService
Returns free workers amount available for tasks- Specified by:
getFreeWorkers
in interfaceRRemoteService
- Parameters:
remoteInterface
- - remote service interface- Returns:
- workers amount
-
register
public <T> void register(Class<T> remoteInterface, T object, int workers)
Description copied from interface:RRemoteService
Register remote service with custom workers amount- Specified by:
register
in interfaceRRemoteService
- Type Parameters:
T
- type of remote service- Parameters:
remoteInterface
- - remote service interfaceobject
- - remote service objectworkers
- - workers amount
-
register
public <T> void register(Class<T> remoteInterface, T object, int workers, ExecutorService executor)
Description copied from interface:RRemoteService
Register remote service with custom workers amount and executor for running them- Specified by:
register
in interfaceRRemoteService
- Type Parameters:
T
- type of remote service- Parameters:
remoteInterface
- - remote service interfaceobject
- - remote service objectworkers
- - workers amountexecutor
- - executor service
-
getTask
protected RFuture<RemoteServiceRequest> getTask(String requestId, RMap<String,RemoteServiceRequest> tasks)
-
-