You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/19 10:55:41 UTC

svn commit: r805707 - /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java

Author: mturk
Date: Wed Aug 19 08:55:40 2009
New Revision: 805707

URL: http://svn.apache.org/viewvc?rev=805707&view=rev
Log:
Dummy

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java

Added: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java?rev=805707&view=auto
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java (added)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Signal.java Wed Aug 19 08:55:40 2009
@@ -0,0 +1,113 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.runtime;
+
+/**
+ * Posix signals enumeration.
+ */
+public enum Signal
+{
+
+    /** Unknown signal  */
+    UNKNOWN(    0),
+    /** Hangup (POSIX).  */
+    SIGHUP(     1),
+    /** Interrupt (ANSI).  */
+    SIGINT(     2),
+    /** Quit (POSIX).  */
+    SIGQUIT(    3),
+    /** Illegal instruction (ANSI).  */
+    SIGILL(     4),
+    /** Trace trap (POSIX).  */
+    SIGTRAP(    5),
+    /** Abort (ANSI).  */
+    SIGABRT(    6),
+    /** IOT trap (4.2 BSD).  */
+    SIGIOT(     6),
+    /** BUS error (4.2 BSD).  */
+    SIGBUS(     7),
+    /** Floating-point exception (ANSI).  */
+    SIGFPE(     8),
+    /** Kill, unblockable (POSIX).  */
+    SIGKILL(    9),
+    /** User-defined signal 1 (POSIX).  */
+    SIGUSR1(    10),
+    /** Segmentation violation (ANSI).  */
+    SIGSEGV(    11),
+    /** User-defined signal 2 (POSIX).  */
+    SIGUSR2(    12),
+    /** Broken pipe (POSIX).  */
+    SIGPIPE(    13),
+    /** Alarm clock (POSIX).  */
+    SIGALRM(    14),
+    /** Termination (ANSI).  */
+    SIGTERM(    15),
+    /** Stack fault.  */
+    SIGSTKFLT(  16),
+    /** Child status has changed (POSIX).  */
+    SIGCHLD(    17),
+    /** Continue (POSIX).  */
+    SIGCONT(    18),
+    /** Stop, unblockable (POSIX).  */
+    SIGSTOP(    19),
+    /** Keyboard stop (POSIX).  */
+    SIGTSTP(    20),
+    /** Background read from tty (POSIX).  */
+    SIGTTIN(    21),
+    /** Background write to tty (POSIX).  */
+    SIGTTOU(    22),
+    /** Urgent condition on socket (4.2 BSD).  */
+    SIGURG(     23),
+    /** CPU limit exceeded (4.2 BSD).  */
+    SIGXCPU(    24),
+    /** File size limit exceeded (4.2 BSD).  */
+    SIGXFSZ(    25),
+    /** Virtual alarm clock (4.2 BSD).  */
+    SIGVTALRM(  26),
+    /** Profiling alarm clock (4.2 BSD).  */
+    SIGPROF(    27),
+    /** Window size change (4.3 BSD, Sun).  */
+    SIGWINCH(   28),
+    /** I/O now possible (4.2 BSD).  */
+    SIGIO(      29),
+    /** Power failure restart (System V).  */
+    SIGPWR(     30),
+    /** Bad system call.  */
+    SIGSYS(     31);
+
+
+    private int value;
+    private Signal(int v)
+    {
+        value = v;
+    }
+
+    public int valueOf()
+    {
+        return value;
+    }
+
+    public static Signal valueOf(int value)
+    {
+        for (Signal e : values()) {
+            if (e.value == value)
+                return e;
+        }
+        return UNKNOWN;
+    }
+
+}