Interface RoutingStrategy
- All Known Implementing Classes:
AbstractAggregateRoutingStrategy
,BroadcastRoutingStrategy
,DefaultRoutingStrategy
,ListAggregateRoutingStrategy
,SameNodeIdRoutingStrategy
public interface RoutingStrategy
A
RoutingStrategy
relies on the RemoteInvokerRegistry
and address data to route an Invocation
to a specific RemoteInvoker
based on the addressing parameters in the method that is invoked.-
Method Summary
Modifier and TypeMethodDescriptioninvokeAsync
(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method returning aAsyncOperation
for the value.default Void
invokeAsyncV
(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method asynchronously returning aVoid
(ie null) for the value.invokeFuture
(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) invokeSync
(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method, blocking until it returns on the remote end.
-
Method Details
-
invokeFuture
Future<Object> invokeFuture(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method returning aFuture<Object>
with the result. Corresponds toRemoteInvoker.invokeFuture(Invocation, List, InvocationErrorConsumer)
.- Parameters:
address
- the addressinvocation
- theInvocation
asyncInvocationResultConsumerList
- the list ofConsumer<InvocationResult>
instancesasyncInvocationErrorConsumer
- theInvocationErrorConsumer
to receive the error of the invocation- Returns:
- the
Future<Object>
to handle the return value
-
invokeAsyncV
default Void invokeAsyncV(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method asynchronously returning aVoid
(ie null) for the value.- Parameters:
address
- the addressinvocation
- theInvocation
asyncInvocationResultConsumerList
- the list ofConsumer<InvocationResult>
instancesasyncInvocationErrorConsumer
- theInvocationErrorConsumer
to receive the error of the invocation- Returns:
- null
-
invokeAsync
AsyncOperation invokeAsync(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) Invokes the method returning aAsyncOperation
for the value.- Parameters:
address
- the addressinvocation
- theInvocation
asyncInvocationResultConsumerList
- the list ofConsumer<InvocationResult>
instancesasyncInvocationErrorConsumer
- theInvocationErrorConsumer
to receive the error of the invocation- Returns:
- an instance of
AsyncOperation
-
invokeSync
Object invokeSync(List<Object> address, Invocation invocation, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, InvocationErrorConsumer asyncInvocationErrorConsumer) throws Exception Invokes the method, blocking until it returns on the remote end. Corresponds toRemoteInvoker.invokeFuture(Invocation, List, InvocationErrorConsumer)
.- Parameters:
address
- the addressinvocation
- theInvocation
asyncInvocationResultConsumerList
- the list ofConsumer<InvocationResult>
instancesasyncInvocationErrorConsumer
- theInvocationErrorConsumer
to receive the error of the invocation- Returns:
- the return value of the remote invocation
- Throws:
Exception
-