final boolean isOpen = isOpen();
if(wasOpen && !isOpen){
// application went down
wasOpen = false;
EventSystem.getInstance().fireEvent(
new ApplicationDownEvent(appConfig));
}else if(!wasOpen && isOpen){
// application came pack up
wasOpen = true;
EventSystem.getInstance().fireEvent(
new ApplicationUpEvent(appConfig));