org.araneaframework.framework.container
Class StandardServiceAdapterWidget

java.lang.Object
  extended byorg.araneaframework.core.BaseComponent
      extended byorg.araneaframework.core.BaseService
          extended byorg.araneaframework.core.BaseWidget
              extended byorg.araneaframework.framework.container.StandardServiceAdapterWidget
All Implemented Interfaces:
Component, Serializable, Service, Widget

public class StandardServiceAdapterWidget
extends BaseWidget

A widget that contains a child service. Calls the service's action only if it gets an event.

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
static String ACTION_PATH_INPUT_DATA_PARAMETER
           
 
Fields inherited from class org.araneaframework.core.BaseService
currentInputData, currentOutputData
 
Constructor Summary
StandardServiceAdapterWidget()
           
 
Method Summary
protected  void destroy()
          Destroy callback.
 void event(Path path, InputData input)
           
protected  Path getActionPath(InputData input)
          Returns the path of action from the InputData.
protected  void init()
          Init callback.
protected  void propagate(Message message)
          Forwards the message to the component and to all of its children components.
 void render(OutputData output)
          Calls child service's action only if an event was received.
 void setChildService(Service service)
          Set the child service.
 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, action, 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.Service
_getService
 
Methods inherited from interface org.araneaframework.Component
_getComponent, getEnvironment, getScope, isAlive
 

Field Detail

ACTION_PATH_INPUT_DATA_PARAMETER

public static final String ACTION_PATH_INPUT_DATA_PARAMETER
See Also:
Constant Field Values
Constructor Detail

StandardServiceAdapterWidget

public StandardServiceAdapterWidget()
Method Detail

setChildService

public void setChildService(Service service)
Set the child service.


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.

getActionPath

protected Path getActionPath(InputData input)
Returns the path of action from the InputData. Uses the ACTION_PATH_INPUT_DATA_PARAMETER to get the path.


update

public void update(InputData input)
Overrides:
update in class BaseWidget

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.

event

public void event(Path path,
                  InputData input)
Overrides:
event in class BaseWidget

render

public void render(OutputData output)
            throws Exception
Calls child service's action only if an event was received. The action path is constructed via getActionPath(InputData). The InputData is saved in the update(InputData) method. TODO: why is it in render and not in event() ?

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.