All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.barchart.http.request.RequestHandler Maven / Gradle / Ivy

There is a newer version: 1.1.6
Show newest version
/**
 * Copyright (C) 2011-2013 Barchart, Inc. 
 *
 * All rights reserved. Licensed under the OSI BSD License.
 *
 * http://www.opensource.org/licenses/bsd-license.php
 */
package com.barchart.http.request;

import java.io.IOException;

/**
 * Inbound request handler.
 */
public interface RequestHandler {

	/**
	 * Called when a new request is received from the client.
	 */
	public void onRequest(ServerRequest request, ServerResponse response)
			throws IOException;

	/**
	 * Called when the request encounters an exception, either in the pipeline
	 * or as part of async processing.
	 */
	public void onException(ServerRequest request, ServerResponse response,
			Throwable exception);

	/**
	 * Called when the client disconnects before the response is completed.
	 * Attempting to write to the response object after this method has been
	 * called will always throw exceptions.
	 */
	public void onAbort(ServerRequest request, ServerResponse response);

	/**
	 * Called when the current request is completed. This method will always be
	 * called, even if the request is aborted or an exception is thrown, so
	 * should not be taken as an indication of request success or failure.
	 */
	public void onComplete(ServerRequest request, ServerResponse response);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy