public interface IComponent extends IInitializable
IComponent is a base interface that describes a singleton type of programming logic.
This is not to be confused with data structures that hold resource information, like IThing
s
or IView
s. Instead, an IComponent represents business logic that operates
on those portal resources.
The IComponent interface is a singleton object managed by a IComponentProvider
, and is therefore expected
to be reentrant and multi-threaded. They are automatically clustered throughout the system, and because they don't contain
instance based data, they feel a bit like SessionEJBs.
An IComponent is managed by an IComponentProvider
, and through the IComponentProvider
you may gain
access to the specified IComponent
.
IComponent's maintain their metadata in a companion object: IComponentData
. The IComponentProvider
is responsible for properly initializing the IComponent's IComponentData
and IComponentProvider
fields.
Also, because the metadata is stored in the IComponentData
, the IComponent isn't responsible for storing its own
metadata.
Modifier and Type | Method and Description |
---|---|
IComponentData |
getComponentData()
Gets the
IComponentData which represents the metadata for this IComponent. |
String |
getComponentName()
Get the common name of this component.
|
IComponentProvider |
getComponentProvider()
Retrieves the
IComponentProvider that manages this component. |
IURI |
getURI()
Every IComponent has a unique
IURI . |
boolean |
isInitialized(int phase)
Check to see if object has been initialized
|
void |
setComponentData(IComponentData componentData)
Set the
IComponentData for this component. |
void |
setComponentProvider(IComponentProvider componentProvider)
Set the
IComponentProvider for this component. |
init, shutdown
IURI getURI()
IURI
.IURI
for this component.String getComponentName()
IComponentData getComponentData()
IComponentData
which represents the metadata for this IComponent.IComponentData
void setComponentData(IComponentData componentData)
Set the IComponentData
for this component. Typically called at initialization by the
IComponentProvider
.
Note, this should only be used by IComponentProvider
s and only under extreme caution
void setComponentProvider(IComponentProvider componentProvider)
Set the IComponentProvider
for this component. Typically called at initialization by the
IComponentProvider
.
Note, this should only be used by IComponentProvider
s and only under extreme caution
boolean isInitialized(int phase)
phase
- optional for multi-phase init, pass IPhase.UNK_PHASE to ignoreIComponentProvider getComponentProvider()
IComponentProvider
that manages this component.IComponentProvider