Enum Class PushEngineState

java.lang.Object
java.lang.Enum<PushEngineState>
com.iizix.push.PushEngineState
All Implemented Interfaces:
Serializable, Comparable<PushEngineState>, Constable

public enum PushEngineState extends Enum<PushEngineState>
The lifecycle state of the IPushNotificationEngine.

The engine is lazily created on first access and progresses through these states in order. IPushNotificationEngine.getState() reports the current one. Terminal state is STOPPED; a stopped engine is not restarted, a new one is created on the next access after disposal.

Persistence note. Should a state ever be stored in a property container, it is stored by ordinal() (see the enum-storage idiom in IPushSettings). The order of these constants is therefore part of the persisted contract: new constants MUST be appended at the end, never inserted or reordered, or an existing stored value will silently change meaning.

Author:
IIZI
  • Enum Constant Details

    • NOT_STARTED

      public static final PushEngineState NOT_STARTED
      The engine instance exists but its resources (executor, semaphore, spool, transports) have not yet been initialized. This is the state immediately after lazy construction and before the first start().
    • STARTING

      public static final PushEngineState STARTING
      The engine is initializing its resources. Sends requested in this state are rejected or held until RUNNING, at the engine's discretion; they are never silently dropped.
    • RUNNING

      public static final PushEngineState RUNNING
      The engine is fully initialized and accepting sends. This is the only state in which a send is dispatched.
    • STOPPING

      public static final PushEngineState STOPPING
      The engine is draining: it accepts no new sends, allows in-flight sends to complete, and flushes or persists the spool. A send requested in this state is rejected, not queued.
    • STOPPED

      public static final PushEngineState STOPPED
      The engine has released its resources and will accept no further work. This is terminal; the engine is not restarted from this state.
  • Method Details

    • values

      public static PushEngineState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PushEngineState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null