Clover coverage report - Code Coverage for hivemind release 1.0-beta-1
Coverage timestamp: Sat Jul 3 2004 09:41:37 EDT
file stats: LOC: 81   Methods: 8
NCLOC: 45   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ApplicationRuntimeException.java - 100% 100% 100%
coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 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 implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind;
 16   
 
 17   
 /**
 18   
  *  General wrapper for any exception (normal or runtime) that may occur during
 19   
  *  runtime processing for the application.  This is exception is used
 20   
  *  when the intent is to communicate a low-level failure to the user or
 21   
  *  developer; it is not expected to be caught.  The {@link #getRootCause() rootCause}
 22   
  *  property is a <em>nested</em> exception.
 23   
  *
 24   
  *  @author Howard Lewis Ship
 25   
  */
 26   
 
 27   
 public class ApplicationRuntimeException extends RuntimeException implements Locatable
 28   
 {
 29   
     private Throwable _rootCause;
 30   
     private transient Location _location;
 31   
     private transient Object _component;
 32   
 
 33  2
     public ApplicationRuntimeException(Throwable rootCause)
 34   
     {
 35  2
         this(rootCause.getMessage(), rootCause);
 36   
     }
 37   
 
 38  36
     public ApplicationRuntimeException(String message)
 39   
     {
 40  36
         this(message, null, null, null);
 41   
     }
 42   
 
 43  23
     public ApplicationRuntimeException(String message, Throwable rootCause)
 44   
     {
 45  23
         this(message, null, null, rootCause);
 46   
     }
 47   
 
 48  76
     public ApplicationRuntimeException(
 49   
         String message,
 50   
         Object component,
 51   
         Location location,
 52   
         Throwable rootCause)
 53   
     {
 54  76
         super(message);
 55   
 
 56  76
         _rootCause = rootCause;
 57  76
         _component = component;
 58   
 
 59  76
         _location = HiveMind.findLocation(new Object[] { location, rootCause, component });
 60   
     }
 61   
 
 62  5
     public ApplicationRuntimeException(String message, Location location, Throwable rootCause)
 63   
     {
 64  5
         this(message, null, location, rootCause);
 65   
     }
 66   
 
 67  5
     public Throwable getRootCause()
 68   
     {
 69  5
         return _rootCause;
 70   
     }
 71   
 
 72  11
     public Location getLocation()
 73   
     {
 74  11
         return _location;
 75   
     }
 76   
 
 77  7
     public Object getComponent()
 78   
     {
 79  7
         return _component;
 80   
     }
 81   
 }