001 /* 002 * Copyright (c) 2003, The Regents of the University of California, through 003 * Lawrence Berkeley National Laboratory (subject to receipt of any required 004 * approvals from the U.S. Dept. of Energy). All rights reserved. 005 */ 006 package gov.lbl.dsd.sea.event; 007 008 import gov.lbl.dsd.sea.Stage; 009 010 /** 011 * A runtime exception similar in spirit to the classic 012 * {@link java.lang.IllegalArgumentException}, to be thrown when 013 * {@link gov.lbl.dsd.sea.EventHandler#handle(java.lang.Object)} cannot handle an event of a certain kind. 014 * Useful, since most EventHandlers cannot handle arbitrary objects but can only 015 * handle events of certain classes with certain parameter constraints. 016 * <p> 017 * If appropriate, you can enqueue an instance of this class onto a stage. 018 * 019 * @author whoschek@lbl.gov 020 * @author $Author: hoschek3 $ 021 * @version $Revision: 1.2 $, $Date: 2004/05/21 20:34:11 $ 022 */ 023 public class IllegalEventException extends ExceptionEvent { 024 025 /** 026 * Constructs a new exception with the specified detail message and causing 027 * event. 028 * 029 * @param causingEvent 030 * the event that caused the exception. 031 * @param source 032 * the stage that could not properly handle the causing event. 033 */ 034 public IllegalEventException(Object causingEvent, Stage source) { 035 super(causingEvent, source); 036 } 037 038 /** 039 * Constructs a new exception with the specified detail message and causing 040 * event. 041 * 042 * @param message 043 * the detail message. The detail message is saved for later 044 * retrieval by the {@link #getMessage()}method. 045 * @param causingEvent 046 * the event that caused the exception. 047 * @param source 048 * the stage that could not properly handle the causing event. 049 */ 050 public IllegalEventException(String message, Object causingEvent, Stage source) { 051 super(message, null, causingEvent, source); 052 } 053 054 }