use of org.eclipse.scout.rt.shared.session.SessionEvent in project scout.rt by eclipse.
the class AbstractClientSession method stop.
@Override
public void stop(int exitCode) {
if (!m_permitToStop.tryAcquire()) {
// we are already stopping (or have been stopped)
return;
}
try {
if (!m_desktop.doBeforeClosingInternal()) {
m_permitToStop.release();
return;
}
} catch (RuntimeException | PlatformError e) {
m_permitToStop.release();
throw e;
}
// --- Point of no return ---
m_stopping = true;
m_exitCode = exitCode;
try {
fireSessionChangedEvent(new SessionEvent(this, SessionEvent.TYPE_STOPPING));
} catch (Exception t) {
LOG.error("Failed to send STOPPING event.", t);
}
try {
interceptStoreSession();
} catch (Exception t) {
LOG.error("Failed to store the client session.", t);
}
if (m_desktop != null) {
try {
m_desktop.closeInternal();
} catch (Exception t) {
LOG.error("Failed to close the desktop.", t);
}
m_desktop = null;
}
try {
cancelRunningJobs();
} finally {
inactivateSession();
}
}
Aggregations