Search in sources :

Example 1 with ResponseWorker

use of org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker in project ovirt-engine by oVirt.

the class JsonRpcUtils method getJsonClient.

private static JsonRpcClient getJsonClient(Reactor reactor, String hostName, int port, ClientPolicy connectionPolicy, ClientPolicy clientPolicy, int parallelism, ScheduledExecutorService executorService) throws ClientConnectionException {
    final ReactorClient client = reactor.createClient(hostName, port);
    client.setClientPolicy(connectionPolicy);
    ResponseWorker worker = ReactorFactory.getWorker(parallelism);
    JsonRpcClient jsonClient = worker.register(client);
    jsonClient.setRetryPolicy(clientPolicy);
    jsonClient.setExecutorService(executorService);
    return jsonClient;
}
Also used : ReactorClient(org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient) ResponseWorker(org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker) JsonRpcClient(org.ovirt.vdsm.jsonrpc.client.JsonRpcClient)

Aggregations

JsonRpcClient (org.ovirt.vdsm.jsonrpc.client.JsonRpcClient)1 ResponseWorker (org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker)1 ReactorClient (org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient)1