|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.araneaframework.core.BaseComponent
public class BaseComponent
The base class for all Aranea components. Base entities do not make a Composite pattern and only provide some very basic services (mainly syncronization and messaging service)
| Nested Class Summary | |
|---|---|
protected class |
BaseComponent.ComponentImpl
|
| Nested classes/interfaces inherited from interface org.araneaframework.Component |
|---|
Component.Interface |
| Constructor Summary | |
|---|---|
BaseComponent()
|
|
| Method Summary | |
|---|---|
protected void |
_addComponent(Object key,
Component component,
Environment env)
Adds a child component to this component with the key and initilizes it with the specified Environment env. |
protected void |
_addComponent(Object key,
Component component,
Scope scope,
Environment env)
Adds a child component to this component with the key and initilizes it with the specified Environment env. |
protected void |
_checkCall()
Checks if this component was initialized. |
protected void |
_disableComponent(Object key)
Disables the child component with the specified key. |
protected void |
_enableComponent(Object key)
Enables a disabled child component with the specified key. |
protected void |
_endCall()
Decrements the call count. |
protected void |
_endWaitingCall()
Decrements internal callcount counter. |
protected Map |
_getChildren()
Returns the children of this component. |
Component.Interface |
_getComponent()
The factory method returning the implementation of the Component. |
protected Map |
_getDisabledChildren()
Returns the children of this component. |
protected void |
_propagate(Message message)
Forwards the message to the component and to all of its
children components. |
protected void |
_relocateComponent(Composite parent,
Environment newEnv,
Object keyFrom,
Object keyTo)
Relocates parent's child with keyFrom to this BaseComponent with a new key keyTo. |
protected void |
_removeComponent(Object key)
Removes the child component with the specified key from the children and calls destroy on it. |
protected void |
_setEnvironment(Environment env)
Sets the environment of this component to env. |
protected void |
_setScope(Scope scope)
Sets the scope for this component. |
protected void |
_startCall()
Checks if a call is valid (component is in the required state), increments the call count. |
protected void |
_startWaitingCall()
Used for starting a call that is a re-entrant call. |
protected void |
_strictCheckCall()
Checks if this component is currently alive. |
protected void |
_strictStartCall()
|
protected void |
_waitNoCall()
Waits until no call is made to the component. |
protected void |
destroy()
Destroy callback. |
protected void |
disable()
Disables the component. |
protected void |
enable()
Enables the component. |
Environment |
getEnvironment()
Provides access to the Environment of this
Component. |
Scope |
getScope()
Provides the scope of this Component. |
protected void |
handleException(Exception e)
Handles any given exception. |
protected void |
init()
Init callback. |
boolean |
isAlive()
Specifies whether this Component is alive. |
boolean |
isDead()
Specifies whether the component is dead. |
boolean |
isInitialized()
Gets whether the component has been initialized. |
protected void |
propagate(Message message)
Forwards the message to the component and to all of its
children components. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseComponent()
| Method Detail |
|---|
public Component.Interface _getComponent()
Component
_getComponent in interface Component
protected void init()
throws Exception
Exception - Any runtime exception that may occur.
protected void destroy()
throws Exception
Exception - Any runtime exception that may occur.
protected void disable()
throws Exception
Exception - Any runtime exception that may occur.
protected void enable()
throws Exception
Exception - Any runtime exception that may occur.
protected void propagate(Message message)
throws Exception
message to the component and to all of its
children components.
message - A message to forward.
Exception - Any runtime exception that may occur.
protected void handleException(Exception e)
throws Exception
e - The exception that occured.
Exception - Any runtime exception that may occur during error
handling.public Environment getEnvironment()
ComponentEnvironment of this
Component.
getEnvironment in interface ComponentEnvironment of the Component.public Scope getScope()
ComponentComponent. The
Scope is related to Path and the idea behind it is
quite similar.
getScope in interface ComponentComponentpublic boolean isInitialized()
init() method has been called.
true, if the component has been initialized.public boolean isAlive()
ComponentComponent is alive. If it is alive
then it means that the Component has been initialized and is
not destroyed yet.
isAlive in interface Componenttrue, if this component has been initialized and is
not destroyed. Otherwise, false.public boolean isDead()
destroy() method has been called.
true, if the component has been destroyed.protected void _setEnvironment(Environment env)
env.
env - The new Envrionment for this component.protected void _setScope(Scope scope)
scope - the new scope to identify this component.
protected void _waitNoCall()
throws InterruptedException
InterruptedException
protected void _startCall()
throws IllegalStateException
IllegalStateException
protected void _strictStartCall()
throws IllegalStateException
IllegalStateExceptionprotected void _endCall()
protected void _startWaitingCall()
protected void _endWaitingCall()
protected void _checkCall()
throws IllegalStateException
IllegalStateException - when component has never been initialized
protected void _strictCheckCall()
throws IllegalStateException
IllegalStateException - when component is unborn or deadprotected Map _getChildren()
protected Map _getDisabledChildren()
protected void _addComponent(Object key,
Component component,
Environment env)
protected void _addComponent(Object key,
Component component,
Scope scope,
Environment env)
protected void _removeComponent(Object key)
key - The ID of the component to remove.protected void _disableComponent(Object key)
key - The ID of the child component to disable.protected void _enableComponent(Object key)
key - The ID of the child component to enable.
protected void _relocateComponent(Composite parent,
Environment newEnv,
Object keyFrom,
Object keyTo)
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.protected void _propagate(Message message)
message to the component and to all of its
children components.
Note: this is the component propagation logic that should not be
modified by applications (they should use just the
propagate(Message)).
message - A message to forward.
Exception - Any runtime exception that may occur.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||