public void run() { try { // pasing null will cause EclipseAppHandle to get the correct arguments appHandle.run(null); } catch (Throwable e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, e.getMessage(), 0, e, null)); } }
@Override public void run() { try { // pasing null will cause EclipseAppHandle to get the correct arguments appHandle.run(null); } catch (Throwable e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, e.getMessage(), 0, e, null)); } }
public void run() { try { // pasing null will cause EclipseAppHandle to get the correct arguments appHandle.run(null); } catch (Throwable e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, e.getMessage(), 0, e, null)); } }
static Object callMethod(Object obj, String methodName, Class[] argTypes, Object[] args) { try { return callMethodWithException(obj, methodName, argTypes, args); } catch (Throwable t) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, "Error in invoking method.", 0, t, null)); //$NON-NLS-1$ } return null; }
static Object callMethod(Object obj, String methodName, Class[] argTypes, Object[] args) { try { return callMethodWithException(obj, methodName, argTypes, args); } catch (Throwable t) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, "Error in invoking method.", 0, t, null)); //$NON-NLS-1$ } return null; }
static Object callMethod(Object obj, String methodName, Class[] argTypes, Object[] args) { try { return callMethodWithException(obj, methodName, argTypes, args); } catch (Throwable t) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, "Error in invoking method.", 0, t, null)); //$NON-NLS-1$ } return null; }
public void stop() { if (handleTracker == null) return; // force the default application to quit ApplicationHandle handle = (ApplicationHandle) handleTracker.getService(); if (handle != null) { try { handle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, handle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } } }
public void stop() { if (handleTracker == null) return; // force the default application to quit ApplicationHandle handle = (ApplicationHandle) handleTracker.getService(); if (handle != null) { try { handle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, handle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } } }
@Override public void stop() { if (handleTracker == null) return; // force the default application to quit ApplicationHandle handle = (ApplicationHandle) handleTracker.getService(); if (handle != null) { try { handle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, handle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } } }
void start() { launcherTracker.open(); extensionRegistry.addListener(this, PI_RUNTIME + '.' + PT_APPLICATIONS); // need to listen for system bundle stopping context.addBundleListener(this); // register all the descriptors registerAppDescriptors(); String startDefaultProp = context.getProperty(EclipseAppContainer.PROP_ECLIPSE_APPLICATION_LAUNCH_DEFAULT); if (startDefaultProp == null || "true".equalsIgnoreCase(startDefaultProp)) { //$NON-NLS-1$ // Start the default application try { startDefaultApp(true); } catch (ApplicationException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, Messages.application_errorStartDefault, 0, e, null)); } } }
void start() { launcherTracker.open(); extensionRegistry.addListener(this, PI_RUNTIME + '.' + PT_APPLICATIONS); // need to listen for system bundle stopping context.addBundleListener(this); // register all the descriptors registerAppDescriptors(); String startDefaultProp = context.getProperty(EclipseAppContainer.PROP_ECLIPSE_APPLICATION_LAUNCH_DEFAULT); if (startDefaultProp == null || "true".equalsIgnoreCase(startDefaultProp)) { //$NON-NLS-1$ // Start the default application try { startDefaultApp(true); } catch (ApplicationException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, Messages.application_errorStartDefault, 0, e, null)); } } }
void start() { launcherTracker.open(); extensionRegistry.addListener(this, PI_RUNTIME + '.' + PT_APPLICATIONS); // need to listen for system bundle stopping context.addBundleListener(this); // register all the descriptors registerAppDescriptors(); String startDefaultProp = context.getProperty(EclipseAppContainer.PROP_ECLIPSE_APPLICATION_LAUNCH_DEFAULT); if (startDefaultProp == null || "true".equalsIgnoreCase(startDefaultProp)) { //$NON-NLS-1$ // Start the default application try { startDefaultApp(true); } catch (ApplicationException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, Messages.application_errorStartDefault, 0, e, null)); } } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
private synchronized static void saveData(String fileName) { if (storageManager == null || storageManager.isReadOnly()) return; try { File data = storageManager.createTempFile(fileName); if (FILE_APPLOCKS.equals(fileName)) saveLocks(data); else if (FILE_APPSCHEDULED.equals(fileName)) saveSchedules(data); storageManager.lookup(fileName, true); storageManager.update(new String[] {fileName}, new String[] {data.getName()}); } catch (IOException e) { Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.ERROR, 0, NLS.bind(Messages.persistence_error_saving, fileName), 0, e, null)); } }
synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
@Override synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
public synchronized void handleEvent(Event event) { try { if (removed) return; ApplicationDescriptor desc = getApplicationDescriptor(); if (desc == null) // in this case the application descriptor was removed; // we must return and keep the scheduled app incase the application comes back return; desc.launch(getArguments(event)); } catch (Exception e) { String message = NLS.bind(Messages.scheduled_app_launch_error, sr); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); return; // return here to avoid removing non-recurring apps when an error occurs } if (!isRecurring()) remove(); }
@Override public synchronized void handleEvent(Event event) { try { if (removed) return; ApplicationDescriptor desc = getApplicationDescriptor(); if (desc == null) // in this case the application descriptor was removed; // we must return and keep the scheduled app incase the application comes back return; desc.launch(getArguments(event)); } catch (Exception e) { String message = NLS.bind(Messages.scheduled_app_launch_error, sr); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); return; // return here to avoid removing non-recurring apps when an error occurs } if (!isRecurring()) remove(); }