org.araneaframework
Interface Component

All Superinterfaces:
Serializable
All Known Subinterfaces:
ApplicationComponent, ApplicationService, ApplicationWidget, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, Control, FilteredInputControl, FilterService, FilterWidget, FlowContextWidget, LocalizationContext.LocaleChangeListener, Relocatable.RelocatableComponent, Relocatable.RelocatableService, Relocatable.RelocatableWidget, Service, ServletServiceAdapterComponent, TabContext, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget
All Known Implementing Classes:
BaseApplicationComponent, BaseApplicationService, BaseApplicationWidget, BaseComponent, BaseControl, BaseFilterService, BaseFilterWidget, BaseService, BaseWidget, FloatControl, NumberControl, PopupFlowWrapperWidget, RelocatableDecorator, StandardClientStateFilterWidget, StandardFlowContainerWidget, StandardServletServiceAdapterComponent, TabWidget, TextControl, TimestampControl

public interface Component
extends Serializable

An entity with a licecycle (init, destroy) and an Environment.

A components lifecycle is simple. It starts with init and ends with destroy.

If a lifecycle contract is broken AraneaRuntimeException will be thrown.

The component is initialized with an Environment. The component's Environment cannot be altered after the initialization process.

The Component follows the template pattern by defining _getComponent() which returns the implementation.

Author:
"Toomas Römer" , Jevgeni Kabanov (ekabanov at araneaframework dot org)

Nested Class Summary
static interface Component.Interface
          The interface which takes care of calling the hooks in the template.
 
Method Summary
 Component.Interface _getComponent()
          The factory method returning the implementation of the Component.
 Environment getEnvironment()
          Provides access to the Environment of this Component.
 Scope getScope()
          Provides the scope of this Component.
 boolean isAlive()
          Specifies whether this Component is alive.
 

Method Detail

getEnvironment

public Environment getEnvironment()
Provides access to the Environment of this Component.

Returns:
the Environment of the Component.
Since:
1.1

getScope

public Scope getScope()
Provides the scope of this Component. The Scope is related to Path and the idea behind it is quite similar.

Returns:
the scope of the Component
Since:
1.1

isAlive

public boolean isAlive()
Specifies whether this Component is alive. If it is alive then it means that the Component has been initialized and is not destroyed yet.

Returns:
true, if this component has been initialized and is not destroyed. Otherwise, false.
Since:
1.1

_getComponent

public Component.Interface _getComponent()
The factory method returning the implementation of the Component.

Returns:
the implementation of the Component.