View Javadoc

1   /**
2    * - Digitalis Internal Framework v2.0 -
3    *
4    * (C) 2007, Digitalis Informatica.
5    *
6    * Distribuicao e Gestao de Informatica, Lda.
7    * Estrada de Paco de Arcos num.9 - Piso -1
8    * 2780-666 Paco de Arcos
9    * Telefone: (351) 21 4408990
10   * Fax: (351) 21 4408999
11   * http://www.digitalis.pt
12   */
13  package pt.digitalis.dif.exception;
14  
15  import pt.digitalis.dif.controller.interfaces.IDIFContext;
16  
17  /**
18   * Represents an internal framework Exception. The execution context is passed into the exception.
19   *
20   * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a>
21   * @created 2007/03/16
22   * @see DIFException
23   */
24  public class InternalFrameworkException extends DIFException {
25  
26      /** Serial Version ID. */
27      private static final long serialVersionUID = 1120934514453714926L;
28  
29      /** The execution context. */
30      private IDIFContext difContext;
31  
32      /**
33       * Constructs a new InternalFrameworkException from an Exception.
34       *
35       * @param exception
36       *            the exception to encapsulate
37       * @param difContext
38       *            the execution context
39       */
40      public InternalFrameworkException(Exception exception, IDIFContext difContext) {
41          super(exception);
42          this.difContext = difContext;
43      }
44  
45      /**
46       * Constructs a new InternalFrameworkException from a reason for the exception.
47       *
48       * @param reason
49       *            the exception cause
50       * @param difContext
51       *            the execution context
52       */
53      public InternalFrameworkException(String reason, IDIFContext difContext) {
54          super(reason);
55          this.difContext = difContext;
56      }
57  
58      /**
59       * Constructs a new InternalFrameworkException accepting a reason for the exception
60       *
61       * @param reason
62       *            the exception cause
63       * @param exception
64       *            the exception to encapsulate
65       * @param difContext
66       *            the execution context
67       */
68      public InternalFrameworkException(String reason, Exception exception, IDIFContext difContext) {
69          super(reason, exception);
70          this.difContext = difContext;
71      }
72  
73      /**
74       * Returns the stored DIFContext.
75       *
76       * @return the difContext
77       */
78      public IDIFContext getDIFContext() {
79          return difContext;
80      }
81  
82      /**
83       * Sets the DIFContext content.
84       *
85       * @param difContext
86       *            the difContext to set
87       */
88      public void setDifContext(IDIFContext difContext) {
89          this.difContext = difContext;
90      }
91  }