Class CounterManagerNotificationManager

    • Constructor Detail

      • CounterManagerNotificationManager

        public CounterManagerNotificationManager()
    • Method Detail

      • inject

        public void inject​(org.infinispan.util.concurrent.BlockingManager blockingManager)
      • stop

        public void stop()
      • registerCounter

        public void registerCounter​(org.infinispan.util.ByteString counterName,
                                    CounterEventGenerator generator,
                                    TopologyChangeListener topologyChangeListener)
        It registers a new counter created locally.
        Parameters:
        counterName - The counter's name.
        generator - The counter's CounterEvent generator.
        topologyChangeListener - The counter's listener to topology change. It can be null.
        Throws:
        IllegalStateException - If the counter with that name is already registered.
      • registerUserListener

        public <T extends CounterListenerHandle<T> registerUserListener​(org.infinispan.util.ByteString counterName,
                                                                          T userListener)
        It registers a user's CounterListener for a specific counter.
        Parameters:
        counterName - The counter's name to listen.
        userListener - The CounterListener to be invoked.
        Returns:
        The Handle for the CounterListener.
      • registerCounterValueListener

        public CompletionStage<Void> registerCounterValueListener​(org.infinispan.Cache<? extends CounterKey,​CounterValue> cache)
        It registers the clustered cache listener if they aren't already registered.

        This listener receives notification when a counter's value is updated.

        Parameters:
        cache - The Cache to listen to cluster events.
      • registerTopologyListener

        public CompletionStage<Void> registerTopologyListener​(org.infinispan.Cache<? extends CounterKey,​CounterValue> cache)
        It registers the topology cache listener if they aren't already registered.
        Parameters:
        cache - The Cache to listen to cluster events.
      • removeCounter

        public void removeCounter​(org.infinispan.util.ByteString counterName)
        It removes and stops sending notification to the counter.
        Parameters:
        counterName - The counter's name to remove.