Interface LocalInvocationProcessor
public interface LocalInvocationProcessor
Implements the strategy by which the
Invocation is dispatched to the local Object in memory.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIf theMethodcalled from theInvocationreturns aFutureinstance, this may defined a strategy for handling the result. -
Method Summary
Modifier and TypeMethodDescriptionReturns an instance ofLocalInvocationProcessor.ReturnValueStrategywhich simply blocks until theFutureeither returns or throws an instance ofThrowable.Constructs aLocalInvocationProcessor.ReturnValueStrategywhich ignores the return value and immediately returns anInvocationResultwith a null result.voidprocessInvocation(Object target, Invocation invocation, Consumer<InvocationResult> syncInvocationResultConsumer, Consumer<InvocationError> syncInvocationErrorConsumer, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, Consumer<InvocationError> asyncInvocationErrorConsumer) Performs the dispatch to the supplied object.Constructs aLocalInvocationProcessor.ReturnValueStrategywhich simply hands the result of theInvocationdirectly to a new instance ofInvocationResultand passes it into to the suppliedConsumer
-
Method Details
-
processInvocation
void processInvocation(Object target, Invocation invocation, Consumer<InvocationResult> syncInvocationResultConsumer, Consumer<InvocationError> syncInvocationErrorConsumer, List<Consumer<InvocationResult>> asyncInvocationResultConsumerList, Consumer<InvocationError> asyncInvocationErrorConsumer) Performs the dispatch to the supplied object. Catching and collecting any errors appropriately, and forwarding the result to the suppliedConsumer. This should not throw an exception, ever.- Parameters:
target-invocation-asyncInvocationResultConsumerList-asyncInvocationErrorConsumer-
-
ignoreReturnValueStrategy
Constructs aLocalInvocationProcessor.ReturnValueStrategywhich ignores the return value and immediately returns anInvocationResultwith a null result.- Returns:
- the
LocalInvocationProcessor.ReturnValueStrategywhich passes the result through.
-
simpleReturnValueStrategy
Constructs aLocalInvocationProcessor.ReturnValueStrategywhich simply hands the result of theInvocationdirectly to a new instance ofInvocationResultand passes it into to the suppliedConsumer- Returns:
- the
LocalInvocationProcessor.ReturnValueStrategywhich passes the result through.
-
blockingFutureStrategy
Returns an instance ofLocalInvocationProcessor.ReturnValueStrategywhich simply blocks until theFutureeither returns or throws an instance ofThrowable.- Returns:
- the
LocalInvocationProcessor.ReturnValueStrategywhich blocks until the future finishes
-