1 55 package org.apache.avalon.framework.service; 56 57 import org.apache.avalon.framework.CascadingException; 58 59 66 public class ServiceException 67 extends CascadingException 68 { 69 private final String m_key; 70 71 78 public ServiceException( final String message, final Throwable throwable ) 79 { 80 this( null, message, throwable ); 81 } 82 83 90 public ServiceException( final String key, final String message, final Throwable throwable ) 91 { 92 super( message, throwable ); 93 m_key = key; 94 } 95 96 102 public ServiceException( final String message ) 103 { 104 this( null, message, null ); 105 } 106 107 113 public ServiceException( final String key, final String message ) 114 { 115 this( key, message, null ); 116 } 117 118 122 public String getKey() 123 { 124 return m_key; 125 } 126 127 133 public String getRole() 134 { 135 return getKey(); 136 } 137 138 142 public String getMessage() 143 { 144 if( m_key == null ) 145 { 146 return super.getMessage(); 147 } 148 else 149 { 150 return super.getMessage() + " (Key='" + m_key + "')"; 151 } 152 } 153 } 154 | Popular Tags |