Class AdUnitStateMachine

  • All Implemented Interfaces:
    com.inmobi.media.ads.common.listeners.AUDestroyListener

    
    public abstract class AdUnitStateMachine
    extends StateMachine implements AUDestroyListener
                        

    An abstract base class for managing the state and lifecycle of an ad unit.

    This class provides a state machine implementation for ad units, allowing them to transition between different states and perform actions based on those states. It also implements the AUMDestroyListener interface to handle cleanup when the ad unit is being destroyed.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit inflate()
      Unit onDestroy() Called when an ad unit is being destroyed and requires cleanup.
      • Methods inherited from class com.inmobi.media.ads.common.base.state.StateMachine

        changeState, changeStateSuspending
      • Methods inherited from class java.lang.Object

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

      • AdUnitStateMachine

        AdUnitStateMachine(AdComponent adComponent)
    • Method Detail

      • onDestroy

         Unit onDestroy()

        Called when an ad unit is being destroyed and requires cleanup.

        This method is invoked when the ad unit lifecycle is ending and all associated resources should be released. The method is suspending to allow for asynchronous cleanup operations such as cancelling coroutines, releasing network connections, or performing database cleanup. Implementers should ensure all resources are properly cleaned up to prevent memory leaks.