-
- All Known Subinterfaces:
Container
- All Known Implementing Classes:
AbstractComponent
,AbstractContainer
,AbstractContainer.Delegate
,AbstractRootContainer
,CodeComponent
,CodeContainer
,CodeRoot
,CodeRootContainer
,TFRoot
public interface Component
Components are the main building blocks (actors) within Praxis CORE. They may provide Controls (asynchronous message endpoints) and Ports (synchronous message points). Components expect to be used within a hierarchy, inside a Root component, and potentially inside other Container components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Control
getControl(String id)
Get a Control that can handle a Call to the given ID, or null if it does not exist.ComponentInfo
getInfo()
Get the ComponentInfo object for this component.Container
getParent()
Return the Container that is the immediate parent of this Component, or null if this Component is not currently contained within a Component hierarchy.Port
getPort(String id)
Get the Port with the given ID, or null if it does not exist.void
hierarchyChanged()
Notify the component that a change has happened in its component hierarchy.void
parentNotify(Container parent)
Notify the Component that it has been added to the supplied Container, or removed from its parent if the supplied argument is null.
-
-
-
Method Detail
-
getParent
Container getParent()
Return the Container that is the immediate parent of this Component, or null if this Component is not currently contained within a Component hierarchy.- Returns:
- Container
-
parentNotify
void parentNotify(Container parent) throws VetoException
Notify the Component that it has been added to the supplied Container, or removed from its parent if the supplied argument is null. The Component may throw a VetoException if it should not be added to the Container provided. It should also throw this exception if a parent is already set.- Parameters:
parent
-- Throws:
VetoException
-
hierarchyChanged
void hierarchyChanged()
Notify the component that a change has happened in its component hierarchy. For example its direct parent or an ancestor has changed. This method will be called after parentNotify() if the result of an immediate parent change.
-
getControl
Control getControl(String id)
Get a Control that can handle a Call to the given ID, or null if it does not exist. Component implementations are free to return a different Control for each ID, a single control to handle any message, or somewhere in between. A null return from this method shall be handled by the Root component by responding with an error message to the sender where required.- Parameters:
id
-- Returns:
- Control or null
-
getPort
Port getPort(String id)
Get the Port with the given ID, or null if it does not exist.- Parameters:
id
-- Returns:
- Port or null
-
getInfo
ComponentInfo getInfo()
Get the ComponentInfo object for this component.- Returns:
- ComponentInfo
-
-