Reference Guide

Table Of Contents
The following is an example of how to query an application’s state:
ApplicationService as;
protected void bindAppService(ApplicationService as) {
this.as = as;
}
protected void unbindAppService(ApplicationService as) {
this.as = null;
}
@Deactivate
protected void deactivate() {
if (as != null) {
Application.State myState = as.state(“my-app_id”)
if (myState == State.UNINSTALLING) {
// handle uninstalling
} else if (myState == State.UPGRADING) {
// handle upgrading
}
}
}
228