Class GatewayFunctionPoller<T>
- java.lang.Object
- 
- com.inductiveautomation.factorypmi.application.components.util.GatewayFunctionPoller<T>
 
- 
 public abstract class GatewayFunctionPoller<T> extends java.lang.ObjectThis 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 Modifier and Type Field Description protected VisionClientContextcontextprotected LoggerExlogprotected longrefreshRate
 - 
Constructor SummaryConstructors Constructor Description GatewayFunctionPoller(LoggerEx log, long refreshRate)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetRefreshRate()protected abstract voidonValueReceived(T value, QualityCode quality)This will be called when the object has been retrieved.protected abstract TrunFunction(GatewayConnection con)Run the actual function to get data from the gatewayprotected voidscheduleQuery()voidsetRefreshRate(long refreshRate)voidshutdown()voidstartup(VisionClientContext context)protected abstract java.lang.Stringverb()Return a verb that describes what this poller does.
 
- 
- 
- 
Field Detail- 
logprotected LoggerEx log 
 - 
refreshRateprotected long refreshRate 
 - 
contextprotected VisionClientContext context 
 
- 
 - 
Constructor Detail- 
GatewayFunctionPollerpublic GatewayFunctionPoller(LoggerEx log, long refreshRate) 
 
- 
 - 
Method Detail- 
getRefreshRatepublic long getRefreshRate() 
 - 
setRefreshRatepublic void setRefreshRate(long refreshRate) 
 - 
startuppublic void startup(VisionClientContext context) 
 - 
shutdownpublic void shutdown() 
 - 
scheduleQueryprotected void scheduleQuery() 
 - 
runFunctionprotected abstract T runFunction(GatewayConnection con) throws GatewayException Run the actual function to get data from the gateway- Throws:
- GatewayException
 
 - 
onValueReceivedprotected abstract void onValueReceived(T value, QualityCode quality) This will be called when the object has been retrieved. This function will always be called on the EDT
 - 
verbprotected abstract java.lang.String verb() Return a verb that describes what this poller does. Something like "query events". For logging.
 
- 
 
-