Class ComponentModelDelegate
- java.lang.Object
-
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
-
- com.inductiveautomation.perspective.gateway.api.ComponentModelDelegate
-
- Direct Known Subclasses:
AlarmJournalTableModelDelegate
,AlarmStatusTableModelDelegate
,FileUploadModelDelegate
,MapModelDelegate
,PdfViewerModelDelegate
,PowerChartModelDelegate
,ReportViewerModelDelegate
,SignaturePadModelDelegate
public abstract class ComponentModelDelegate extends AbstractLifecycle
A ComponentModelDelegate is created when itsComponentModel
owner is created. The ComponentModelDelegate will be notified of startup and shutdown when the ComponentModel starts up and shuts down. This gives the ComponentModelDelegate the opportunity to interact with its ComponentModel.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComponentModelDelegate(Component component)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
fireEvent(java.lang.String eventName, com.inductiveautomation.ignition.common.gson.JsonObject event)
Fires a model event which is expected to be handled by the client side component model delegate.java.util.Set<java.lang.String>
getScriptCallableMethods()
void
handleEvent(EventFiredMsg message)
A event hook for the delegate.-
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, onShutdown, onStartup, shutdown, startup
-
-
-
-
Constructor Detail
-
ComponentModelDelegate
protected ComponentModelDelegate(Component component)
-
-
Method Detail
-
getScriptCallableMethods
public final java.util.Set<java.lang.String> getScriptCallableMethods()
- Returns:
- A set of the names of the methods of this class that are annotated with @ScriptCallable
-
handleEvent
public void handleEvent(EventFiredMsg message)
A event hook for the delegate. Invoked when a "model" event is fired over the websocket channel by the component's client side model delegate. Subclasses can choose if and how to handle incoming event messages.- Parameters:
message
-EventFiredMsg
An event fired message.
-
fireEvent
public void fireEvent(java.lang.String eventName, com.inductiveautomation.ignition.common.gson.JsonObject event)
Fires a model event which is expected to be handled by the client side component model delegate. This makes it possible to communicate between Gateway and Client side ComponentModel delegates via websocket.- Parameters:
eventName
- {String} The name of the eventevent
-JsonObject
The event payload as a json object
-
-