org.araneaframework.framework.container
Class ExceptionHandlingFlowContainerWidget
java.lang.Object
org.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.core.BaseWidget
org.araneaframework.core.BaseApplicationWidget
org.araneaframework.framework.container.StandardFlowContainerWidget
org.araneaframework.framework.container.ExceptionHandlingFlowContainerWidget
- All Implemented Interfaces:
- Serializable, Component, Composite, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, ApplicationComponent, ApplicationService, ApplicationWidget, FlowContext, FlowContextWidget, Service, Viewable, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget
- Direct Known Subclasses:
- BaseMenuWidget, OverlayRootWidget.OverlayFlowContainer
public abstract class ExceptionHandlingFlowContainerWidget
- extends StandardFlowContainerWidget
This flow container widget also handles any exceptions that may occur during
any child widget processing. Any sub-class will have to provide
implementation for the
renderExceptionHandler(OutputData, Exception) method, that
allows custom handling for given exception. To define the page that renders
the exception to the user, one can use following solution:
ServletUtil.include("/WEB-INF/jsp/error.jsp", this, output);
The page would be rendered as any other page inside this container.
Also note that this widget declares three events in its init()
method to let users handle the situation:
- retry - retries to process the last event;
- cancel - cancels the last event;
- reset - resets the entire flow context of this container widget.
If you wish to use these events, make sure that when you override the
init() method, also include the super.init();
line to that method.
- Author:
- Jevgeni Kabanov (ekabanov at araneaframework dot org)
- See Also:
- Serialized Form
|
Field Summary |
protected Exception |
exception
The exception that occurs is stored in this variable. |
|
Method Summary |
protected void |
event(Path path,
InputData input)
Overrides the event() functionality to catch and handle
exceptions. |
void |
handleEventCancel()
Handles the cancel event. |
void |
handleEventReset()
Handles the reset event. |
void |
handleEventRetry()
Handles the retry event. |
protected void |
handleWidgetException(Exception e)
A widget specific handling of an exception. |
protected void |
init()
Initializes the widget and declares three events to let users handle the
situation:
retry - retries to process the last event;
cancel - cancels the last event;
reset - resets the entire flow context of this container widget.
If you wish to use these events, and you override the init()
method, also include the super.init(); line to that method. |
protected void |
propagate(Message message)
Overrides the propagate() functionality to catch and handle
exceptions. |
protected void |
render(OutputData output)
Overrides the render() functionality to catch and handle
exceptions. |
protected abstract void |
renderExceptionHandler(OutputData output,
Exception e)
This method lets sub-classes implement their way to handle and display this
exception. |
protected void |
update(InputData input)
Overrides the update() functionality to catch and handle
exceptions. |
| Methods inherited from class org.araneaframework.framework.container.StandardFlowContainerWidget |
addFrameWidget, addNestedEnvironmentEntry, cancel, destroy, doCancel, doFinish, doReplace, doReset, doStart, doTransition, finish, getActiveCallFrame, getActiveFlow, getCallStack, getChildWidgetEnvironment, getCurrentReference, getTransitionHandler, isNested, makeCallFrame, putLocalEnvironmentEntries, replace, replace, reset, setFinishable, setTop, setTransitionHandler, start, start, start |
| Methods inherited from class org.araneaframework.core.BaseApplicationWidget |
_getComposite, _getViewable, action, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, disableWidget, enableWidget, getActionId, getChildEnvironment, getChildren, getEnvironment, getEventId, getViewModel, getWidget, handleAction, handleEvent, handleUpdate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, setGlobalEventListener |
| Methods inherited from class org.araneaframework.core.BaseComponent |
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, disable, enable, getScope, handleException, isAlive, isDead, isInitialized |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exception
protected Exception exception
- The exception that occurs is stored in this variable.
ExceptionHandlingFlowContainerWidget
public ExceptionHandlingFlowContainerWidget()
- Initializes the flow container.
ExceptionHandlingFlowContainerWidget
public ExceptionHandlingFlowContainerWidget(Widget topWidget)
- Initializes the flow container, and specifies the
topWidget
as its parent.
- Parameters:
topWidget - a parent widget.
init
protected void init()
throws Exception
- Initializes the widget and declares three events to let users handle the
situation:
- retry - retries to process the last event;
- cancel - cancels the last event;
- reset - resets the entire flow context of this container widget.
If you wish to use these events, and you override the init()
method, also include the super.init(); line to that method.
- Overrides:
init in class StandardFlowContainerWidget
- Throws:
Exception - Any non-specific exception that may occur.
handleEventRetry
public void handleEventRetry()
throws Exception
- Handles the
retry event.
- Throws:
Exception - Any non-specific exception that may occur.
handleEventCancel
public void handleEventCancel()
throws Exception
- Handles the
cancel event.
- Throws:
Exception - Any non-specific exception that may occur.
handleEventReset
public void handleEventReset()
throws Exception
- Handles the
reset event.
- Throws:
Exception - Any non-specific exception that may occur.
handleWidgetException
protected void handleWidgetException(Exception e)
throws Exception
- A widget specific handling of an exception.
- Overrides:
handleWidgetException in class BaseWidget
- Throws:
Exception
update
protected void update(InputData input)
throws Exception
- Overrides the
update() functionality to catch and handle
exceptions.
- Overrides:
update in class BaseApplicationWidget
- Throws:
Exception
event
protected void event(Path path,
InputData input)
throws Exception
- Overrides the
event() functionality to catch and handle
exceptions.
- Overrides:
event in class BaseApplicationWidget
- Throws:
Exception
propagate
protected void propagate(Message message)
throws Exception
- Overrides the
propagate() functionality to catch and handle
exceptions.
- Overrides:
propagate in class BaseApplicationWidget
- Parameters:
message - A message to forward.
- Throws:
Exception - Any runtime exception that may occur.
render
protected void render(OutputData output)
throws Exception
- Overrides the
render() functionality to catch and handle
exceptions.
- Overrides:
render in class StandardFlowContainerWidget
- Throws:
Exception
renderExceptionHandler
protected abstract void renderExceptionHandler(OutputData output,
Exception e)
throws Exception
- This method lets sub-classes implement their way to handle and display this
exception. To define the page that renders the exception to the user, one
can use following solution:
ServletUtil.include("/WEB-INF/jsp/error.jsp", this, output);
- Parameters:
output - output data.e - the exception that occur.
- Throws:
Exception - Any non-specific exception that may occur.