org.gcube.common.clients
Class PassThroughClient<S,E>

java.lang.Object
  extended by org.gcube.common.clients.PassThroughClient<S,E>
Type Parameters:
S - the type of the services
All Implemented Interfaces:
Client<S>

public class PassThroughClient<S,E>
extends Object
implements Client<S>

A Client that sends Calls to services at known endpoints,

Author:
Fabio Simeoni

Constructor Summary
PassThroughClient(ServiceProvider<S,E> provider, E endpoint, EndpointCache<E> cache)
          Creates an instance with a ServiceProvider and an endpoint.
 
Method Summary
<R> R
make(Call<S,R> call)
          Makes a Call to the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassThroughClient

public PassThroughClient(ServiceProvider<S,E> provider,
                         E endpoint,
                         EndpointCache<E> cache)
Creates an instance with a ServiceProvider and an endpoint.

Parameters:
provider - information about the service
endpoint - the endpoint
Method Detail

make

public <R> R make(Call<S,R> call)
       throws Exception
Makes a Call to the service.

Specified by:
make in interface Client<S>
Type Parameters:
R - the type of the value returned from the call
Parameters:
call - the call
Returns:
the value returned from the call
Throws:
Exception - if the call fails


Copyright © 2012. All Rights Reserved.