javax.ws.rs.client.RxInvokerProvider Java Examples

The following examples show how to use javax.ws.rs.client.RxInvokerProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebClient.java    From cxf with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({
 "rawtypes", "unchecked"
})
public <T extends RxInvoker> T rx(Class<T> rxCls, ExecutorService executorService) {
    if (CompletionStageRxInvoker.class.isAssignableFrom(rxCls)) {
        return (T)rx(executorService);
    }
    ClientProviderFactory pf =
        ClientProviderFactory.getInstance(WebClient.getConfig(this).getEndpoint());
    RxInvokerProvider rxProvider = pf.getRxInvokerProvider();
    if (rxProvider != null && rxProvider.isProviderFor(rxCls)) {
        return (T)rxProvider.getRxInvoker(sync(), executorService);
    }
    throw new IllegalStateException("Provider for " + rxCls.getName() + " is not available");
}
 
Example #2
Source File: ClientProviderFactory.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
protected void setProviders(boolean custom, boolean busGlobal, Object... providers) {
    List<ProviderInfo<? extends Object>> theProviders =
        prepareProviders(custom, busGlobal, providers, null);
    super.setCommonProviders(theProviders);
    for (ProviderInfo<? extends Object> provider : theProviders) {
        Class<?> providerCls = ClassHelper.getRealClass(getBus(), provider.getProvider());
        if (providerCls == Object.class) {
            // If the provider is a lambda, ClassHelper.getRealClass returns Object.class
            providerCls = provider.getProvider().getClass();
        }
        if (filterContractSupported(provider, providerCls, ClientRequestFilter.class)) {
            addProviderToList(clientRequestFilters, provider);
        }

        if (filterContractSupported(provider, providerCls, ClientResponseFilter.class)) {
            addProviderToList(clientResponseFilters, provider);
        }

        if (ResponseExceptionMapper.class.isAssignableFrom(providerCls)) {
            addProviderToList(responseExceptionMappers, provider);
        }

        if (RxInvokerProvider.class.isAssignableFrom(providerCls)) {
            this.rxInvokerProvider = RxInvokerProvider.class.cast(provider.getProvider());
        }
    }
    Collections.sort(clientRequestFilters,
                     new BindingPriorityComparator(ClientRequestFilter.class, true));
    Collections.sort(clientResponseFilters,
                     new BindingPriorityComparator(ClientResponseFilter.class, false));

    injectContextProxies(responseExceptionMappers, clientRequestFilters, clientResponseFilters);
}
 
Example #3
Source File: ClientProviderFactory.java    From cxf with Apache License 2.0 4 votes vote down vote up
public RxInvokerProvider<?> getRxInvokerProvider() {
    return rxInvokerProvider;
}