001package com.nimbusds.common.jsonrpc2;
002
003
004import com.thetransactioncompany.jsonrpc2.server.RequestHandler;
005
006
007/**
008 * JSON-RPC 2.0 request handler with lifecycle. Extends the basic request 
009 * handler interface by providing a {@link #start} method for initialising and 
010 * allocating resources, such as database connections, and a {@link #stop} 
011 * method for freeing them when the handler is to be shut down.
012 */
013public interface RequestHandlerWithLifecycle extends RequestHandler {
014        
015        
016        /**
017         * Starts the request handler.
018         *
019         * @throws Exception If the request handler couldn't be started.
020         */
021        void start() throws Exception;
022        
023        
024        /**
025         * Stops the request handler.
026         *
027         * @throws Exception If an exception was encountered.
028         */
029        void stop() throws Exception;
030}