001package com.thetransactioncompany.jsonrpc2.server; 002 003 004import com.thetransactioncompany.jsonrpc2.JSONRPC2Request; 005import com.thetransactioncompany.jsonrpc2.JSONRPC2Response; 006 007 008/** 009 * Interface for handling JSON-RPC 2.0 requests. 010 * 011 * @author Vladimir Dzhuvinov 012 */ 013public interface RequestHandler { 014 015 016 /** 017 * Gets the names of the handled JSON-RPC 2.0 request methods. 018 * 019 * @return The names of the handled JSON-RPC 2.0 request methods. 020 */ 021 public String[] handledRequests(); 022 023 024 /** 025 * Processes a JSON-RPC 2.0 request. 026 * 027 * @param request A valid JSON-RPC 2.0 request instance. Must not be 028 * {@code null}. 029 * @param requestCtx Context information about the request message, may 030 * be {@code null} if undefined. 031 * 032 * @return The resulting JSON-RPC 2.0 response. It indicates success 033 * or an error, such as METHOD_NOT_FOUND. 034 */ 035 public JSONRPC2Response process(final JSONRPC2Request request, final MessageContext requestCtx); 036}