Java Code Examples for javax.ws.rs.client.WebTarget#property()

The following examples show how to use javax.ws.rs.client.WebTarget#property() . 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: VespaJerseyJaxRsClientFactory.java    From vespa with Apache License 2.0 5 votes vote down vote up
@Override
public <T> T createClient(Params<T> params) {
    WebTarget target = client.target(params.uri());
    target.property(ClientProperties.CONNECT_TIMEOUT, (int) params.connectTimeout().toMillis());
    target.property(ClientProperties.READ_TIMEOUT, (int) params.readTimeout().toMillis());
    return WebResourceFactory.newResource(params.apiClass(), target);
}
 
Example 2
Source File: JerseyJaxRsClientFactory.java    From vespa with Apache License 2.0 5 votes vote down vote up
@Override
public <T> T createClient(Params<T> params) {
    WebTarget target = client.target(params.uri());
    target.property(ClientProperties.CONNECT_TIMEOUT, (int) params.connectTimeout().toMillis());
    target.property(ClientProperties.READ_TIMEOUT, (int) params.readTimeout().toMillis());
    return WebResourceFactory.newResource(params.apiClass(), target);
}
 
Example 3
Source File: SigningTest.java    From resteasy-examples with Apache License 2.0 5 votes vote down vote up
@Test
public void testProxy() throws Exception
{
   WebTarget target = client.target("http://localhost:9095");
   target.property(KeyRepository.class.getName(), repository);
   SigningProxy proxy = ((ResteasyWebTarget) target).proxy(SigningProxy.class);
   String output = proxy.hello();
   proxy.postSimple("hello world");
}
 
Example 4
Source File: CheckingWebTarget.java    From raml-tester with Apache License 2.0 5 votes vote down vote up
public CheckingWebTarget(RamlChecker checker, WebTarget target) {
    this.checker = checker;
    this.target = target;
    if (target.getConfiguration().getProperty("checked") != null) {
        throw new IllegalStateException("This WebTarget is already checking");
    }
    target.property("checked", true);
    target.register(new CheckingClientFilter(this));
}