emul/mini/src/main/java/java/lang/InterruptedException.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 26 Jan 2013 08:47:05 +0100
changeset 592 5e13b1ac2886
parent 49 0a115f1c6f3c
permissions -rw-r--r--
In order to support fields of the same name in subclasses we are now prefixing them with name of the class that defines them. To provide convenient way to access them from generated bytecode and also directly from JavaScript, there is a getter/setter function for each field. It starts with _ followed by the field name. If called with a parameter, it sets the field, with a parameter it just returns it.
jaroslav@49
     1
/*
jaroslav@49
     2
 * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
jaroslav@49
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@49
     4
 *
jaroslav@49
     5
 * This code is free software; you can redistribute it and/or modify it
jaroslav@49
     6
 * under the terms of the GNU General Public License version 2 only, as
jaroslav@49
     7
 * published by the Free Software Foundation.  Oracle designates this
jaroslav@49
     8
 * particular file as subject to the "Classpath" exception as provided
jaroslav@49
     9
 * by Oracle in the LICENSE file that accompanied this code.
jaroslav@49
    10
 *
jaroslav@49
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@49
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@49
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jaroslav@49
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@49
    15
 * accompanied this code).
jaroslav@49
    16
 *
jaroslav@49
    17
 * You should have received a copy of the GNU General Public License version
jaroslav@49
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@49
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@49
    20
 *
jaroslav@49
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@49
    22
 * or visit www.oracle.com if you need additional information or have any
jaroslav@49
    23
 * questions.
jaroslav@49
    24
 */
jaroslav@49
    25
jaroslav@49
    26
package java.lang;
jaroslav@49
    27
jaroslav@49
    28
/**
jaroslav@49
    29
 * Thrown when a thread is waiting, sleeping, or otherwise occupied,
jaroslav@49
    30
 * and the thread is interrupted, either before or during the activity.
jaroslav@49
    31
 * Occasionally a method may wish to test whether the current
jaroslav@49
    32
 * thread has been interrupted, and if so, to immediately throw
jaroslav@49
    33
 * this exception.  The following code can be used to achieve
jaroslav@49
    34
 * this effect:
jaroslav@49
    35
 * <pre>
jaroslav@49
    36
 *  if (Thread.interrupted())  // Clears interrupted status!
jaroslav@49
    37
 *      throw new InterruptedException();
jaroslav@49
    38
 * </pre>
jaroslav@49
    39
 *
jaroslav@49
    40
 * @author  Frank Yellin
jaroslav@49
    41
 * @see     java.lang.Object#wait()
jaroslav@49
    42
 * @see     java.lang.Object#wait(long)
jaroslav@49
    43
 * @see     java.lang.Object#wait(long, int)
jaroslav@49
    44
 * @see     java.lang.Thread#sleep(long)
jaroslav@49
    45
 * @see     java.lang.Thread#interrupt()
jaroslav@49
    46
 * @see     java.lang.Thread#interrupted()
jaroslav@49
    47
 * @since   JDK1.0
jaroslav@49
    48
 */
jaroslav@49
    49
public
jaroslav@49
    50
class InterruptedException extends Exception {
jaroslav@49
    51
    private static final long serialVersionUID = 6700697376100628473L;
jaroslav@49
    52
jaroslav@49
    53
    /**
jaroslav@49
    54
     * Constructs an <code>InterruptedException</code> with no detail  message.
jaroslav@49
    55
     */
jaroslav@49
    56
    public InterruptedException() {
jaroslav@49
    57
        super();
jaroslav@49
    58
    }
jaroslav@49
    59
jaroslav@49
    60
    /**
jaroslav@49
    61
     * Constructs an <code>InterruptedException</code> with the
jaroslav@49
    62
     * specified detail message.
jaroslav@49
    63
     *
jaroslav@49
    64
     * @param   s   the detail message.
jaroslav@49
    65
     */
jaroslav@49
    66
    public InterruptedException(String s) {
jaroslav@49
    67
        super(s);
jaroslav@49
    68
    }
jaroslav@49
    69
}