Class AbstractPollingFunction
- java.lang.Object
-
- com.inductiveautomation.ignition.common.expressions.functions.BaseFunction
-
- com.inductiveautomation.ignition.common.expressions.functions.AbstractFunction
-
- com.inductiveautomation.ignition.common.expressions.functions.AbstractPollingFunction
-
- All Implemented Interfaces:
Function
,java.awt.event.ActionListener
,java.util.EventListener
- Direct Known Subclasses:
ClientFunctionFactory.IsAlarmActiveFilteredFunctionClient
,ClientFunctionFactory.IsAlarmActiveFunctionClient
,DefaultFunctionFactory.NowFunction
,HasChangedFunction
,ScriptFunction
public abstract class AbstractPollingFunction extends AbstractFunction implements java.awt.event.ActionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected CommonContext
context
protected int
rate
protected boolean
started
protected java.util.TimerTask
task
protected static java.util.Timer
TIMER
protected InteractionListener
updateListener
-
Constructor Summary
Constructors Constructor Description AbstractPollingFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
NOTE: This is in an "action listener" for legacy reasons, and doesn't need to be anymore.protected void
cancelTask()
void
connect(CommonContext context, InteractionListener updateListener)
Empty implementation from BaseFunction.abstract Function
copy()
Returns this.void
disconnect()
Empty implementation from BaseFunction.protected void
setPollRate(int rate)
Updates the poll rate.void
shutdown()
Empty implementation from BaseFunction.protected void
startTask()
void
startup()
Empty implementation from BaseFunction.-
Methods inherited from class com.inductiveautomation.ignition.common.expressions.functions.AbstractFunction
executeArg, getFunctionDisplayName, initArgs, log, validateNumArgs
-
Methods inherited from class com.inductiveautomation.ignition.common.expressions.functions.BaseFunction
executeAll
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.common.expressions.functions.Function
execute, getArgDocString, getType
-
-
-
-
Field Detail
-
TIMER
protected static final java.util.Timer TIMER
-
context
protected CommonContext context
-
updateListener
protected InteractionListener updateListener
-
task
protected java.util.TimerTask task
-
rate
protected int rate
-
started
protected boolean started
-
-
Method Detail
-
connect
public void connect(CommonContext context, InteractionListener updateListener)
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
connect
in interfaceFunction
- Overrides:
connect
in classBaseFunction
-
disconnect
public void disconnect()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
disconnect
in interfaceFunction
- Overrides:
disconnect
in classBaseFunction
-
shutdown
public void shutdown()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
shutdown
in interfaceFunction
- Overrides:
shutdown
in classBaseFunction
-
startup
public void startup()
Description copied from class:BaseFunction
Empty implementation from BaseFunction. Override if necessary.- Specified by:
startup
in interfaceFunction
- Overrides:
startup
in classBaseFunction
-
startTask
protected void startTask()
-
cancelTask
protected void cancelTask()
-
copy
public abstract Function copy()
Description copied from class:BaseFunction
Returns this. Override to create a clone if you need a unique function object per Expression.- Specified by:
copy
in interfaceFunction
- Overrides:
copy
in classBaseFunction
-
setPollRate
protected void setPollRate(int rate)
Updates the poll rate. If the rate is <= 0, polling is disabled.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
NOTE: This is in an "action listener" for legacy reasons, and doesn't need to be anymore. However, since we switched the timer in 7.7.6, we needed to maintain backwards compatibility with any sub classes that might override this function.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
-