State changeTo(final State newState) {
      switch (newState) {
        case CREATED:
          if (this != STOPPED) {
            throw new IllegalStateException("Session must not exist before creating");
          }
          return CREATED;
        case STARTED:
          if (this != CREATED) {
            throw new IllegalStateException("Session must be created before starting");
          }
          return STARTED;
        case STOPPED:
          if (this != STARTED) {
            throw new IllegalStateException("Session must be started before stopping");
          }
      }
      return STOPPED;
    }
The {@code DistributedSystem} connection uses {@code AlertingSession} to control the lifecycle
of the registered {@code AlertingProvider}.

<p>
During initialization of {@code DistributedSystem} a new {@code AlertingSession} is instantiated
and {@code createSession} will be invoked with a new instance of {@code ClusterAlertMessaging}.
After
a {@code DistributionConfig} exists, it will then invoke {@code startSession}. During disconnect,
it will invoke {@code stopSession}.

<p>
The {@code AlertAppender} will capture the {@code ClusterAlertMessaging} in order to send out
{@code Alert} messages to registered {@code Alert} listeners. {@code startSession} will cause
the appender to unpause and begin processing all incoming log events. Any log event that meets
the {@code AlertLevel} of one or more {@code Alert} listeners will result in the generation of
an {@code Alert} being sent to those listeners.
geode-core/src/main/java/org/apache/geode/alerting/internal/AlertingSession.java