- java.lang.Object
-
- org.praxislive.base.AbstractRoot
-
- org.praxislive.base.AbstractRootContainer
-
- All Implemented Interfaces:
Component,Container,Lookup.Provider,Root
- Direct Known Subclasses:
TFRoot
public abstract class AbstractRootContainer extends AbstractRoot implements Container
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.praxislive.base.AbstractRoot
AbstractRoot.Controller, AbstractRoot.Delegate, AbstractRoot.State
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRootContainer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddChild(String id, Component child)Stream<String>children()Get a Stream of the child IDs that this container makes publicly visible.protected voidconnect(String component1, String port1, String component2, String port2)protected voiddisconnect(String component1, String port1, String component2, String port2)ComponentAddressgetAddress(Component child)Get the address for the provided child component, or null if the component is not a child of this container.ComponentgetChild(String id)Get child component with specific ID.ControlgetControl(String id)Get a Control that can handle a Call to the given ID, or null if it does not exist.abstract ComponentInfogetInfo()Get the ComponentInfo object for this component.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 voidprocessCall(Call call, PacketRouter router)Method called to handle every receivedCall.protected voidregisterControl(String id, Control control)protected ComponentremoveChild(String id)protected voidunregisterControl(String id)-
Methods inherited from class org.praxislive.base.AbstractRoot
activating, attachDelegate, createContext, createController, createRouter, detachDelegate, findService, getAddress, getExecutionContext, getLookup, getRootHub, getRouter, getState, initialize, interrupt, invokeLater, setIdle, setRunning, starting, stopping, terminating, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.praxislive.core.Lookup.Provider
getLookup
-
-
-
-
Method Detail
-
getChild
public Component getChild(String id)
Description copied from interface:ContainerGet child component with specific ID.
-
children
public Stream<String> children()
Description copied from interface:ContainerGet a Stream of the child IDs that this container makes publicly visible. Containers may have hidden children that can be returned fromContainer.getChild(java.lang.String)but are not listed here. All IDs returned should correspond to valid components, and (if provided) match the implementation ofContainerProtocol.A Stream is returned allowing flexibility in implementation.
-
getAddress
public ComponentAddress getAddress(Component child)
Description copied from interface:ContainerGet the address for the provided child component, or null if the component is not a child of this container.- Specified by:
getAddressin interfaceContainer- Parameters:
child- component- Returns:
- address, or null of component is not a child of this container.
-
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.
-
getInfo
public abstract ComponentInfo getInfo()
Description copied from interface:ComponentGet the ComponentInfo object for this component.
-
processCall
protected void processCall(Call call, PacketRouter router)
Description copied from class:AbstractRootMethod called to handle every receivedCall. The provided router should be used for all ongoing or return calls.- Specified by:
processCallin classAbstractRoot
-
addChild
protected final void addChild(String id, Component child) throws VetoException
- Throws:
VetoException
-
connect
protected final void connect(String component1, String port1, String component2, String port2) throws PortConnectionException
- Throws:
PortConnectionException
-
disconnect
protected final void disconnect(String component1, String port1, String component2, String port2)
-
unregisterControl
protected final void unregisterControl(String id)
-
-