org.araneaframework.core
Class BaseApplicationComponent

java.lang.Object
  extended byorg.araneaframework.core.BaseComponent
      extended byorg.araneaframework.core.BaseApplicationComponent
All Implemented Interfaces:
ApplicationComponent, Component, Composite, Serializable, Viewable

public abstract class BaseApplicationComponent
extends BaseComponent
implements ApplicationComponent

A component with support for composite.

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

Nested Class Summary
protected  class BaseApplicationComponent.CompositeComponentImpl
           
protected  class BaseApplicationComponent.ViewableImpl
           
protected  class BaseApplicationComponent.ViewModel
           
 
Nested classes inherited from class org.araneaframework.core.BaseComponent
BaseComponent.ComponentImpl
 
Nested classes inherited from class org.araneaframework.core.ApplicationComponent
ApplicationComponent.ComponentViewModel
 
Nested classes inherited from class org.araneaframework.Component
Component.Interface
 
Nested classes inherited from class org.araneaframework.Composite
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, Composite.Interface
 
Nested classes inherited from class org.araneaframework.Viewable
Viewable.Interface, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget
 
Constructor Summary
BaseApplicationComponent()
           
 
Method Summary
 Composite.Interface _getComposite()
          The factory method returning the implementation of the Composite.
 Viewable.Interface _getViewable()
           
 void addComponent(Object key, Component child)
          Adds a component with the specified key.
 void addComponent(Object key, Component child, Environment env)
          Adds a component with the specified key.
 void disableComponent(Object key)
          Disables the component with the specified key.
 void enableComponent(Object key)
          Enables the component with the specified key.
protected  Environment getChildComponentEnvironment()
          Returns the the Environment of this Component by default.
 Environment getChildEnvironment()
          Get the child Environment of this component.
 Map getChildren()
          Returns a unmodifiable map of all the child components under this Component.
 Environment getEnvironment()
          Provides access to the Environment of this Component.
protected  Object getViewModel()
          Returns the view model.
protected  void propagate(Message message)
          Forwards the message to the component and to all of its children components.
 void relocateComponent(Composite parent, Environment newEnv, Object keyFrom, Object keyTo)
          Relocates parent's child with keyFrom to this component with a new key keyTo.
 void relocateComponent(Composite parent, Object keyFrom, Object keyTo)
          Relocates parent's child with keyFrom to this service with a new key keyTo.
 void removeComponent(Object key)
          Removes the component with the specified key.
 
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, destroy, disable, enable, getScope, handleException, init, 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.Component
_getComponent, getScope, isAlive
 

Constructor Detail

BaseApplicationComponent

public BaseApplicationComponent()
Method Detail

getChildren

public Map getChildren()
Returns a unmodifiable map of all the child components under this Component.

Returns:
a map of child components

_getViewable

public Viewable.Interface _getViewable()
Specified by:
_getViewable in interface Viewable

_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

addComponent

public void addComponent(Object key,
                         Component child,
                         Environment env)
Adds a component with the specified key. Allready initilized component cannot be added. Duplicate keys not allowed. The child is initialized with the Environment env.


addComponent

public void addComponent(Object key,
                         Component child)
Adds a component with the specified key. Allready initilized components cannot be added. Duplicate keys not allowed. The child is initialized with the Environment from getChildComponentEnvironment().

Throws:
Exception

relocateComponent

public void relocateComponent(Composite parent,
                              Environment newEnv,
                              Object keyFrom,
                              Object keyTo)
Relocates parent's child with keyFrom to this component with a new key keyTo. The child will get the Environment specified by newEnv.

Parameters:
parent - is the current parent of the child to be relocated.
newEnv - the new Environment of the child.
keyFrom - is the key of the child to be relocated.
keyTo - is the the key, with which the child will be added to this StandardService.

relocateComponent

public void relocateComponent(Composite parent,
                              Object keyFrom,
                              Object keyTo)
Relocates parent's child with keyFrom to this service with a new key keyTo. The child will get the Environment of this StandardService.

Parameters:
parent - is the current parent of the child to be relocated.
keyFrom - is the key of the child to be relocated.
keyTo - is the the key, with which the child will be added to this StandardService.

enableComponent

public void enableComponent(Object key)
Enables the component with the specified key. Only a disabled componet can be enabled.


disableComponent

public void disableComponent(Object key)
Disables the component with the specified key. Only a enabled component can be disabled.


removeComponent

public void removeComponent(Object key)
Removes the component with the specified key.


propagate

protected void propagate(Message message)
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.

getEnvironment

public Environment getEnvironment()
Description copied from interface: Component
Provides access to the Environment of this Component.

Specified by:
getEnvironment in interface Component
Overrides:
getEnvironment in class BaseComponent

getChildEnvironment

public Environment getChildEnvironment()
Description copied from interface: ApplicationComponent
Get the child Environment of this component.

Specified by:
getChildEnvironment in interface ApplicationComponent

getViewModel

protected Object getViewModel()
                       throws Exception
Returns the view model. Usually overridden.

Throws:
Exception

getChildComponentEnvironment

protected Environment getChildComponentEnvironment()
Returns the the Environment of this Component by default. Usually overridden.