@Override
  public void onApplicationEvent(ApplicationEvent event) {
    if (event instanceof ContextRefreshedEvent) {
      contextInitialized((ContextRefreshedEvent) event);
    } else if (event instanceof ContextClosedEvent) {
      contextDestroyed((ContextClosedEvent) event);
    }
  }
This class is used for checking the application running mode i.e. Embedded or not

@since GemFire version 7.0.Beta 2012-09-23
geode-pulse/src/main/java/org/apache/geode/tools/pulse/internal/PulseAppListener.java