Class 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.

    • 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
      • unsubscribe

        public void unsubscribe​(java.util.List<TagPath> tagPaths,
                                java.util.List<TagChangeListener> listeners)
      • syncSubscriptions

        protected void syncSubscriptions()
      • cancelSubscription

        protected void cancelSubscription()
      • getValueChangeMetric

        public StatMetric getValueChangeMetric()