/*
 * @(#)TelnetTaskFailedEvent.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */

package com.jscape.inet.telnet;

import java.util.EventObject;

/**
 * Fired when a <code>TelnetTask</code> has failed to complete
 *
 * @see TelnetTask
 */
public class TelnetTaskFailedEvent
        extends EventObject {

    private TelnetTask task = null;
    private Exception exception = null;

    /**
     * Creates a new instance of TelnetTaskFailedEvent.
     *
     * @param source    the source of the event
     * @param task      the <code>TelnetTask</code> that has failed
     * @param exception the source of this exception
     *
     * @see TelnetTask
     */
    public TelnetTaskFailedEvent(Object source, TelnetTask task, Exception exception) {
        super(source);
        this.task = task;
        this.exception = exception;
    }

    /**
     * Gets the TelnetTask that has failed.
     *
     * @return a <code>TelnetTask</code>
     */
    public TelnetTask getTask() {
        return task;
    }

    /**
     * Gets the exception that caused the TelnetTask to fail.
     *
     * @return the exception
     */
    public Exception getException() {
        return exception;
    }

}
