From: <bra...@us...> - 2008-06-20 01:43:28
|
Revision: 2297 http://archive-access.svn.sourceforge.net/archive-access/?rev=2297&view=rev Author: bradtofel Date: 2008-06-19 18:43:37 -0700 (Thu, 19 Jun 2008) Log Message: ----------- REFACTOR: moving error rendering responsibility to separate interface, and out of ReplayRenderer. Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/ExceptionRenderer.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/ExceptionRenderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/ExceptionRenderer.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/ExceptionRenderer.java 2008-06-20 01:43:37 UTC (rev 2297) @@ -0,0 +1,59 @@ +/* ExceptionRenderer + * + * $Id$ + * + * Created on 6:26:05 PM Jun 10, 2008. + * + * Copyright (C) 2008 Internet Archive. + * + * This file is part of wayback. + * + * wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package org.archive.wayback; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.archive.wayback.core.WaybackRequest; +import org.archive.wayback.exception.WaybackException; + +/** + * Implementors are responsible for drawing errors. + * + * @author brad + * @version $Date$, $Revision$ + */ +public interface ExceptionRenderer { + /** + * Render the contents of a WaybackException in either html, javascript, or + * css format, depending on the guessed context, so errors in embedded + * documents do not cause unneeded errors in the embedding document. + * + * @param httpRequest + * @param httpResponse + * @param wbRequest + * @param exception + * @throws ServletException + * @throws IOException + */ + public void renderException(HttpServletRequest httpRequest, + HttpServletResponse httpResponse, WaybackRequest wbRequest, + WaybackException exception) + throws ServletException, IOException; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |