org.araneaframework.framework.core
Class BaseFilterWidget

java.lang.Object
  extended byorg.araneaframework.core.BaseComponent
      extended byorg.araneaframework.core.BaseService
          extended byorg.araneaframework.core.BaseWidget
              extended byorg.araneaframework.framework.core.BaseFilterWidget
All Implemented Interfaces:
Component, FilterWidget, Serializable, Service, Widget
Direct Known Subclasses:
NopFilterWidget, SpringOptionalFilterWidget, StandardClientStateFilterWidget, StandardConfirmationFilterWidget, StandardContextMapFilterWidget, StandardFilterChainWidget, StandardMessagingFilterWidget, StandardPopupFilterWidget, StandardRedirectingFilterWidget, StandardRenderStatusResettingFilterWidget, StandardTransactionFilterWidget, StandardUpdateRegionFilterWidget, StandardWidgetAdapterService, StandardWindowScrollPositionFilterWidget

public class BaseFilterWidget
extends BaseWidget
implements FilterWidget

A filter widget is a Widget which filters requests to its child widget. A filter overrides one of the methods:

and does the filtering by allowing the action to be invoked on the child or not. This class is a skeleton which lets all the requests through, sets the child, handles the initilization and destroying of the child.

The child is initialized with getChildWidgetEnvironment() which by default returns this component's Environment. For alternate environments it should be overridden.

Author:
"Toomas Römer"
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.araneaframework.core.BaseWidget
BaseWidget.WidgetImpl
 
Nested classes inherited from class org.araneaframework.core.BaseService
BaseService.ServiceImpl
 
Nested classes inherited from class org.araneaframework.core.BaseComponent
BaseComponent.ComponentImpl
 
Nested classes inherited from class org.araneaframework.Widget
Widget.Interface
 
Field Summary
protected  Widget childWidget
           
 
Fields inherited from class org.araneaframework.core.BaseService
currentInputData, currentOutputData
 
Constructor Summary
BaseFilterWidget()
           
BaseFilterWidget(Widget childWidget)
           
 
Method Summary
protected  void action(Path path, InputData input, OutputData output)
          Services provide their services through the action(...) method.
protected  void destroy()
          Destroy callback.
protected  void event(Path path, InputData input)
           
 Widget getChildWidget()
           
protected  Environment getChildWidgetEnvironment()
          By default returns the widget's Environment.
protected  void init()
          Init callback.
protected  void propagate(Message message)
          Forwards the message to the component and to all of its children components.
protected  void render(OutputData output)
           
 void setChildWidget(Widget childWidget)
          Sets the child to childWidget.
protected  void update(InputData input)
           
 
Methods inherited from class org.araneaframework.core.BaseWidget
_getWidget, getInputData, getOutputData, handleWidgetException
 
Methods inherited from class org.araneaframework.core.BaseService
_getService, handleServiceException
 
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, getEnvironment, getScope, handleException, isAlive, isDead, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.araneaframework.Widget
_getWidget
 
Methods inherited from interface org.araneaframework.Service
_getService
 
Methods inherited from interface org.araneaframework.Component
_getComponent, getEnvironment, getScope, isAlive
 

Field Detail

childWidget

protected Widget childWidget
Constructor Detail

BaseFilterWidget

public BaseFilterWidget()

BaseFilterWidget

public BaseFilterWidget(Widget childWidget)
Method Detail

setChildWidget

public void setChildWidget(Widget childWidget)
Sets the child to childWidget.

Specified by:
setChildWidget in interface FilterWidget

getChildWidget

public Widget getChildWidget()

init

protected void init()
             throws Exception
Description copied from class: BaseComponent
Init callback. Gets called when the component is initilized.

Overrides:
init in class BaseComponent
Throws:
Exception - Any runtime exception that may occur.

propagate

protected void propagate(Message message)
                  throws Exception
Description copied from class: BaseComponent
Forwards the message to the component and to all of its children components.

Overrides:
propagate in class BaseComponent
Parameters:
message - A message to forward.
Throws:
Exception - Any runtime exception that may occur.

action

protected void action(Path path,
                      InputData input,
                      OutputData output)
               throws Exception
Description copied from class: BaseService
Services provide their services through the action(...) method. An implementation of a non-composite service like BaseService uses the action method to hook in the middle of the action routing and provide filtering, logging etc.

Overrides:
action in class BaseService
Parameters:
path - The path of the component to whom the action is targeted.
input - The request data.
output - The response data.
Throws:
Exception - Any runtime exception that may occur.

update

protected void update(InputData input)
               throws Exception
Overrides:
update in class BaseWidget
Throws:
Exception

event

protected void event(Path path,
                     InputData input)
              throws Exception
Overrides:
event in class BaseWidget
Throws:
Exception

render

protected void render(OutputData output)
               throws Exception
Overrides:
render in class BaseWidget
Throws:
Exception

destroy

protected void destroy()
                throws Exception
Description copied from class: BaseComponent
Destroy callback. Gets called when the component is destroyed.

Overrides:
destroy in class BaseComponent
Throws:
Exception - Any runtime exception that may occur.

getChildWidgetEnvironment

protected Environment getChildWidgetEnvironment()
By default returns the widget's Environment. The child is initilized with the return value of this method.