Class ClientTagSubscriptionManager
- java.lang.Object
-
- com.inductiveautomation.ignition.client.tags.impl.ClientTagSubscriptionManager
-
public class ClientTagSubscriptionManager extends java.lang.Object
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 Classes Modifier and Type Class Description protected class
ClientTagSubscriptionManager.ListenerDeliveryManager
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
ClientTagSubscriptionManager.TagSubscription
class
ClientTagSubscriptionManager.ValueUpdateListener
-
Constructor Summary
Constructors Constructor Description ClientTagSubscriptionManager(ClientContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelSubscription()
protected boolean
checkPathArgs(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners)
protected void
deliverSubscriptionUpdates(PropertyChangePushNotification data)
StatMetric
getValueChangeMetric()
boolean
isGatewayUp()
protected void
refreshConnectedState()
void
shutdown()
void
subscribe(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners)
protected void
syncSubscriptions()
void
unsubscribe(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners)
-
-
-
Constructor Detail
-
ClientTagSubscriptionManager
public ClientTagSubscriptionManager(ClientContext context)
-
-
Method Detail
-
refreshConnectedState
protected void refreshConnectedState()
-
isGatewayUp
public boolean isGatewayUp()
-
shutdown
public void shutdown()
-
checkPathArgs
protected boolean checkPathArgs(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
subscribe
public void subscribe(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners)
-
unsubscribe
public void unsubscribe(java.util.List<TagPath> tagPaths, java.util.List<TagChangeListener> listeners)
-
syncSubscriptions
protected void syncSubscriptions()
-
cancelSubscription
protected void cancelSubscription()
-
deliverSubscriptionUpdates
protected void deliverSubscriptionUpdates(PropertyChangePushNotification data)
-
getValueChangeMetric
public StatMetric getValueChangeMetric()
-
-