Class SharedProcessor<T>


  • public class SharedProcessor<T>
    extends Object
    SharedProcessor class manages all the registered ProcessListener and distributes notifications. This has been taken from official-client: https://github.com/kubernetes-client/java/blob/master/util/src/main/java/io/kubernetes/client/informer/cache/SharedProcessor.java
    • Constructor Detail

      • SharedProcessor

        public SharedProcessor()
    • Method Detail

      • addAndStartListener

        public void addAndStartListener​(ProcessorListener<T> processorListener)
        First adds the specific processorListener then starts the listener with executor.
        Parameters:
        processorListener - specific processor listener
      • addListener

        public void addListener​(ProcessorListener<T> processorListener)
        Adds the specific processorListener, but not start it.
        Parameters:
        processorListener - specific processor listener
      • run

        public void run()
        Starts the processor listeners.
      • distribute

        public void distribute​(ProcessorListener.Notification<T> obj,
                               boolean isSync)
        Distribute the object amount listeners.
        Parameters:
        obj - specific obj
        isSync - whether in sync or not
      • shouldResync

        public boolean shouldResync()
      • stop

        public void stop()