1 /** 2007, Digitalis Informatica. All rights reserved. 2 * 3 * Distribuicao e Gestao de Informatica, Lda. 4 * Estrada de Paco de Arcos num.9 - Piso -1 5 * 2780-666 Paco de Arcos 6 * Telefone: (351) 21 4408990 7 * Fax: (351) 21 4408999 8 * http://www.digitalis.pt 9 */ 10 11 package pt.digitalis.dif.exception; 12 13 import java.util.Map; 14 15 /** 16 * Defines the behavior associated with an exception with context. 17 * 18 * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a><br/> 19 * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a><br/> 20 * @created 2007/11/27 21 */ 22 public interface IContextException { 23 24 /** 25 * Adds a new element to the exception context. 26 * 27 * @param key 28 * the element's key 29 * @param value 30 * the element's value 31 */ 32 public void addToExceptionContext(String key, Object value); 33 34 /** 35 * Sets the exception context. 36 * 37 * @param exceptionContext 38 * a pre-built exception context 39 */ 40 public void setExceptionContext(Map<String, Object> exceptionContext); 41 42 /** 43 * Returns the exception context. 44 * 45 * @return the exception context 46 */ 47 public Map<String, Object> getExceptionContext(); 48 49 /** 50 * Renders the exception context. 51 * 52 * @return a String with the rendered context. 53 */ 54 public String getRenderedExceptionContext(); 55 }