Class QueryBinding
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.binding.AbstractPollingBinding
-
- com.inductiveautomation.perspective.gateway.binding.query.QueryBinding
-
- All Implemented Interfaces:
QueryBindingConstants
,Binding
public class QueryBinding extends AbstractPollingBinding implements QueryBindingConstants
Implementation of a perspective query binding. These bindings will execute a named query, optionally on a rate.The polling rate, as well as the parameter values, are all expressions that can produce new values at any time. Care is taken to ensure that any blocking work takes place on the perspective working thread-pool.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.perspective.gateway.binding.AbstractPollingBinding
AbstractPollingBinding.State
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.perspective.gateway.binding.AbstractPollingBinding
context, state
-
Fields inherited from interface com.inductiveautomation.perspective.gateway.api.Binding
BAD_CONFIG, BAD_REF, BIDIRECTIONAL_KEY, INITIAL_VALUE, MDC_BINDING_TARGET, NOT_FOUND
-
Fields inherited from interface com.inductiveautomation.perspective.common.config.constants.QueryBindingConstants
QUERY_PATH, TYPE_ID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected QualifiedValue
execute()
Perform the blocking execution of this polling binding.protected boolean
isDirty()
If any dependencies of the implementation have changed, this method should return true, which will kick off another execution if dependencies have changed while the execution was running.protected boolean
isReady()
Indicates whether or not the instance of the underlying implementation is ready for execution.protected void
preExecutionPrep()
This method will be called beforeAbstractPollingBinding.execute()
is called to give implementations the opportunity to prepare any data before execution begins.void
shutdown()
Shut down the binding.void
startup()
Start up the binding.-
Methods inherited from class com.inductiveautomation.perspective.gateway.binding.AbstractPollingBinding
onUserRefresh, scheduleNow
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.perspective.gateway.api.Binding
isBidirectional, onTargetUpdated
-
-
-
-
Method Detail
-
startup
public void startup()
Description copied from interface:Binding
Start up the binding. Will be called on-queue- Specified by:
startup
in interfaceBinding
- Overrides:
startup
in classAbstractPollingBinding
-
shutdown
public void shutdown()
Description copied from interface:Binding
Shut down the binding. Will be called on-queue- Specified by:
shutdown
in interfaceBinding
- Overrides:
shutdown
in classAbstractPollingBinding
-
isReady
protected boolean isReady()
Description copied from class:AbstractPollingBinding
Indicates whether or not the instance of the underlying implementation is ready for execution.- Specified by:
isReady
in classAbstractPollingBinding
-
preExecutionPrep
protected void preExecutionPrep()
Description copied from class:AbstractPollingBinding
This method will be called beforeAbstractPollingBinding.execute()
is called to give implementations the opportunity to prepare any data before execution begins. This method will be called within a synchronized block holding this lock.- Overrides:
preExecutionPrep
in classAbstractPollingBinding
-
execute
protected QualifiedValue execute() throws java.lang.Exception
Description copied from class:AbstractPollingBinding
Perform the blocking execution of this polling binding. This should always execute on the _executor service_- Specified by:
execute
in classAbstractPollingBinding
- Returns:
- The resulting
QualifiedValue
from the binding execution - Throws:
java.lang.Exception
- If there is a problem executing the binding
-
isDirty
protected boolean isDirty()
Description copied from class:AbstractPollingBinding
If any dependencies of the implementation have changed, this method should return true, which will kick off another execution if dependencies have changed while the execution was running.- Specified by:
isDirty
in classAbstractPollingBinding
-
-