Class DirectDelegate<A,S>
- java.lang.Object
-
- org.gcube.common.clients.delegates.AbstractDelegate<A,S,EndpointConfig<A,S>>
-
- org.gcube.common.clients.delegates.DirectDelegate<A,S>
-
- Type Parameters:
A- the of service addressesS- the type of service proxies
- All Implemented Interfaces:
ProxyDelegate<S>
public final class DirectDelegate<A,S> extends AbstractDelegate<A,S,EndpointConfig<A,S>> implements ProxyDelegate<S>
AProxyDelegatethat sendsCalls to service endpoints at known addresses.This is a no-op
ProxyDelegate, i.e. it executes theCallinterface and converts its faults. It exists to support uniform programming against theProxyDelegateinterface.- Author:
- Fabio Simeoni
-
-
Constructor Summary
Constructors Constructor Description DirectDelegate(EndpointConfig<A,S> config)Creates an instance with aProxyPluginand an endpoint address.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> Vmake(Call<S,V> call)Makes aCallto a given service endpoint.-
Methods inherited from class org.gcube.common.clients.delegates.AbstractDelegate
config, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.gcube.common.clients.delegates.ProxyDelegate
config
-
-
-
-
Constructor Detail
-
DirectDelegate
public DirectDelegate(EndpointConfig<A,S> config)
Creates an instance with aProxyPluginand an endpoint address.- Parameters:
plugin- the pluginaddress- the address
-
-
Method Detail
-
make
public <V> V make(Call<S,V> call) throws Exception
Description copied from interface:ProxyDelegateMakes aCallto a given service endpoint.- Specified by:
makein interfaceProxyDelegate<A>- Type Parameters:
V- 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
-
-