- java.lang.Object
-
- org.praxislive.code.CodeComponent<D>
-
- org.praxislive.code.CodeRoot<D>
-
- Type Parameters:
D
- wrapped delegate type
- All Implemented Interfaces:
Component
,Lookup.Provider
,Root
- Direct Known Subclasses:
CodeRootContainer
public class CodeRoot<D extends CodeRootDelegate> extends CodeComponent<D> implements Root
ARoot
component instance that is rewritable at runtime. The CodeRoot itself remains constant, but passes most responsibility to aCodeRoot.Context
wrapping aCodeRootDelegate
(user code). This component handles switching from one context to the next. A CodeRoot cannot be created directly - seeCodeFactory
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CodeRoot.Connector<D extends CodeRootDelegate>
CodeConnector subclass for CodeRoots.static class
CodeRoot.Context<D extends CodeRootDelegate>
CodeContext subclass for CodeRoots.-
Nested classes/interfaces inherited from interface org.praxislive.core.Root
Root.Controller
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Lookup
getLookup()
Get the Lookup from this Provider.void
hierarchyChanged()
Notify the component that a change has happened in its component hierarchy.Root.Controller
initialize(String ID, RootHub hub)
Method used by the RootHub to initialize the Root and obtain a Controller.void
parentNotify(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.-
Methods inherited from class org.praxislive.code.CodeComponent
getControl, getInfo, getParent, getPort
-
-
-
-
Method Detail
-
initialize
public Root.Controller initialize(String ID, RootHub hub)
Description copied from interface:Root
Method used by the RootHub to initialize the Root and obtain a Controller. Root implementations will ensure this method can only be invoked once.- Specified by:
initialize
in interfaceRoot
- Parameters:
ID
- the unique ID of this Roothub
- the RootHub the Root resides within- Returns:
- Controller for use by the RootHub instance
-
getLookup
public Lookup getLookup()
Description copied from interface:Lookup.Provider
Get the Lookup from this Provider.- Specified by:
getLookup
in interfaceLookup.Provider
- Returns:
- lookup
-
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 interfaceComponent
- Overrides:
parentNotify
in classCodeComponent<D extends CodeRootDelegate>
- 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 interfaceComponent
- Overrides:
hierarchyChanged
in classCodeComponent<D extends CodeRootDelegate>
-
-