Search in sources :

Example 1 with AsyncInvocationInterceptorFactory

use of org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory in project quarkus by quarkusio.

the class QuarkusRestClientBuilder method register.

@Override
public RestClientBuilder register(Object o, int i) {
    if (o instanceof ResponseExceptionMapper) {
        // local
        ResponseExceptionMapper mapper = (ResponseExceptionMapper) o;
        HashMap<Class<?>, Integer> contracts = new HashMap<>();
        contracts.put(ResponseExceptionMapper.class, i);
        registerLocalProviderInstance(mapper, contracts);
        // delegate
        builderDelegate.register(mapper, i);
    } else if (o instanceof ParamConverterProvider) {
        // local
        ParamConverterProvider converter = (ParamConverterProvider) o;
        HashMap<Class<?>, Integer> contracts = new HashMap<>();
        contracts.put(ParamConverterProvider.class, i);
        registerLocalProviderInstance(converter, contracts);
        // delegate
        builderDelegate.register(converter, i);
    } else if (o instanceof AsyncInvocationInterceptorFactory) {
        invocationInterceptorFactories.add((AsyncInvocationInterceptorFactory) o);
    } else {
        builderDelegate.register(o, i);
    }
    return this;
}
Also used : HashMap(java.util.HashMap) ResponseExceptionMapper(org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper) DefaultResponseExceptionMapper(org.jboss.resteasy.microprofile.client.DefaultResponseExceptionMapper) ParamConverterProvider(jakarta.ws.rs.ext.ParamConverterProvider) AsyncInvocationInterceptorFactory(org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory)

Example 2 with AsyncInvocationInterceptorFactory

use of org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory in project quarkus by quarkusio.

the class QuarkusRestClientBuilder method register.

@Override
public RestClientBuilder register(Object o) {
    if (o instanceof ResponseExceptionMapper) {
        ResponseExceptionMapper mapper = (ResponseExceptionMapper) o;
        register(mapper, mapper.getPriority());
    } else if (o instanceof ParamConverterProvider) {
        register(o, Priorities.USER);
    } else if (o instanceof AsyncInvocationInterceptorFactory) {
        invocationInterceptorFactories.add((AsyncInvocationInterceptorFactory) o);
    } else {
        builderDelegate.register(o);
    }
    return this;
}
Also used : ResponseExceptionMapper(org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper) DefaultResponseExceptionMapper(org.jboss.resteasy.microprofile.client.DefaultResponseExceptionMapper) ParamConverterProvider(jakarta.ws.rs.ext.ParamConverterProvider) AsyncInvocationInterceptorFactory(org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory)

Aggregations

ParamConverterProvider (jakarta.ws.rs.ext.ParamConverterProvider)2 AsyncInvocationInterceptorFactory (org.eclipse.microprofile.rest.client.ext.AsyncInvocationInterceptorFactory)2 ResponseExceptionMapper (org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper)2 DefaultResponseExceptionMapper (org.jboss.resteasy.microprofile.client.DefaultResponseExceptionMapper)2 HashMap (java.util.HashMap)1