public class MyCallback extends SIMPluginCallback
Constructor and Description |
---|
MyCallback(SIMPlugin SIMPlugin)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called when the SIMPlugin is destroyed.
|
boolean |
ProcessData(SIMPlugin SIMPlugin,
java.util.Map<java.lang.String,Data> data)
ProcessData is called from within the dedicated thread for this plug-in
every time there is data available in the queue it pops it off the queue and passes it to this method.
|
DataReady, Waiting
public MyCallback(SIMPlugin SIMPlugin) throws SIMPlugin.SIMPluginException
SIMPlugin
- An instance of the current SIM.SIMPlugin.SIMPluginException
- If there's a problem constructing your plug-in.public void destroy()
destroy
in class SIMPluginCallback
public boolean ProcessData(SIMPlugin SIMPlugin, java.util.Map<java.lang.String,Data> data)
//When calling the SIMPlugin from this method, you must synchronize on it first. It is not thread safe. Data d; synchronized (SIMPlugin) { //do not spend much time in here, we are blocking the main thread //Get the data and get out of the synchronized block d = SIMPlugin.getData("/Session/IsGreenFlag"); d = SIMPlugin.getSession().getIsGreenFlag(); } //do something with the data
ProcessData
in class SIMPluginCallback
SIMPlugin
- A reference to the SIMPlugin instance.data
- The Data objects added to the queue.