Class DiscoveryDelegate<A,S>
- java.lang.Object
-
- org.gcube.common.clients.delegates.AbstractDelegate<A,S,DiscoveryConfig<A,S>>
-
- org.gcube.common.clients.delegates.DiscoveryDelegate<A,S>
-
- Type Parameters:
A- the type of service addressesS- the type of service stubs
- All Implemented Interfaces:
ProxyDelegate<S>
public class DiscoveryDelegate<A,S> extends AbstractDelegate<A,S,DiscoveryConfig<A,S>>
AProxyDelegatethat discovers service endpoints.The delegates attempt to make
Calls to endpoints cached in anEndpointCache. If the calls fail, or the cache is empty, they execute aQueryfor endpoints and call the results in turn until the call succeeds or there are no more endpoints to call. If the call succeeds with one endpoint, the delegates cache the endpoint in theEndpointCache.- Author:
- Fabio Simeoni
- See Also:
Query,EndpointCache
-
-
Constructor Summary
Constructors Constructor Description DiscoveryDelegate(DiscoveryConfig<A,S> config)
-
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
-
-
-
-
Constructor Detail
-
DiscoveryDelegate
public DiscoveryDelegate(DiscoveryConfig<A,S> config)
- Parameters:
plugin- the pluginquery- the querycache- the cache
-
-
Method Detail
-
make
public <V> V make(Call<S,V> call) throws Exception
Description copied from interface:ProxyDelegateMakes aCallto a given service endpoint.- 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
-
-