- java.lang.Object
-
- org.praxislive.base.AbstractComponent
-
- All Implemented Interfaces:
Component
- Direct Known Subclasses:
AbstractContainer
public abstract class AbstractComponent extends Object implements Component
Abstract base implementation ofComponentsupportingControlandPortmanagement. AComponentProtocol.INFOcontrol is added automatically, returning the information provided by the abstractComponent.getInfo()method.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisconnectAll()protected ComponentAddressfindService(Class<? extends Service> service)protected ComponentAddressgetAddress()ControlgetControl(String id)Get a Control that can handle a Call to the given ID, or null if it does not exist.protected LookupgetLookup()ContainergetParent()Return the Container that is the immediate parent of this Component, or null if this Component is not currently contained within a Component hierarchy.PortgetPort(String id)Get the Port with the given ID, or null if it does not exist.voidhierarchyChanged()Notify the component that a change has happened in its component hierarchy.voidparentNotify(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.protected voidregisterControl(String id, Control control)protected voidregisterPort(String id, Port port)protected voidunregisterControl(String id)protected voidunregisterPort(String id)
-
-
-
Method Detail
-
getParent
public Container getParent()
Description copied from interface:ComponentReturn the Container that is the immediate parent of this Component, or null if this Component is not currently contained within a Component hierarchy.
-
parentNotify
public void parentNotify(Container parent) throws VetoException
Description copied from interface:ComponentNotify 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.- Specified by:
parentNotifyin interfaceComponent- Throws:
VetoException
-
hierarchyChanged
public void hierarchyChanged()
Description copied from interface:ComponentNotify 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.- Specified by:
hierarchyChangedin interfaceComponent
-
getControl
public Control getControl(String id)
Description copied from interface:ComponentGet 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.- Specified by:
getControlin interfaceComponent- Returns:
- Control or null
-
getPort
public Port getPort(String id)
Description copied from interface:ComponentGet the Port with the given ID, or null if it does not exist.
-
getAddress
protected ComponentAddress getAddress()
-
getLookup
protected Lookup getLookup()
-
findService
protected ComponentAddress findService(Class<? extends Service> service) throws ServiceUnavailableException
- Throws:
ServiceUnavailableException
-
disconnectAll
protected void disconnectAll()
-
unregisterControl
protected final void unregisterControl(String id)
-
unregisterPort
protected final void unregisterPort(String id)
-
-