001// Licensed under the Apache License, Version 2.0 (the "License"); 002// you may not use this file except in compliance with the License. 003// You may obtain a copy of the License at 004// 005// http://www.apache.org/licenses/LICENSE-2.0 006// 007// Unless required by applicable law or agreed to in writing, software 008// distributed under the License is distributed on an "AS IS" BASIS, 009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 010// See the License for the specific language governing permissions and 011// limitations under the License. 012 013package org.apache.tapestry5; 014 015/** 016 * Callback interface for a {@linkplain org.apache.tapestry5.runtime.Event render phase event} or 017 * 018 * {@link org.apache.tapestry5.runtime.ComponentEvent}, notified when a non-null value is returned from some event 019 * handler method. 020 */ 021public interface ComponentEventCallback<T> 022{ 023 /** 024 * Invoked to handle a non-null event handler method result. The handler should determine whether the value is 025 * acceptable, and throw an exception if not. Any thrown exception will be wrapped to identify the component and 026 * method from which the value was returned. 027 * 028 * Boolean values are <em>not</em> passed to the callback. Booleans are used to indicate that the event has been 029 * handled (true, meaning the event is handled and aborted) or that a further search for handlers should continue 030 * (false, meaning the event was not handled, is not aborted, and the search up the component hierarchy for event 031 * handler methods should continue). If a component event method returns true, then 032 * {@link org.apache.tapestry5.runtime.Event#isAborted()} will return true. 033 * 034 * @param result 035 * the result value returned from the event handler method 036 * @return true if the event is aborted, false if the event may continue 037 */ 038 boolean handleResult(T result); 039}