001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package javax.util.concurrent;
018    
019    import java.util.concurrent.ExecutionException;
020    
021    /**
022     * Exception indicating that the result of a value-producing task, cannot be retrieved because the
023     * task run was aborted.<p>
024     *
025     * Use the {@link java.lang.Throwable#getCause()} method to determine why the task aborted.
026     */
027    public class AbortedException extends ExecutionException {
028    
029        private static final long serialVersionUID = 8313294757663362709L;
030    
031        /**
032         * Constructs an AbortedException with <code>null</code> as its detail message.
033         * The cause is not initialized, and may subsequently be initialized by a call to
034         * {@link java.lang.Throwable#initCause(java.lang.Throwable)}.
035         */
036        public AbortedException() {
037            super();
038        }
039    
040        /**
041         * Constructs an AbortedException exception with the specified detail message and cause.<p>
042         *
043         * Note that the detail message associated with cause is not automatically incorporated in
044         * this exception's detail message.
045         *
046         * @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method).
047         * @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method).
048         * (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
049         */
050        public AbortedException(String message, Throwable cause) {
051            super(message, cause);
052        }
053    
054        /**
055         * Constructs an AbortedException exception with the specified detail message.<p>
056         *
057         * The cause is not initialized, and may subsequently be initialized by a call to
058         * {@link java.lang.Throwable#initCause(java.lang.Throwable)}.
059         *
060         * @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method).
061         */
062        public AbortedException(String message) {
063            super(message);
064        }
065    
066        /**
067         * Constructs an AbortedException exception with the specified cause and a
068         * detail message of (cause==null ? null : cause.toString())
069         * (which typically contains the class and detail message of cause).
070         *
071         * @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method).
072         * (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
073         */
074        public AbortedException(Throwable cause) {
075            super(cause);
076        }
077    
078    }