/** * {@inheritDoc} * @throws an IllegalStateException if called on the * {@linkplain #getDefault default request processor} * @since org.openide.util 8.2 */ @Override public List<Runnable> shutdownNow() { if (this == UNLIMITED) { throw new IllegalStateException ("Cannot shut down the default " + //NOI18N "request processor"); //NOI18N } //XXX more aggressive shutdown? stop(); synchronized (processorLock) { List<Runnable> result = new ArrayList<Runnable>(getQueue().size()); for (Item item : getQueue()) { Task task = item.getTask(); if (task != null && task.run != null) { Runnable r = task.run; if (r instanceof RunnableWrapper) { Runnable other = ((RunnableWrapper) r).getRunnable(); r = other == null ? r : other; } result.add(r); } } return result; } }
public void run() { try { PostInstallJ2meAction.installAction(rootPath); if (marker != null){ BufferedWriter bw = null; try{ bw = new BufferedWriter(new FileWriter(marker)); bw.write(java); } catch(IOException ioex){ } finally { if (bw != null){ try { bw.close(); } catch (IOException ex) { } } } } } catch (IOException e) { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); } rp.stop(); } }, 1000);
public void run() { if (! unpackEmulator(emulatorPack, targetFolder)) { ErrorManager.getDefault().log("Failed to unpack emulator: " + emulatorPack.getAbsolutePath()); // NOI18N return; } ErrorManager.getDefault().log("Emulator unpacked: " + emulatorPack.getAbsolutePath()); // NOI18N //Create a marker for finished installation try { new File(rootFolder,EMU_MARKER).createNewFile(); } catch (IOException ex) {} //Create a marker for post install task checkJavaPath(rootFolder); rp.stop(); } }, 1000);
/** * {@inheritDoc} * @throws an IllegalStateException if called on the * {@linkplain #getDefault default request processor} * @since org.openide.util 8.2 */ @Override public List<Runnable> shutdownNow() { if (this == UNLIMITED) { throw new IllegalStateException ("Cannot shut down the default " + //NOI18N "request processor"); //NOI18N } //XXX more aggressive shutdown? stop(); synchronized (processorLock) { List<Runnable> result = new ArrayList<Runnable>(getQueue().size()); for (Item item : getQueue()) { Task task = item.getTask(); if (task != null && task.run != null) { Runnable r = task.run; if (r instanceof RunnableWrapper) { Runnable other = ((RunnableWrapper) r).getRunnable(); r = other == null ? r : other; } result.add(r); } } return result; } }