- java.lang.Object
-
- org.praxislive.base.AbstractComponent
-
- org.praxislive.base.AbstractContainer
-
- All Implemented Interfaces:
Component
,Container
,Lookup.Provider
- Direct Known Subclasses:
AbstractContainer.Delegate
public abstract class AbstractContainer extends AbstractComponent implements Container
Abstract base class forContainer
supporting all controls ofContainerProtocol
.Use the
AbstractContainer.Delegate
subclass to reuse the functionality here inside an alternative Container implementation (see eg. use inAbstractRootContainer
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractContainer.AddChildControl
protected class
AbstractContainer.ChildrenControl
protected class
AbstractContainer.ConnectControl
protected class
AbstractContainer.ConnectionsControl
static class
AbstractContainer.Delegate
Delegate base class to be used inside a wrapper class implementingContainer
.protected class
AbstractContainer.DisconnectControl
protected class
AbstractContainer.RemoveChildControl
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addChild(String id, Component child)
Stream<String>
children()
Get a Stream of the child IDs that this container makes publicly visible.protected void
connect(String component1, String port1, String component2, String port2)
protected void
disconnect(String component1, String port1, String component2, String port2)
ComponentAddress
getAddress(Component child)
Get the address for the provided child component, or null if the component is not a child of this container.Component
getChild(String id)
Get child component with specific ID.protected String
getChildID(Component child)
Lookup
getLookup()
Get the Lookup from this Provider.void
hierarchyChanged()
Notify the component that a change has happened in its component hierarchy.protected void
notifyChild(Component child)
protected Component
removeChild(String id)
-
Methods inherited from class org.praxislive.base.AbstractComponent
disconnectAll, findService, getAddress, getControl, getParent, getPort, parentNotify, registerControl, registerPort, unregisterControl, unregisterPort
-
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.Component
getControl, getInfo, getParent, getPort, parentNotify
-
-
-
-
Method Detail
-
getChild
public Component getChild(String id)
Description copied from interface:Container
Get child component with specific ID.
-
children
public Stream<String> children()
Description copied from interface:Container
Get 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:Container
Get the address for the provided child component, or null if the component is not a child of this container.- Specified by:
getAddress
in interfaceContainer
- Parameters:
child
- component- Returns:
- address, or null of component is not a child of this container.
-
hierarchyChanged
public void hierarchyChanged()
Description copied from interface:Component
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.- Specified by:
hierarchyChanged
in interfaceComponent
- Overrides:
hierarchyChanged
in classAbstractComponent
-
getLookup
public Lookup getLookup()
Description copied from interface:Lookup.Provider
Get the Lookup from this Provider.- Specified by:
getLookup
in interfaceLookup.Provider
- Overrides:
getLookup
in classAbstractComponent
- Returns:
- lookup
-
addChild
protected void addChild(String id, Component child) throws VetoException
- Throws:
VetoException
-
notifyChild
protected void notifyChild(Component child) throws VetoException
- Throws:
VetoException
-
connect
protected void connect(String component1, String port1, String component2, String port2) throws PortConnectionException
- Throws:
PortConnectionException
-
-