| 1 |
/* |
| 2 |
* Copyright (c) 2013 Jean Niklas L'orange. All rights reserved. |
| 3 |
* |
| 4 |
* The use and distribution terms for this software are covered by the |
| 5 |
* Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) |
| 6 |
* which can be found in the file LICENSE at the root of this distribution. |
| 7 |
* |
| 8 |
* By using this software in any fashion, you are agreeing to be bound by |
| 9 |
* the terms of this license. |
| 10 |
* |
| 11 |
* You must not remove this notice, or any other, from this software. |
| 12 |
*/ |
| 13 |
|
| 14 |
package com.hypirion.io; |
| 15 |
|
| 16 |
/** |
| 17 |
* <code>SignalInterceptorException</code>s are thrown if the {@link |
| 18 |
* SignalInterceptor} class is unable to find the signal attempted to intercept, |
| 19 |
* or if the JVM doesn't implement the most common JVM signal handling |
| 20 |
* facilities. |
| 21 |
* |
| 22 |
* @author Jean Niklas L'orange |
| 23 |
* @since <code>com.hypirion.io 0.3.0</code> |
| 24 |
*/ |
| 25 |
|
| 26 |
public class SignalInterceptorException extends Exception { |
| 27 |
|
| 28 |
/** |
| 29 |
* The name of the signal attempted to intercept, with <code>SIG</code> |
| 30 |
* omitted. |
| 31 |
*/ |
| 32 |
public final String signame; |
| 33 |
|
| 34 |
/** |
| 35 |
* Creates a new <code>SignalInterceptorException</code> where |
| 36 |
* <code>signal</code> is the attempted signal to intercept, with |
| 37 |
* <code>cause</code> as underlying reason for not being able to do so. |
| 38 |
*/ |
| 39 |
public SignalInterceptorException(String signal, Throwable cause) { |
| 40 |
super(String.format("Unable to register for SIG%s", signal), cause); |
| 41 |
signame = signal; |
| 42 |
} |
| 43 |
} |