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 skipped. A task can be skipped if the {@link Trigger#skipRun(Future, Date)} 024 * method returns false or if it throws an unchecked exception.<p> 025 * 026 * Use the {@link java.lang.Throwable#getCause()} method to determine if an unchecked exception was 027 * thrown from the Trigger. 028 */ 029 public class SkippedException extends ExecutionException { 030 031 private static final long serialVersionUID = 6962107961025815578L; 032 033 /** 034 * Constructs an SkippedException with <code>null</code> as its detail message. 035 * The cause is not initialized, and may subsequently be initialized by a call to 036 * {@link java.lang.Throwable#initCause(java.lang.Throwable)}. 037 */ 038 public SkippedException() { 039 super(); 040 } 041 042 /** 043 * Constructs an SkippedException exception with the specified detail message.<p> 044 * 045 * The cause is not initialized, and may subsequently be initialized by a call to 046 * {@link java.lang.Throwable#initCause(java.lang.Throwable)}. 047 * 048 * @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method). 049 */ 050 public SkippedException(String message) { 051 super(message); 052 } 053 054 /** 055 * Constructs an SkippedException exception with the specified detail message and cause.<p> 056 * 057 * Note that the detail message associated with cause is not automatically incorporated in 058 * this exception's detail message. 059 * 060 * @param message the detail message (which is saved for later retrieval by the {@link java.lang.Throwable#getMessage()} method). 061 * @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method). 062 * (A null value is permitted, and indicates that the cause is nonexistent or unknown.) 063 */ 064 public SkippedException(String message, Throwable cause) { 065 super(message, cause); 066 } 067 068 /** 069 * Constructs an SkippedException exception with the specified cause and a 070 * detail message of (cause==null ? null : cause.toString()) 071 * (which typically contains the class and detail message of cause). 072 * 073 * @param cause the cause (which is saved for later retrieval by the {@link java.lang.Throwable#getCause()} method). 074 * (A null value is permitted, and indicates that the cause is nonexistent or unknown.) 075 */ 076 public SkippedException(Throwable cause) { 077 super(cause); 078 } 079 080 }