Class GatewayFunctionPoller<T>
java.lang.Object
com.inductiveautomation.factorypmi.application.components.util.GatewayFunctionPoller<T>
This little helper class makes it easier to implement polling gateway function logic within a component. Simply
 extend one of these as an inner class on your component, and override the functions to run the gateway function and
 to consume the results. The function will be run on a background thread, optionally polled at a time interval. The
 results will be delivered on the EDT.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionlongprotected abstract voidonValueReceived(T value, QualityCode quality) This will be called when the object has been retrieved.protected abstract TRun the actual function to get data from the gatewayprotected voidvoidsetRefreshRate(long refreshRate) voidshutdown()voidstartup(VisionClientContext context) protected abstract Stringverb()Return a verb that describes what this poller does.
- 
Field Details- 
log
- 
refreshRateprotected long refreshRate
- 
context
 
- 
- 
Constructor Details- 
GatewayFunctionPoller
 
- 
- 
Method Details- 
getRefreshRatepublic long getRefreshRate()
- 
setRefreshRatepublic void setRefreshRate(long refreshRate) 
- 
startup
- 
shutdownpublic void shutdown()
- 
scheduleQueryprotected void scheduleQuery()
- 
runFunctionRun the actual function to get data from the gateway- Throws:
- GatewayException
 
- 
onValueReceivedThis will be called when the object has been retrieved. This function will always be called on the EDT
- 
verbReturn a verb that describes what this poller does. Something like "query events". For logging.
 
-