View Javadoc

1   /* 
2    * Copyright 2002-2004 The Apache Software Foundation
3    * Licensed  under the  Apache License,  Version 2.0  (the "License");
4    * you may not use  this file  except in  compliance with the License.
5    * You may obtain a copy of the License at 
6    * 
7    *   http://www.apache.org/licenses/LICENSE-2.0
8    * 
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed  under the  License is distributed on an "AS IS" BASIS,
11   * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
12   * implied.
13   * 
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.struts.flow.core.source;
18  
19  import java.io.IOException;
20  
21  /***
22   * This Exception is thrown every time there is a problem in processing
23   * a source.
24   *
25   * @author <a href="mailto:dev@avalon.apache.org">Avalon Development Team</a>
26   * @version CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:26 $
27   */
28  public class SourceException
29      extends IOException 
30  {
31      /***
32       * The Throwable that caused this exception to be thrown.
33       */
34      private final Throwable m_throwable;
35  
36      /***
37       * Construct a new <code>SourceException</code> instance.
38       *
39       * @param message the detail message for this exception.
40       */
41      public SourceException( final String message )
42      {
43          this( message, null );
44      }
45  
46      /***
47       * Construct a new <code>SourceException</code> instance.
48       *
49       * @param message the detail message for this exception.
50       * @param throwable the root cause of the exception.
51       */
52      public SourceException( final String message, final Throwable throwable )
53      {
54          super( message  );
55          m_throwable = throwable;
56      }
57      
58      /***
59       * Retrieve the cause of the exception.
60       *
61       * @return the cause.
62       */
63      public final Throwable getCause()
64      {
65          return m_throwable;
66      }
67  }