Class DirectDelegate<A,​S>

  • Type Parameters:
    A - the of service addresses
    S - 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>
    A ProxyDelegate that sends Calls to service endpoints at known addresses.

    This is a no-op ProxyDelegate, i.e. it executes the Call interface and converts its faults. It exists to support uniform programming against the ProxyDelegate interface.

    Author:
    Fabio Simeoni
    • Constructor Detail

      • DirectDelegate

        public DirectDelegate​(EndpointConfig<A,​S> config)
        Creates an instance with a ProxyPlugin and an endpoint address.
        Parameters:
        plugin - the plugin
        address - the address
    • Method Detail

      • make

        public <V> V make​(Call<S,​V> call)
                   throws Exception
        Description copied from interface: ProxyDelegate
        Makes a Call to a given service endpoint.
        Specified by:
        make in interface ProxyDelegate<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