Class ComponentResultProcessorWrapper
- java.lang.Object
-
- org.apache.tapestry5.internal.services.ComponentResultProcessorWrapper
-
- All Implemented Interfaces:
ComponentEventCallback
,TrackableComponentEventCallback
public class ComponentResultProcessorWrapper extends java.lang.Object implements TrackableComponentEventCallback
A wrapper aroundComponentEventResultProcessor
that encapsulates capturing the exception.
-
-
Constructor Summary
Constructors Constructor Description ComponentResultProcessorWrapper(ComponentEventResultProcessor processor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getResult()
boolean
handleResult(java.lang.Object result)
Invoked to handle a non-null event handler method result.boolean
isAborted()
Returns true ifComponentEventCallback.handleResult(Object)
was invoked, false otherwise.void
rethrow()
If processing a return value threw an IOException, invoking this method will rethrow it.
-
-
-
Constructor Detail
-
ComponentResultProcessorWrapper
public ComponentResultProcessorWrapper(ComponentEventResultProcessor processor)
-
-
Method Detail
-
handleResult
public boolean handleResult(java.lang.Object result)
Description copied from interface:ComponentEventCallback
Invoked to handle a non-null event handler method result. The handler should determine whether the value is acceptable, and throw an exception if not. Any thrown exception will be wrapped to identify the component and method from which the value was returned. Boolean values are not passed to the callback. Booleans are used to indicate that the event has been handled (true, meaning the event is handled and aborted) or that a further search for handlers should continue (false, meaning the event was not handled, is not aborted, and the search up the component hierarchy for event handler methods should continue). If a component event method returns true, thenEvent.isAborted()
will return true.- Specified by:
handleResult
in interfaceComponentEventCallback
- Parameters:
result
- the result value returned from the event handler method- Returns:
- true if the event is aborted, false if the event may continue
-
isAborted
public boolean isAborted()
Returns true ifComponentEventCallback.handleResult(Object)
was invoked, false otherwise.- Specified by:
isAborted
in interfaceTrackableComponentEventCallback
- Returns:
- true if the event was aborted
-
rethrow
public void rethrow() throws java.io.IOException
Description copied from interface:TrackableComponentEventCallback
If processing a return value threw an IOException, invoking this method will rethrow it.- Specified by:
rethrow
in interfaceTrackableComponentEventCallback
- Throws:
java.io.IOException
-
getResult
public java.lang.Object getResult()
-
-