View Javadoc

1   /*
2    * Copyright 2004-2005, University Health Network.  All rights reserved. Distributed under the BSD 
3    * license (see http://opensource.org/licenses/bsd-license.php).
4    *  
5    * ChunkBasedCacheException.java
6    *
7    * Created on 13-Dec-2004 at 4:30:48 PM
8    */
9   package ca.uhn.cache.exception;
10  
11  import ca.uhn.cache.IQuery;
12  import ca.uhn.cache.IQueryResult;
13  
14  
15  /***
16   * Thrown when an error occurs while storing the association 
17   * of an <code>IQueryResult</code> with an <code>IQuery</code>.  
18   * 
19   * @author <a href="mailto:alexei.guevara@uhn.on.ca">Alexei Guevara</a>
20   * @version $Revision: 1.1 $ updated on $Date: 2005/01/24 22:53:02 $ by $Author: bryan_tripp $
21   */
22  public class QueryResultStorageCacheException extends CacheException {
23  
24      private final IQuery myQuery;
25      private final IQueryResult myQueryResult;
26  
27      /***
28       * {@inheritDoc} 
29       */
30      public QueryResultStorageCacheException( Throwable theCause, IQuery theQuery, IQueryResult theQueryResult ) {
31          this( "Error while storing association of query with query result", theCause, theQuery, theQueryResult );
32      }
33  
34      /***
35       * {@inheritDoc}
36       */
37      public QueryResultStorageCacheException( 
38              String theMessage, Throwable theCause, IQuery theQuery, IQueryResult theQueryResult ) {
39          
40          super( theMessage, theCause );
41          myQuery = theQuery;
42          myQueryResult = theQueryResult;
43          
44      }
45  
46      /***
47       * @return Returns the query.
48       */
49      public IQuery getQuery() {
50          return myQuery;
51      }
52      /***
53       * @return Returns the queryResult.
54       */
55      public IQueryResult getQueryResult() {
56          return myQueryResult;
57      }
58  }