view src/main/java/net/borgac/clusterrpc/client/OutgoingFilter.java @ 7:0c24a0ee0c34

Lay groundwork for filter stack
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 24 Sep 2016 16:47:46 +0200
parents
children 7da0ba664d74
line wrap: on
line source

package net.borgac.clusterrpc.client;

/**
 * OutgoingFilters are used to influence the behavior of outgoing RPCs.
 *
 * An outgoing RPC is given to the first filter, which can modify the request;
 * after doing its work, it gives the request to the next filter down the stack
 * until the final SendFilter is encountered, which sends the request.
 *
 * After a response has been received, it goes up through the stack of filters,
 * which then can modify or act on the response (for example, retry a failed
 * request or log something).
 *
 * @author lbo
 */
public interface OutgoingFilter {

    /**
     * Set the filter that this filter will call.
     *
     * @param inner
     */
    void setInner(OutgoingFilter inner);

    public Response go(Request request);
}