javax.ws.rs.client.SyncInvoker Java Examples

The following examples show how to use javax.ws.rs.client.SyncInvoker. 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 Project: aries-jax-rs-whiteboard   Author: apache   File: PromiseRxInvokerProviderImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public PromiseRxInvoker getRxInvoker(
    SyncInvoker syncInvoker, ExecutorService executorService) {

    PromiseFactory promiseFactory;

    if (executorService != null) {
        promiseFactory = new PromiseFactory(executorService);
    }
    else {
        promiseFactory = new PromiseFactory(
            PromiseFactory.inlineExecutor());
    }

    return new PromiseRxInvokerImpl(((SyncInvokerImpl) syncInvoker).getWebClient(), promiseFactory);
}
 
Example #2
Source Project: quarkus   Author: quarkusio   File: MultiRxInvokerImpl.java    License: Apache License 2.0 5 votes vote down vote up
public MultiRxInvokerImpl(final SyncInvoker syncInvoker, final ExecutorService executorService) {
    if (!(syncInvoker instanceof ClientInvocationBuilder)) {
        throw new ProcessingException("Expected a ClientInvocationBuilder");
    }
    this.syncInvoker = (ClientInvocationBuilder) syncInvoker;
    if (executorService instanceof ScheduledExecutorService) {
        this.executorService = (ScheduledExecutorService) executorService;
    }
}
 
Example #3
Source Project: quarkus   Author: quarkusio   File: UniInvokerProvider.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public UniRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    if (syncInvoker instanceof ClientInvocationBuilder) {
        ClientInvocationBuilder builder = (ClientInvocationBuilder) syncInvoker;
        CompletionStageRxInvoker completionStageRxInvoker = builder.rx();
        return new UniRxInvokerImpl(completionStageRxInvoker);
    } else {
        throw new ProcessingException("Expected a ClientInvocationBuilder");
    }
}
 
Example #4
Source Project: cxf   Author: apache   File: ObservableRxInvokerProvider.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public ObservableRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    // TODO: At the moment we still delegate if possible to the async HTTP conduit.
    // Investigate if letting the RxJava thread pool deal with the sync invocation
    // is indeed more effective
    return new ObservableRxInvokerImpl(((SyncInvokerImpl)syncInvoker).getWebClient(), executorService);
}
 
Example #5
Source Project: pandaria   Author: JakimLi   File: HttpMethods.java    License: MIT License 4 votes vote down vote up
static Method get() {
    return context -> in(context).request(SyncInvoker::get);
}
 
Example #6
Source Project: pandaria   Author: JakimLi   File: HttpMethods.java    License: MIT License 4 votes vote down vote up
static Method delete() {
    return context -> in(context).request(SyncInvoker::delete);
}
 
Example #7
Source Project: pandaria   Author: JakimLi   File: HttpMethods.java    License: MIT License 4 votes vote down vote up
static Method head() {
    return context -> in(context).request(SyncInvoker::head);
}
 
Example #8
Source Project: pandaria   Author: JakimLi   File: HttpMethods.java    License: MIT License 4 votes vote down vote up
static Method options() {
    return context -> in(context).request(SyncInvoker::options);
}
 
Example #9
Source Project: pandaria   Author: JakimLi   File: HttpMethods.java    License: MIT License 4 votes vote down vote up
static Method trace() {
    return context -> in(context).request(SyncInvoker::trace);
}
 
Example #10
Source Project: quarkus   Author: quarkusio   File: MultiInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public MultiRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new MultiRxInvokerImpl(syncInvoker, executorService);
}
 
Example #11
Source Project: alchemy   Author: RentTheRunway   File: ResourceTest.java    License: MIT License 4 votes vote down vote up
protected ResourceAssertionBuilder put(String url, String... pathParams) {
    return new ResourceAssertionBuilder(SyncInvoker::put, resource(url, pathParams));
}
 
Example #12
Source Project: alchemy   Author: RentTheRunway   File: ResourceTest.java    License: MIT License 4 votes vote down vote up
protected ResourceAssertionBuilder post(String url, String ... pathParams) {
    return new ResourceAssertionBuilder(SyncInvoker::post, resource(url, pathParams));
}
 
Example #13
Source Project: cxf   Author: apache   File: WebClient.java    License: Apache License 2.0 4 votes vote down vote up
public SyncInvoker sync() {
    return new SyncInvokerImpl(this);
}
 
Example #14
Source Project: cxf   Author: apache   File: FlowableRxInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public FlowableRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new FlowableRxInvokerImpl(syncInvoker, executorService);
}
 
Example #15
Source Project: cxf   Author: apache   File: FlowableRxInvokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
public FlowableRxInvokerImpl(SyncInvoker syncInvoker, ExecutorService ex) {
    this.syncInvoker = syncInvoker;
    this.sc = ex == null ? null : Schedulers.from(ex);
}
 
Example #16
Source Project: cxf   Author: apache   File: ObservableRxInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ObservableRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new ObservableRxInvokerImpl(syncInvoker, executorService);
}
 
Example #17
Source Project: cxf   Author: apache   File: ObservableRxInvokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
public ObservableRxInvokerImpl(SyncInvoker syncInvoker, ExecutorService ex) {
    this.syncInvoker = syncInvoker;
    this.sc = ex == null ? null : Schedulers.from(ex);
}
 
Example #18
Source Project: cxf   Author: apache   File: FlowableRxInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public FlowableRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new FlowableRxInvokerImpl(syncInvoker, executorService);
}
 
Example #19
Source Project: cxf   Author: apache   File: FlowableRxInvokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
public FlowableRxInvokerImpl(SyncInvoker syncInvoker, ExecutorService ex) {
    this.syncInvoker = syncInvoker;
    this.sc = ex == null ? null : Schedulers.from(ex);
}
 
Example #20
Source Project: cxf   Author: apache   File: ObservableRxInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ObservableRxInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new ObservableRxInvokerImpl(syncInvoker, executorService);
}
 
Example #21
Source Project: cxf   Author: apache   File: ObservableRxInvokerImpl.java    License: Apache License 2.0 4 votes vote down vote up
public ObservableRxInvokerImpl(SyncInvoker syncInvoker, ExecutorService ex) {
    this.syncInvoker = syncInvoker;
    this.sc = ex == null ? null : Schedulers.from(ex);
}
 
Example #22
Source Project: cxf   Author: apache   File: ReactorInvokerProvider.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public ReactorInvoker getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
    return new ReactorInvokerImpl(((SyncInvokerImpl)syncInvoker).getWebClient(), executorService);
}