java.lang.Object
org.praxislive.base.AbstractComponent
org.praxislive.base.AbstractContainer
- All Implemented Interfaces:
Component,Container,Lookup.Provider
- Direct Known Subclasses:
AbstractContainer.Delegate
Abstract base class for
Container supporting all controls of
ContainerProtocol.
Use the AbstractContainer.Delegate subclass to reuse the functionality here inside an
alternative Container implementation (see eg. use in
AbstractRootContainer ).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected classstatic classDelegate base class to be used inside a wrapper class implementingContainer.protected classprotected class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchildren()Get a Stream of the child IDs that this container makes publicly visible.protected voidprotected voiddisconnect(String component1, String port1, String component2, String port2) getAddress(Component child) Get the address for the provided child component, or null if the component is not a child of this container.Get child component with specific ID.protected StringgetChildID(Component child) Get the Lookup from this Provider.Get theComponentTypeof the provided child.voidNotify the component that a change has happened in its component hierarchy.protected voidnotifyChild(Component child) protected voidrecordChildType(Component child, ComponentType type) protected ComponentremoveChild(String id) voidwrite(TreeWriter writer) If supported, write the state of this component to the providedTreeWriter.protected final voidwriteChildren(TreeWriter writer) protected final voidwriteConnections(TreeWriter writer) Methods inherited from class org.praxislive.base.AbstractComponent
disconnectAll, findService, getAddress, getControl, getParent, getPort, parentNotify, registerControl, registerPort, unregisterControl, unregisterPort, writeMeta, writeTypeAndInfoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.praxislive.core.Component
getControl, getInfo, getParent, getPort, parentNotify
-
Constructor Details
-
AbstractContainer
protected AbstractContainer()
-
-
Method Details
-
getChild
Description copied from interface:ContainerGet child component with specific ID. -
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
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.
-
getType
Description copied from interface:ContainerGet theComponentTypeof the provided child. The default implementation looks forComponentInfo.KEY_COMPONENT_TYPEin the child's info. Container's may override to provide a more efficient or suitable result.The default implementation does not check if the provided component is actually a child of this container.
-
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- Overrides:
hierarchyChangedin classAbstractComponent
-
getLookup
Description copied from interface:Lookup.ProviderGet the Lookup from this Provider.- Specified by:
getLookupin interfaceLookup.Provider- Overrides:
getLookupin classAbstractComponent- Returns:
- lookup
-
write
Description copied from interface:ComponentIf supported, write the state of this component to the providedTreeWriter. This should allow for the component to be recreated in as close to its current state as possible.To fully support this method, the Component should write its type, component info, and property values, in that order. It may also add custom annotations.
The component should delegate to
Container.getType(org.praxislive.core.Component)to find its type rather than relying directly onComponentInfo.KEY_COMPONENT_TYPE.The default implementation of this method does nothing.
-
writeChildren
-
writeConnections
-
addChild
- Throws:
VetoException
-
recordChildType
-
notifyChild
- Throws:
VetoException
-
removeChild
-
getChildID
-
connect
protected void connect(String component1, String port1, String component2, String port2) throws PortConnectionException - Throws:
PortConnectionException
-
disconnect
-