Class AbstractRootContainer

java.lang.Object
org.praxislive.base.AbstractRoot
org.praxislive.base.AbstractRootContainer
All Implemented Interfaces:
Component, Container, Lookup.Provider, Root

public abstract class AbstractRootContainer extends AbstractRoot implements Container
  • Constructor Details

    • AbstractRootContainer

      protected AbstractRootContainer()
  • Method Details

    • getChild

      public Component getChild(String id)
      Description copied from interface: Container
      Get child component with specific ID.
      Specified by:
      getChild in interface Container
      Parameters:
      id -
      Returns:
      Component, or null if no component with that ID exists.
    • 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 from Container.getChild(java.lang.String) but are not listed here. All IDs returned should correspond to valid components, and (if provided) match the implementation of ContainerProtocol.

      A Stream is returned allowing flexibility in implementation.

      Specified by:
      children in interface Container
      Returns:
      stream of public child IDs
    • 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 interface Container
      Parameters:
      child - component
      Returns:
      address, or null of component is not a child of this container.
    • getParent

      public Container getParent()
      Description copied from interface: Component
      Return the Container that is the immediate parent of this Component, or null if this Component is not currently contained within a Component hierarchy.
      Specified by:
      getParent in interface Component
      Returns:
      Container
    • parentNotify

      public void parentNotify(Container parent) throws VetoException
      Description copied from interface: Component
      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.
      Specified by:
      parentNotify in interface Component
      Parameters:
      parent -
      Throws:
      VetoException
    • 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 interface Component
    • getControl

      public Control getControl(String id)
      Description copied from interface: Component
      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.
      Specified by:
      getControl in interface Component
      Parameters:
      id -
      Returns:
      Control or null
    • getPort

      public Port getPort(String id)
      Description copied from interface: Component
      Get the Port with the given ID, or null if it does not exist.
      Specified by:
      getPort in interface Component
      Parameters:
      id -
      Returns:
      Port or null
    • getLookup

      public Lookup getLookup()
      Description copied from interface: Lookup.Provider
      Get the Lookup from this Provider.
      Specified by:
      getLookup in interface Lookup.Provider
      Overrides:
      getLookup in class AbstractRoot
      Returns:
      lookup
    • getInfo

      public abstract ComponentInfo getInfo()
      Description copied from interface: Component
      Get the ComponentInfo object for this component.
      Specified by:
      getInfo in interface Component
      Returns:
      ComponentInfo
    • write

      public void write(TreeWriter writer)
      Description copied from interface: Container
      If supported, write the state of this container to the provided TreeWriter. This should allow for the container, and its children, to be recreated in as close to its current state as possible.

      To fully support this method, the Container should write its type, component info, property values, children and connections, in that order. It may also add custom annotations.

      The default implementation of this method does nothing.

      Specified by:
      write in interface Component
      Specified by:
      write in interface Container
      Parameters:
      writer - TreeWriter to write to
    • processCall

      protected void processCall(Call call, PacketRouter router)
      Description copied from class: AbstractRoot
      Method called to handle every received Call. The provided router should be used for all ongoing or return calls.
      Specified by:
      processCall in class AbstractRoot
      Parameters:
      call -
      router -
    • addChild

      protected final void addChild(String id, Component child) throws VetoException
      Throws:
      VetoException
    • removeChild

      protected final Component removeChild(String id)
    • 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)
    • registerControl

      protected final void registerControl(String id, Control control)
    • unregisterControl

      protected final void unregisterControl(String id)