protected void destroySpecific() { // when this method is called we must force the application to exit. // first set the status to stopping setAppStatus(EclipseAppHandle.FLAG_STOPPING); // now force the application to stop IApplication app = getApplication(); if (app != null) app.stop(); // make sure the app status is stopped setAppStatus(EclipseAppHandle.FLAG_STOPPED); }
@Override protected void destroySpecific() { // when this method is called we must force the application to exit. // first set the status to stopping setAppStatus(EclipseAppHandle.FLAG_STOPPING); // now force the application to stop IApplication app = getApplication(); if (app != null) app.stop(); // make sure the app status is stopped setAppStatus(EclipseAppHandle.FLAG_STOPPED); }
protected void destroySpecific() { // when this method is called we must force the application to exit. // first set the status to stopping setAppStatus(EclipseAppHandle.FLAG_STOPPING); // now force the application to stop IApplication app = getApplication(); if (app != null) app.stop(); // make sure the app status is stopped setAppStatus(EclipseAppHandle.FLAG_STOPPED); }
private synchronized Object setInternalResult(Object result, boolean isAsync, IApplication tokenApp) { if (setResult) throw new IllegalStateException("The result of the application is already set."); //$NON-NLS-1$ if (isAsync) { if (!setAsyncResult) throw new IllegalStateException("The application must return IApplicationContext.EXIT_ASYNC_RESULT to set asynchronous results."); //$NON-NLS-1$ if (application != tokenApp) throw new IllegalArgumentException("The application is not the correct instance for this application context."); //$NON-NLS-1$ } else { if (result == IApplicationContext.EXIT_ASYNC_RESULT) { setAsyncResult = true; return NULL_RESULT; // the result well be set with setResult } } this.result = result; setResult = true; application = null; notifyAll(); // The application exited itself; notify the app context setAppStatus(EclipseAppHandle.FLAG_STOPPING); // must ensure the STOPPING event is fired setAppStatus(EclipseAppHandle.FLAG_STOPPED); // only set the exit code property if this is the default application // (bug 321386) only set the exit code if the result != null; when result == null we assume an exception was thrown if (isDefault() && result != null) { int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0; // Use the EnvironmentInfo Service to set properties Activator.setProperty(PROP_ECLIPSE_EXITCODE, Integer.toString(exitCode)); } return result; }
private synchronized Object setInternalResult(Object result, boolean isAsync, IApplication tokenApp) { if (setResult) throw new IllegalStateException("The result of the application is already set."); //$NON-NLS-1$ if (isAsync) { if (!setAsyncResult) throw new IllegalStateException("The application must return IApplicationContext.EXIT_ASYNC_RESULT to set asynchronous results."); //$NON-NLS-1$ if (application != tokenApp) throw new IllegalArgumentException("The application is not the correct instance for this application context."); //$NON-NLS-1$ } else { if (result == IApplicationContext.EXIT_ASYNC_RESULT) { setAsyncResult = true; return NULL_RESULT; // the result well be set with setResult } } this.result = result; setResult = true; application = null; notifyAll(); // The application exited itself; notify the app context setAppStatus(EclipseAppHandle.FLAG_STOPPING); // must ensure the STOPPING event is fired setAppStatus(EclipseAppHandle.FLAG_STOPPED); // only set the exit code property if this is the default application // (bug 321386) only set the exit code if the result != null; when result == null we assume an exception was thrown if (isDefault() && result != null) { int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0; // Use the EnvironmentInfo Service to set properties Activator.setProperty(PROP_ECLIPSE_EXITCODE, Integer.toString(exitCode)); } return result; }
private synchronized Object setInternalResult(Object result, boolean isAsync, IApplication tokenApp) { if (setResult) throw new IllegalStateException("The result of the application is already set."); //$NON-NLS-1$ if (isAsync) { if (!setAsyncResult) throw new IllegalStateException("The application must return IApplicationContext.EXIT_ASYNC_RESULT to set asynchronous results."); //$NON-NLS-1$ if (application != tokenApp) throw new IllegalArgumentException("The application is not the correct instance for this application context."); //$NON-NLS-1$ } else { if (result == IApplicationContext.EXIT_ASYNC_RESULT) { setAsyncResult = true; return NULL_RESULT; // the result well be set with setResult } } this.result = result; setResult = true; application = null; notifyAll(); // The application exited itself; notify the app context setAppStatus(EclipseAppHandle.FLAG_STOPPING); // must ensure the STOPPING event is fired setAppStatus(EclipseAppHandle.FLAG_STOPPED); // only set the exit code property if this is the default application // (bug 321386) only set the exit code if the result != null; when result == null we assume an exception was thrown if (isDefault() && result != null) { int exitCode = result instanceof Integer ? ((Integer) result).intValue() : 0; // Use the EnvironmentInfo Service to set properties Activator.setProperty(PROP_ECLIPSE_EXITCODE, Integer.toString(exitCode)); } return result; }
public void applicationRunning() { // first set the application handle status to running setAppStatus(EclipseAppHandle.FLAG_ACTIVE); // now run the splash handler final ServiceReference[] monitors = getStartupMonitors(); if (monitors == null) return; SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable e) { // just continue ... the exception has already been logged by // handleException(ISafeRunnable) } public void run() throws Exception { for (int i = 0; i < monitors.length; i++) { StartupMonitor monitor = (StartupMonitor) Activator.getContext().getService(monitors[i]); if (monitor != null) { monitor.applicationRunning(); Activator.getContext().ungetService(monitors[i]); } } } }); }
public void applicationRunning() { // first set the application handle status to running setAppStatus(EclipseAppHandle.FLAG_ACTIVE); // now run the splash handler final ServiceReference[] monitors = getStartupMonitors(); if (monitors == null) return; SafeRunner.run(new ISafeRunnable() { public void handleException(Throwable e) { // just continue ... the exception has already been logged by // handleException(ISafeRunnable) } public void run() throws Exception { for (int i = 0; i < monitors.length; i++) { StartupMonitor monitor = (StartupMonitor) Activator.getContext().getService(monitors[i]); if (monitor != null) { monitor.applicationRunning(); Activator.getContext().ungetService(monitors[i]); } } } }); }
@Override public void applicationRunning() { // first set the application handle status to running setAppStatus(EclipseAppHandle.FLAG_ACTIVE); // now run the splash handler final ServiceReference[] monitors = getStartupMonitors(); if (monitors == null) return; SafeRunner.run(new ISafeRunnable() { @Override public void handleException(Throwable e) { // just continue ... the exception has already been logged by // handleException(ISafeRunnable) } @Override public void run() throws Exception { for (int i = 0; i < monitors.length; i++) { StartupMonitor monitor = (StartupMonitor) Activator.getContext().getService(monitors[i]); if (monitor != null) { monitor.applicationRunning(); Activator.getContext().ungetService(monitors[i]); } } } }); }