Class ClientTagSubscriptionManager
java.lang.Object
com.inductiveautomation.ignition.client.tags.impl.ClientTagSubscriptionManager
This class manages subscriptions between the tag system to the gateway. A few notes: 1) Only 1 instance of a given
path is subscribed to the gateway. Multiple listeners on a path are managed in, by TagSubscription (therefore there's
a map from TagPath->TagSubscription) 2) Unlike the old system, we subscribe to the FULL specific path- including
property. Pre-8.0 subscribed to the root path, because we'd get the full tag def. Now we get the specific value for
the path we want. 3) THREADING --- Values are ultimately delivered on the EDT, as was always done. --- We desperately
try to avoid queuing tasks which could lead to a VERY hard to detect memory leak. The side effect of this is that we
don't guarantee that every single value will be delivered to listeners. --- We try to separate out locking for
subscription modification functions from those that interact with the gw. Calls to the gateway might be slow, and we
don't want to block screen changes, etc, on that. But we also don't want to end up with listeners that are no longer
actually used. 4) Path management: We try to do diff-based management with the gateway, tracking what we last sent,
and sending adds/removes. A CRC is calculated on both sides, and after each modification, should be the same on both
sides. However, if it's wrong for some reason, we'll just throw everything out and re-sync.
Default tag provider is handled on the gateway side. All of this makes its way through TagProviderRPC at some point.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
The goal of this class is to 1) deliver property change events on the EDT and 2) Not let slow prop change events cause a build up of new changesprotected class
class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected boolean
checkPathArgs
(List<TagPath> tagPaths, List<TagChangeListener> listeners) protected void
boolean
protected void
void
shutdown()
void
subscribe
(List<TagPath> tagPaths, List<TagChangeListener> listeners) protected void
void
unsubscribe
(List<TagPath> tagPaths, List<TagChangeListener> listeners) protected void
updateValidateTaskRegistration
(boolean connectionUp) Registers or unregisterssyncSubscriptions()
based on if gateway is considered up
-
Constructor Details
-
ClientTagSubscriptionManager
-
-
Method Details
-
updateValidateTaskRegistration
protected void updateValidateTaskRegistration(boolean connectionUp) Registers or unregisterssyncSubscriptions()
based on if gateway is considered up -
refreshConnectedState
protected void refreshConnectedState() -
isGatewayUp
public boolean isGatewayUp() -
shutdown
public void shutdown() -
checkPathArgs
protected boolean checkPathArgs(List<TagPath> tagPaths, List<TagChangeListener> listeners) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
subscribe
-
unsubscribe
-
syncSubscriptions
protected void syncSubscriptions() -
cancelSubscription
protected void cancelSubscription() -
deliverSubscriptionUpdates
-
getValueChangeMetric
-