001    // Copyright 2010 The Apache Software Foundation
002    //
003    // Licensed under the Apache License, Version 2.0 (the "License");
004    // you may not use this file except in compliance with the License.
005    // You may obtain a copy of the License at
006    //
007    // http://www.apache.org/licenses/LICENSE-2.0
008    //
009    // Unless required by applicable law or agreed to in writing, software
010    // distributed under the License is distributed on an "AS IS" BASIS,
011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012    // See the License for the specific language governing permissions and
013    // limitations under the License.
014    
015    package org.apache.tapestry5;
016    
017    import java.io.IOException;
018    
019    import org.apache.tapestry5.annotations.Environmental;
020    import org.apache.tapestry5.services.ComponentEventResultProcessor;
021    import org.apache.tapestry5.services.Traditional;
022    
023    /**
024     * Extends {@link ComponentEventCallback} with a way to determine if the underlying event has been aborted
025     * due to a some event returning an acceptable, non-null value. The standard implementation of this
026     * is a wrapper around either the {@linkplain Traditional traditional} or
027     * {@linkplain org.apache.tapestry5.services.Ajax ajax} versions of the {@link ComponentEventResultProcessor}
028     * service, i.e., they allow for a navigational result.
029     * <p>
030     * Instances of this are made available via the {@link Environmental} annotation.
031     * 
032     * @since 5.2.0
033     */
034    public interface TrackableComponentEventCallback<T> extends ComponentEventCallback<T>
035    {
036        /**
037         * Returns true if a return value from an event handler method was processed.
038         */
039        boolean isAborted();
040    
041        /**
042         * If processing a return value threw an IOException, invoking this method will rethrow it.
043         */
044        void rethrow() throws IOException;
045    }