static <A extends Address> DriftMethodInvocation<A> createDriftMethodInvocation( MethodInvoker invoker, MethodMetadata metadata, Map<String, String> headers, List<Object> parameters, RetryPolicy retryPolicy, AddressSelector<A> addressSelector, Optional<String> addressSelectionContext, MethodInvocationStat stat, Ticker ticker) { DriftMethodInvocation<A> invocation = new DriftMethodInvocation<>( invoker, metadata, headers, parameters, retryPolicy, addressSelector, addressSelectionContext, stat, ticker); // invocation can not be started from constructor, because it may start threads that can call back into the unpublished object invocation.nextAttempt(true); return invocation; }
static <A extends Address> DriftMethodInvocation<A> createDriftMethodInvocation( MethodInvoker invoker, MethodMetadata metadata, Map<String, String> headers, List<Object> parameters, RetryPolicy retryPolicy, AddressSelector<A> addressSelector, Optional<String> addressSelectionContext, MethodInvocationStat stat, Ticker ticker) { DriftMethodInvocation<A> invocation = new DriftMethodInvocation<>( invoker, metadata, headers, parameters, retryPolicy, addressSelector, addressSelectionContext, stat, ticker); // invocation can not be started from constructor, because it may start threads that can call back into the unpublished object invocation.nextAttempt(true); return invocation; }