Class AbstractHelperComponent

java.lang.Object
org.praxislive.base.AbstractComponent
org.praxislive.ide.core.api.AbstractHelperComponent
All Implemented Interfaces:
org.praxislive.core.Component
Direct Known Subclasses:
GuiHelper, ProjectHelper, PXRHelper, PXSHelper

public class AbstractHelperComponent extends org.praxislive.base.AbstractComponent
A base class for components to be provided via
invalid reference
ExtensionProvider
to allow modules to communicate with the PraxisCORE system. Unless otherwise stated, all methods should be called on, and all listeners are fired on, the Swing event thread.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Property name of events fired when the component is connected into and removed from a PraxisCORE hub.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Create a helper component.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a property listener.
    void
    bind(org.praxislive.core.ControlAddress address, org.praxislive.base.Binding.Adaptor adaptor)
    Add a binding to the provided control.
    CompletionStage<List<org.praxislive.core.Value>>
    Execute the provided script in the registered ScriptService, returning a CompletionStage that will complete with the result of execution.
    void
    execScript(String script, Callback callback)
    Execute the provided script in the registered ScriptService.
    org.praxislive.core.ComponentAddress
    findService(Class<? extends org.praxislive.core.services.Service> service)
    Find the address of a service.
    protected void
    firePropertyChange(String property, Object oldValue, Object newValue)
    Fire a property change event.
    org.praxislive.core.ComponentInfo
     
    void
     
    final boolean
    Query whether this helper component is connected into a running PraxisCORE hub.
    void
    Remove a property listener.
    CompletionStage<List<org.praxislive.core.Value>>
    send(Class<? extends org.praxislive.core.services.Service> service, String control, List<org.praxislive.core.Value> args)
    Send a call to a control on a service with the provided arguments, returning a CompletionStage that will complete with the result of the call.
    void
    send(Class<? extends org.praxislive.core.services.Service> service, String control, List<org.praxislive.core.Value> args, Callback callback)
    Send a call to a control on a service with the provided arguments.
    CompletionStage<List<org.praxislive.core.Value>>
    send(org.praxislive.core.ControlAddress to, List<org.praxislive.core.Value> args)
    Send a call to a control with the provided arguments, returning a CompletionStage that will complete with the result of the call.
    void
    send(org.praxislive.core.ControlAddress to, List<org.praxislive.core.Value> args, Callback callback)
    Send a call to a control with the provided arguments.
    void
    unbind(org.praxislive.core.ControlAddress address, org.praxislive.base.Binding.Adaptor adaptor)
    Remove a binding to the provided control.

    Methods inherited from class org.praxislive.base.AbstractComponent

    disconnectAll, getAddress, getControl, getLookup, getParent, getPort, parentNotify, registerControl, registerPort, unregisterControl, unregisterPort, write, writeMeta, writeTypeAndInfo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROP_HUB_CONNECTED

      public static final String PROP_HUB_CONNECTED
      Property name of events fired when the component is connected into and removed from a PraxisCORE hub.
      See Also:
  • Constructor Details

    • AbstractHelperComponent

      protected AbstractHelperComponent()
      Create a helper component.
  • Method Details

    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Add a property listener.
      Parameters:
      listener - property listener
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Remove a property listener.
      Parameters:
      listener - property listener
    • firePropertyChange

      protected void firePropertyChange(String property, Object oldValue, Object newValue)
      Fire a property change event.
      Parameters:
      property - name of property
      oldValue - old value of property
      newValue - new value of property
    • hierarchyChanged

      public void hierarchyChanged()
      Specified by:
      hierarchyChanged in interface org.praxislive.core.Component
      Overrides:
      hierarchyChanged in class org.praxislive.base.AbstractComponent
    • isConnected

      public final boolean isConnected()
      Query whether this helper component is connected into a running PraxisCORE hub.
      Returns:
      connected to hub
    • findService

      public org.praxislive.core.ComponentAddress findService(Class<? extends org.praxislive.core.services.Service> service) throws org.praxislive.core.services.ServiceUnavailableException
      Find the address of a service.
      Overrides:
      findService in class org.praxislive.base.AbstractComponent
      Parameters:
      service - type of service
      Returns:
      address of service
      Throws:
      org.praxislive.core.services.ServiceUnavailableException - if no service provider found
    • send

      public void send(org.praxislive.core.ControlAddress to, List<org.praxislive.core.Value> args, Callback callback) throws HubUnavailableException
      Send a call to a control with the provided arguments.
      Parameters:
      to - control to call
      args - arguments
      callback - callback to handle response
      Throws:
      HubUnavailableException - if not connected
    • send

      public CompletionStage<List<org.praxislive.core.Value>> send(org.praxislive.core.ControlAddress to, List<org.praxislive.core.Value> args)
      Send a call to a control with the provided arguments, returning a CompletionStage that will complete with the result of the call.
      Parameters:
      to - control to call
      args - arguments
      Returns:
      completion stage
    • send

      public void send(Class<? extends org.praxislive.core.services.Service> service, String control, List<org.praxislive.core.Value> args, Callback callback) throws HubUnavailableException, org.praxislive.core.services.ServiceUnavailableException
      Send a call to a control on a service with the provided arguments.
      Parameters:
      service - service to look up
      control - control to call
      args - arguments
      callback - callback to handle response
      Throws:
      HubUnavailableException - if not connected
      org.praxislive.core.services.ServiceUnavailableException - if no service provider found
    • send

      public CompletionStage<List<org.praxislive.core.Value>> send(Class<? extends org.praxislive.core.services.Service> service, String control, List<org.praxislive.core.Value> args)
      Send a call to a control on a service with the provided arguments, returning a CompletionStage that will complete with the result of the call.
      Parameters:
      service - service to look up
      control - control to call
      args - arguments
      Returns:
      completion stage
    • execScript

      public void execScript(String script, Callback callback) throws HubUnavailableException, org.praxislive.core.services.ServiceUnavailableException
      Execute the provided script in the registered ScriptService.
      Parameters:
      script - script to execute
      callback - callback to handle response
      Throws:
      HubUnavailableException - if not connected
      org.praxislive.core.services.ServiceUnavailableException - if no script service found
    • execScript

      public CompletionStage<List<org.praxislive.core.Value>> execScript(String script)
      Execute the provided script in the registered ScriptService, returning a CompletionStage that will complete with the result of execution.
      Parameters:
      script - script to execute
      Returns:
      completion stage
    • bind

      public void bind(org.praxislive.core.ControlAddress address, org.praxislive.base.Binding.Adaptor adaptor)
      Add a binding to the provided control.
      Parameters:
      address - control address
      adaptor - binding adaptor
    • unbind

      public void unbind(org.praxislive.core.ControlAddress address, org.praxislive.base.Binding.Adaptor adaptor)
      Remove a binding to the provided control.
      Parameters:
      address - control address
      adaptor - binding adaptor
    • getInfo

      public org.praxislive.core.ComponentInfo getInfo()