Search in sources :

Example 1 with ThrottledClient

use of jaxrs.examples.client.custom.ThrottledClient in project jaxrs-api by eclipse-ee4j.

the class SpecExamples method clientBootstrapping.

public void clientBootstrapping() {
    // Default client instantiation using default configuration
    Client defaultClient = ClientBuilder.newClient();
    defaultClient.property("CUSTOM_PROPERTY", "CUSTOM_VALUE");
    assert defaultClient != null;
    // Default client instantiation using custom configuration
    Client defaultConfiguredClient = ClientBuilder.newClient(defaultClient.getConfiguration());
    assert defaultConfiguredClient != null;
    // /////////////////////////////////////////////////////////
    // Custom client instantiation examples
    ThrottledClient myClient = new ThrottledClient();
    assert myClient != null;
    ThrottledClient myConfiguredClient = new ThrottledClient(10);
    assert myConfiguredClient != null;
}
Also used : ThrottledClient(jaxrs.examples.client.custom.ThrottledClient) Client(jakarta.ws.rs.client.Client) ThrottledClient(jaxrs.examples.client.custom.ThrottledClient)

Example 2 with ThrottledClient

use of jaxrs.examples.client.custom.ThrottledClient in project jaxrs-api by eclipse-ee4j.

the class BasicExamples method clientBootstrapping.

@SuppressWarnings("UnusedDeclaration")
public void clientBootstrapping() {
    // Default client instantiation using default configuration
    Client defaultClient = ClientBuilder.newClient();
    assert defaultClient != null;
    defaultClient.property("CUSTOM_PROPERTY", "CUSTOM_VALUE");
    // Default client instantiation using custom configuration
    Client defaultConfiguredClient = ClientBuilder.newClient(defaultClient.getConfiguration());
    assert defaultConfiguredClient != null;
    // /////////////////////////////////////////////////////////
    // Custom client instantiation examples
    ThrottledClient myClient = new ThrottledClient();
    ThrottledClient myConfiguredClient = new ThrottledClient(10);
}
Also used : ThrottledClient(jaxrs.examples.client.custom.ThrottledClient) Client(jakarta.ws.rs.client.Client) ThrottledClient(jaxrs.examples.client.custom.ThrottledClient)

Aggregations

Client (jakarta.ws.rs.client.Client)2 ThrottledClient (jaxrs.examples.client.custom.ThrottledClient)2