Class BackgroundListener


  • public class BackgroundListener
    extends Object
    • Constructor Detail

      • BackgroundListener

        public BackgroundListener​(com.fifa.connectservicebus.sdk.FifaConnectServiceBusClient client,
                                  CacheCleanJob cleanJob,
                                  com.fifa.connectservicebus.sdk.logging.Logger logger)
      • BackgroundListener

        public BackgroundListener​(com.fifa.connectservicebus.sdk.FifaConnectServiceBusClient client,
                                  CacheCleanJob cleanJob,
                                  com.fifa.connectservicebus.sdk.logging.Logger logger,
                                  Collection<MessageHandler> customMessageHandlers)
    • Method Detail

      • run

        public void run()
      • runInBackgroundThread

        public void runInBackgroundThread​(CancellationToken token)
      • runInBackgroundThread

        public void runInBackgroundThread()
      • runWithTimeout

        public void runWithTimeout​(int milliseconds)
      • runWithTimeout

        public boolean runWithTimeout​(int milliseconds,
                                      CancellationToken token)
        Parameters:
        milliseconds - milliseconds to wait before shutting down
        token - cancellation token to force shutdown before timeout elapses
        Returns:
        true if completed without timeout (i.e. cancelled by @cancellationToken); false if timeout was reached
      • getExceptionCounterLimit

        public int getExceptionCounterLimit()
      • setExceptionCounterLimit

        public void setExceptionCounterLimit​(int exceptionCounterLimit)
      • getExceptionSleepTimeMilliseconds

        public long getExceptionSleepTimeMilliseconds()
      • setExceptionSleepTimeMilliseconds

        public void setExceptionSleepTimeMilliseconds​(long exceptionSleepTimeMilliseconds)