Package org.praxislive.ide.core.api
Class AbstractHelperComponent
java.lang.Object
org.praxislive.base.AbstractComponent
org.praxislive.ide.core.api.AbstractHelperComponent
- All Implemented Interfaces:
org.praxislive.core.Component
public class AbstractHelperComponent
extends org.praxislive.base.AbstractComponent
A base class for components to be provided via
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.
invalid reference
ExtensionProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name of events fired when the component is connected into and removed from a PraxisCORE hub. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a property listener.voidbind(org.praxislive.core.ControlAddress address, org.praxislive.base.Binding.Adaptor adaptor) Add a binding to the provided control.CompletionStage<List<org.praxislive.core.Value>> execScript(String script) Execute the provided script in the registeredScriptService, returning aCompletionStagethat will complete with the result of execution.voidexecScript(String script, Callback callback) Execute the provided script in the registeredScriptService.org.praxislive.core.ComponentAddressfindService(Class<? extends org.praxislive.core.services.Service> service) Find the address of a service.protected voidfirePropertyChange(String property, Object oldValue, Object newValue) Fire a property change event.org.praxislive.core.ComponentInfogetInfo()voidfinal booleanQuery whether this helper component is connected into a running PraxisCORE hub.voidRemove 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 aCompletionStagethat will complete with the result of the call.voidsend(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 a call to a control with the provided arguments, returning aCompletionStagethat will complete with the result of the call.voidsend(org.praxislive.core.ControlAddress to, List<org.praxislive.core.Value> args, Callback callback) Send a call to a control with the provided arguments.voidunbind(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
-
Field Details
-
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
Add a property listener.- Parameters:
listener- property listener
-
removePropertyChangeListener
Remove a property listener.- Parameters:
listener- property listener
-
firePropertyChange
Fire a property change event.- Parameters:
property- name of propertyoldValue- old value of propertynewValue- new value of property
-
hierarchyChanged
public void hierarchyChanged()- Specified by:
hierarchyChangedin interfaceorg.praxislive.core.Component- Overrides:
hierarchyChangedin classorg.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:
findServicein classorg.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 callargs- argumentscallback- 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 aCompletionStagethat will complete with the result of the call.- Parameters:
to- control to callargs- 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 upcontrol- control to callargs- argumentscallback- callback to handle response- Throws:
HubUnavailableException- if not connectedorg.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 aCompletionStagethat will complete with the result of the call.- Parameters:
service- service to look upcontrol- control to callargs- 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 registeredScriptService.- Parameters:
script- script to executecallback- callback to handle response- Throws:
HubUnavailableException- if not connectedorg.praxislive.core.services.ServiceUnavailableException- if no script service found
-
execScript
Execute the provided script in the registeredScriptService, returning aCompletionStagethat 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 addressadaptor- 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 addressadaptor- binding adaptor
-
getInfo
public org.praxislive.core.ComponentInfo getInfo()
-