public RX rx(final ExecutorService executorService) {
return rx(invokerType, executorService);
}
private <CX extends RxInvoker> CX rx(final Class<CX> customType, final ExecutorService executor) {
final RxInvokerProvider provider = PROVIDER_MAP.get(customType);
RxInvoker customInvoker = null;
if (provider == null) {
for (final RxInvokerProvider invokerProvider : INVOKER_PROVIDERS) {
customInvoker = invokerProvider.getInvoker(customType, builder, executor);
if (customInvoker != null) {
PROVIDER_MAP.put(customType, invokerProvider);
break;
}
}
} else {
customInvoker = provider.getInvoker(customType, builder, executor);
}
return customType.cast(customInvoker);
}