Class AudioPlayerLifecycleManager

  • All Implemented Interfaces:
    AudioEventListener, java.lang.Runnable

    public class AudioPlayerLifecycleManager
    extends java.lang.Object
    implements java.lang.Runnable, AudioEventListener
    Triggers cleanup checks on all active audio players at a fixed interval.
    • Constructor Summary

      Constructors 
      Constructor Description
      AudioPlayerLifecycleManager​(java.util.concurrent.ScheduledExecutorService scheduler, java.util.concurrent.atomic.AtomicLong cleanupThreshold)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initialise()
      Initialise the scheduled task.
      void onEvent​(AudioEvent event)  
      void run()  
      void shutdown()
      Stop the scheduled task.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AudioPlayerLifecycleManager

        public AudioPlayerLifecycleManager​(java.util.concurrent.ScheduledExecutorService scheduler,
                                           java.util.concurrent.atomic.AtomicLong cleanupThreshold)
        Parameters:
        scheduler - Scheduler to use for the cleanup check task
        cleanupThreshold - Threshold for player cleanup
    • Method Detail

      • initialise

        public void initialise()
        Initialise the scheduled task.
      • shutdown

        public void shutdown()
        Stop the scheduled task.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable