org.araneaframework.core
Class RelocatableDecorator
java.lang.Object
org.araneaframework.core.BaseComponent
org.araneaframework.core.BaseService
org.araneaframework.core.RelocatableDecorator
- All Implemented Interfaces:
- ApplicationComponent, ApplicationService, ApplicationWidget, Component, Composite, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, Relocatable, Relocatable.RelocatableComponent, Relocatable.RelocatableService, Relocatable.RelocatableWidget, Serializable, Service, Viewable, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget
- public class RelocatableDecorator
- extends BaseService
- implements Serializable, Relocatable.RelocatableService, Relocatable.RelocatableWidget, ApplicationService, ApplicationWidget
A decorator to make a service relocatable. A relocatable service can be moved
from one parent to another, and the relocatable service will have access to
the right Environment. The Environment of the
decorator is swappable.
- Author:
- "Toomas Römer" , Jevgeni Kabanov (ekabanov at araneaframework dot org)
- See Also:
- Serialized Form
|
Field Summary |
protected Service |
child
The child service that is made relocatable. |
| 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 |
child
protected Service child
- The child service that is made relocatable.
RelocatableDecorator
public RelocatableDecorator(Service child)
- Constructs a new
RelocatableDecorator and sets its child
service to child.
- Parameters:
child - The service that should be relocatable.
_getRelocatable
public Relocatable.Interface _getRelocatable()
- Description copied from interface:
Relocatable
- This method must provide a
Relocatable.Interface that will
be used to change the Environment of the relocatable
component/service/widget.
- Specified by:
_getRelocatable in interface Relocatable
- Returns:
- An implementation of
Relocatable.Interface.
setChildService
public void setChildService(Service child)
- Sets the child service of this component.
- Parameters:
child - The service that should be relocatable.
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.
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.
getChildEnvironment
public Environment getChildEnvironment()
- Description copied from interface:
ApplicationComponent
- Get the child Environment of this component.
- Specified by:
getChildEnvironment in interface ApplicationComponent
_getComposite
public Composite.Interface _getComposite()
- Description copied from interface:
Composite
- The factory method returning the implementation of the Composite.
- Specified by:
_getComposite in interface Composite
- Returns:
- the Composite implementation
_getViewable
public Viewable.Interface _getViewable()
- Specified by:
_getViewable in interface Viewable
_getWidget
public Widget.Interface _getWidget()
- Specified by:
_getWidget in interface Widget