Example usage for java.lang Thread MIN_PRIORITY

List of usage examples for java.lang Thread MIN_PRIORITY

Introduction

In this page you can find the example usage for java.lang Thread MIN_PRIORITY.

Prototype

int MIN_PRIORITY

To view the source code for java.lang Thread MIN_PRIORITY.

Click Source Link

Document

The minimum priority that a thread can have.

Usage

From source file:com.moss.bdbadmin.client.ui.BdbAdminClient.java

public static void main(String[] args) throws Exception {

    Thread t = new Thread() {
        public void run() {
            try {
                Magic.initialize();/*from w w w  . j  a va2 s.  c  o  m*/
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    };
    t.setPriority(Thread.MIN_PRIORITY);
    t.start();

    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    HttpClient httpClient = new HttpClient();
    BdbClient.init();

    JFrame frame = new JFrame();

    ProxyFactory proxyFactory = VeracityProxyFactory.create();

    BdbAdminClient client = new BdbAdminClient(httpClient, frame, new File("config.xml"), proxyFactory);

    frame.setTitle("Bdb Network Explorer");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(client);
    frame.setSize(1024, 768);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}

From source file:tvbrowser.TVBrowser.java

private static void startPeriodicSaveSettings() {
    // Every 5 minutes we store all the settings so they are stored in case of
    // an unexpected failure
    Thread saveThread = new Thread("Store settings periodically") {
        public void run() {
            mSaveThreadShouldStop = false;
            while (!mSaveThreadShouldStop) {
                try {
                    Thread.sleep(5 * 60 * 1000);
                } catch (Exception exc) {
                    // ignore
                }//from w  w  w  .j  a  v a  2 s . c om

                if (!mSaveThreadShouldStop && !TvDataUpdater.getInstance().isDownloading()) {
                    flushSettings(true);
                }
            }
        }
    };
    saveThread.setPriority(Thread.MIN_PRIORITY);
    saveThread.start();
}

From source file:org.opendedup.collections.ShardedProgressiveFileBasedCSMap.java

/**
 * initializes the Object set of this hash table.
 * /* w ww. j  ava2s .  co m*/
 * @param initialCapacity
 *            an <code>int</code> value
 * @return an <code>int</code> value
 * @throws HashtableFullException
 * @throws FileNotFoundException
 */
public long setUp() throws Exception {
    File _fs = new File(fileName);
    if (!_fs.getParentFile().exists()) {
        _fs.getParentFile().mkdirs();
    }
    SDFSLogger.getLog().info("Folder = " + _fs.getPath());
    SDFSLogger.getLog().info("Loading freebits bitset");
    long rsz = 0;
    this.setMaxSize(maxSz);
    File[] files = _fs.getParentFile().listFiles(new DBFileFilter());
    if (files.length > 0) {
        CommandLineProgressBar bar = new CommandLineProgressBar("Loading Existing Hash Tables", files.length,
                System.out);
        this.loadEvent.maxCt = files.length + 128;
        for (int i = 0; i < files.length; i++) {
            this.loadEvent.curCt = this.loadEvent.curCt + 1;
            int sz = NextPrime.getNextPrimeI((int) (this.hashTblSz));
            // SDFSLogger.getLog().debug("will create byte array of size "
            // + sz + " propsize was " + propsize);
            ShardedFileByteArrayLongMap m = null;
            String pth = files[i].getPath();
            String pfx = pth.substring(0, pth.length() - 5);
            m = new ShardedFileByteArrayLongMap(pfx, sz);
            long mep = m.setUp();
            if (mep > endPos)
                endPos = mep;
            maps.add(m);
            rsz = rsz + m.size();
            bar.update(i);
            if (!m.isFull() && this.activeWMap == null) {
                m.activate();
                this.activeWMap = m;
            } else {
                m.inActive();
                m.full = true;
            }
        }
        bar.finish();
    }

    this.loadEvent.shortMsg = "Loading BloomFilters";

    if (maps.size() != 0 && !LargeBloomFilter.exists(_fs.getParentFile())) {
        lbf = new LargeBloomFilter(_fs.getParentFile(), maxSz, .001, true, true, false);
        SDFSLogger.getLog().warn("Recreating BloomFilters...");
        this.loadEvent.shortMsg = "Recreating BloomFilters";

        executor = new ThreadPoolExecutor(Main.writeThreads, Main.writeThreads, 10, TimeUnit.SECONDS,
                worksQueue, new ProcessPriorityThreadFactory(Thread.MIN_PRIORITY), executionHandler);
        CommandLineProgressBar bar = new CommandLineProgressBar("ReCreating BloomFilters", maps.size(),
                System.out);
        Iterator<AbstractShard> iter = maps.iterator();
        int i = 0;
        ArrayList<LBFReconstructThread> al = new ArrayList<LBFReconstructThread>();
        while (iter.hasNext()) {
            AbstractShard m = iter.next();
            LBFReconstructThread th = new LBFReconstructThread(lbf, m);
            executor.execute(th);
            al.add(th);
            i++;
            bar.update(i);
        }
        executor.shutdown();
        bar.finish();
        try {
            System.out.print("Waiting for all BloomFilters creation threads to finish");
            while (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
                SDFSLogger.getLog().debug("Awaiting fdisk completion of threads.");
                System.out.print(".");

            }
            for (LBFReconstructThread th : al) {
                if (th.ex != null)
                    throw th.ex;
            }
            System.out.println(" done");
        } catch (Exception e1) {
            throw new IOException(e1);
        }
    } else {
        lbf = new LargeBloomFilter(_fs.getParentFile(), maxSz, .001, true, true, false);
    }
    if (this.activeWMap == null) {
        boolean written = false;
        while (!written) {
            String guid = RandomGUID.getGuid();

            File f = new File(fileName + "-" + guid + ".keys");
            if (!f.exists()) {
                activeWMap = new ShardedFileByteArrayLongMap(fileName + "-" + guid, this.hashTblSz);
                activeWMap.activate();
                activeWMap.setUp();

                this.maps.add(activeWMap);
                written = true;

            }
        }
    }
    this.loadEvent.endEvent("Loaded entries " + rsz);
    System.out.println("Loaded entries " + rsz);
    SDFSLogger.getLog().info("Loaded entries " + rsz);
    SDFSLogger.getLog().info("Loading BloomFilters " + rsz);
    this.kSz.set(rsz);
    this.closed = false;
    return size;
}

From source file:com.mibr.android.intelligentreminder.INeedToo.java

/** Called when the activity is first created. */
@Override// w ww .  jav  a 2s  .  c o m
public void onCreate(Bundle savedInstanceState) {
    /* this was just a test      if(mLocationManager==null) {
             mLocationManager=(android.location.LocationManager) getSystemService(Context.LOCATION_SERVICE);
          }
    */
    //      TabHost host=this.getTabHost();
    //      host.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
    //         
    //         @Override
    //         public void onTabChanged(String tabId) {
    //            if(INeedToo.this._doingCreatingTabs==false) {
    //               if(tabId.equals("tab1")) {
    //                  INeedToo.this._forceNonCompany=true;
    //               }
    //            }
    //         }
    //      });
    super.onCreate(savedInstanceState);
    mLocationClient = new LocationClient(this, this, this);
    mLocationClient.connect();
    try {
        if (getIntent().getAction() != null && getIntent().getAction().equals("doPrimitiveDeletedNeed")) {
            transmitNetwork(getIntent().getStringExtra("phoneid"));
            return;
        }
    } catch (Exception eieio) {
        return;
    }
    try {
        /*
                    putExtra("needId",needId).
          putExtra("foreignNeedId",foreignNeedId).
          putExtra("phoneid",phoneid).
          putExtra("foreignLocationId",foreignLocationId)
                
         */
        if (getIntent().getAction() != null
                && getIntent().getAction().equals("transmitNetworkDeletedThisNeedByOnBehalfOf")) {
            long needId = getIntent().getLongExtra("needId", -11);
            long foreignNeedId = getIntent().getLongExtra("foreignNeedId", -11);
            String phoneId = getIntent().getStringExtra("phoneid");
            long foreignLocationId = getIntent().getLongExtra("foreignLocationId", -11);
            if (needId != -11 && foreignNeedId != -11 && foreignLocationId != -11 && isNothingNot(phoneId))
                transmitNetworkDeletedThisNeedByOnBehalfOf(needId, foreignNeedId, phoneId, foreignLocationId);
            return;
        }
    } catch (Exception ei3) {
        return;
    }

    /*bbhbb 2011-03-26*/ /*bbhbb2013_05_01 isn't this being done below?
                         *    Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler("")); */

    mHandler = new Handler();

    doBindService();
    mSingleton = this;
    ///////////mSingleton.log("onCreating_INeedToo", 1);

    if (getPackageName().toLowerCase().indexOf("trial") != -1 && !isSpecialPhone()) {
        if (!iveCheckedAuthorizationStatusForThisPhone) {
            doViewCount = true;
            iveCheckedAuthorizationStatusForThisPhone = true;
            final Timer jdTimer = new Timer("Registering");
            jdTimer.schedule(new TimerTask() {
                public void run() {
                    Thread thread = new Thread(new Runnable() {
                        public void run() {
                            Intent intent = new Intent(INeedToo.this, INeedWebService.class)
                                    .setAction("CheckStatus");
                            startService(intent);
                            jdTimer.cancel();
                        }
                    });
                    thread.setPriority(Thread.MIN_PRIORITY);
                    thread.run();
                }
            }, 3000, 1000 * 60 * 10);

        }
    } else {
        if (IS_ANDROID_VERSION) {
            if (!isSpecialPhone()
                    || INeedToo.mSingleton.getPhoneId().toLowerCase().equals("20013fc135cd6097xx")) {

                final Timer jdTimer = new Timer("Licensing");
                jdTimer.schedule(new TimerTask() {
                    public void run() {
                        Thread thread = new Thread(new Runnable() {
                            public void run() {
                                // Construct the LicenseCheckerCallback. The library calls this when done.        
                                mLicenseCheckerCallback = new MyLicenseCheckerCallback();
                                // Construct the LicenseChecker with a Policy.        
                                mChecker = new LicenseChecker(INeedToo.this,
                                        new ServerManagedPolicy(INeedToo.this,
                                                new AESObfuscator(SALT, getPackageName(),
                                                        //                           "com.mibr.android.intelligentreminder",
                                                        getDeviceId())),
                                        BASE64_PUBLIC_KEY // Your public licensing key.
                                );
                                mChecker.checkAccess(mLicenseCheckerCallback);
                            }
                        });
                        thread.setPriority(Thread.MIN_PRIORITY);
                        thread.run();
                    }
                }, 3000, 1000 * 60 * 10);
            }
        }
    }

    try {
        _logFilter = Integer
                .valueOf(getSharedPreferences(INeedToo.PREFERENCES_LOCATION, Preferences.MODE_PRIVATE)
                        .getString("LoggingLevel", "3"));
    } catch (Exception e) {
    }

    if (!INeedLocationService.USING_LOCATION_SERVICES) {

        int logFilter = 3;
        try {
            logFilter = Integer
                    .valueOf(getSharedPreferences(INeedToo.PREFERENCES_LOCATION, Preferences.MODE_PRIVATE)
                            .getString("LoggingLevel", "3"));
        } catch (Exception e) {
        }
        Intent jdIntent = new Intent(this, INeedTimerServices.class).putExtra("logFilter", logFilter);

        getApplicationContext().startService(jdIntent);
    }
    Thread.setDefaultUncaughtExceptionHandler(new CustomExceptionHandler(""));
    if (INeedToo.mSingleton.getPhoneId().toLowerCase().equals("22a100000d9f25c5")) {
        DELAYPOSTTTS = 100;
    }

    // I don't need this because IHaveNeeds.onresume does it      getApplicationContext().startService(new Intent(this, INeedLocationService.class));
    if (!_doneSplashy) {
        _doneSplashy = true;
        if (!getVersionFile()) {
            stampVersion();
            showDialog(DIALOG_SPLASH);
        } else {
            //showDialog(DIALOG_SPLASH);
        }
    }
    if (allItems != null) {
        whereImAtInAllItems++;
        if (whereImAtInAllItems < allItems.size()) {
            showDialog(DOING_SAMPLE_NEEDS_DIALOG);
        } else {
            allItems = null;
        }
    }

    setTitle(getHeading());
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
        _initialTabIndex = bundle.getInt("initialtabindex", 0);
        _didContact = bundle.getBoolean("iscontact", false);
        if (_initialTabIndex == 1) {
            _doingLocationCompany = bundle.getString("doingcompany");
        } else {
            _doingLocationCompany = null;
        }
    } else {
        _doingLocationCompany = null;
    }
    final TabHost tabHost = getTabHost();
    tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("Need",

            getResources().getDrawable(R.drawable.status_bar2_blackwhite))
            .setContent(new Intent(this, IHaveNeeds.class).putExtra("iscontact", this._didContact)));

    tabHost.addTab(tabHost.newTabSpec("tab2")
            .setIndicator("Location",
                    (BitmapDrawable) getResources().getDrawable(android.R.drawable.ic_menu_mapmode))
            .setContent(
                    new Intent(this, IHaveLocations.class).putExtra("doingcompany", _doingLocationCompany)));
    Intent intent = new Intent(this, NeedMap.class).putExtra("doingcompany", _doingLocationCompany);
    tabHost.addTab(tabHost.newTabSpec("tab2a")
            .setIndicator("Map", (BitmapDrawable) getResources().getDrawable(R.drawable.ic_dialog_map))
            .setContent(intent));
    /*
    tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator(
    "History",(BitmapDrawable) getResources().getDrawable(
          R.drawable.chart)).setContent(
                new Intent(this, IHaveHistory.class)));
    */
    tabHost.addTab(tabHost.newTabSpec("tab4")
            .setIndicator("System",
                    (BitmapDrawable) getResources().getDrawable(R.drawable.status_bar1_blackwhite))
            .setContent(new Intent(this, ListPlus.class)));
    /*      tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator(
    "Need",
    scaleTo((BitmapDrawable) getResources().getDrawable(
          R.drawable.status_bar2_blackwhite), 36f)).setContent(
                new Intent(this, IHaveNeeds.class).putExtra("iscontact", this._didContact)));
            
    tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator(
       "Location",
       scaleTo((BitmapDrawable) getResources().getDrawable(
             android.R.drawable.ic_menu_mapmode), 36f)).setContent(
                   new Intent(this, IHaveLocations.class).putExtra("doingcompany", _doingLocationCompany)));
    tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator(
    "History",
    scaleTo((BitmapDrawable) getResources().getDrawable(
          R.drawable.chart), 36f)).setContent(
                new Intent(this, IHaveHistory.class)));
    tabHost.addTab(tabHost.newTabSpec("tab4").setIndicator(
    "System",
    scaleTo((BitmapDrawable) getResources().getDrawable(
          R.drawable.status_bar1_blackwhite), 31f)).setContent(
                new Intent(this, ListPlus.class)));
    */
    tabHost.setCurrentTab(_initialTabIndex);
    boolean networkingOutbound = getSharedPreferences(INeedToo.PREFERENCES_LOCATION, Preferences.MODE_PRIVATE)
            .getBoolean("Networking_Outbound_Enabled", false);
    if (INeedWebService.mSingleton == null) {

        if (networkingOutbound) {
            enableTransmitting();
        }
        if (getSharedPreferences(INeedToo.PREFERENCES_LOCATION, Preferences.MODE_PRIVATE)
                .getBoolean("Networking_Inbound_Enabled", false)) {
            enableReceiving();
        }
    }
}

From source file:io.reign.zk.ResilientZkClient.java

synchronized void spawnReconnectThread() {
    if (zooKeeper == null || zooKeeper.getState() == ZooKeeper.States.CLOSED) {
        // do connection in another thread so as to not block the ZK event thread
        Thread reconnectThread = new Thread() {
            @Override//from   www.j  a  v a2  s  . co m
            public void run() {
                connect(backoffStrategyFactory.get(), true);
            }
        };
        reconnectThread
                .setName(this.getClass().getSimpleName() + ".zkConnectThread-" + reconnectThread.hashCode());
        reconnectThread.setPriority(Thread.MIN_PRIORITY);
        reconnectThread.run();
    }
}

From source file:org.efaps.bpm.BPM.java

/**
 * Invoke the listener.//from w ww. ja v a 2  s  . co  m
 * @param _call call to be executed
 * @param _taskSummary  tasksummary of the task involved
 * @param _values values form eFaps
 */
private static void invokeAsyncListeners(final AsyncCalls _call, final TaskSummary _taskSummary,
        final Map<String, Object> _values) {
    // exec esjp
    try {
        final Class<?> listenerClass = Class.forName("org.efaps.esjp.bpm.listener.ReviewListener", true,
                EFapsClassLoader.getInstance());
        final IAsyncListener listener = (IAsyncListener) listenerClass.newInstance();

        final Object taskData = BPM.getTaskData(_taskSummary);

        final String userName = Context.getThreadContext().getPerson().getName();
        final ListenerThread threat = new ListenerThread(userName, listener, _call, _values, taskData);

        final BasicThreadFactory factory = new BasicThreadFactory.Builder()
                .namingPattern("eFapsBPMListenerThreat-%d").priority(Thread.MIN_PRIORITY).build();
        final ExecutorService exec = Executors.newSingleThreadExecutor(factory);
        exec.submit(threat);
        exec.shutdown();

    } catch (final ClassNotFoundException e) {
        BPM.LOG.error("Class could not be found.", e);
    } catch (final InstantiationException e) {
        BPM.LOG.error("Class could not be instantiation.", e);
    } catch (final IllegalAccessException e) {
        BPM.LOG.error("Class could not be accessed.", e);
    } catch (final IllegalArgumentException e) {
        BPM.LOG.error("Illegal Argument.", e);
    } catch (final SecurityException e) {
        BPM.LOG.error("Class could not be found.", e);
    } catch (final EFapsException e) {
        BPM.LOG.error("EFapsException catched", e);
    }
}

From source file:org.jajuk.base.Device.java

/**
 * Synchronizing asynchronously.//w w w.  ja v a  2 s  .co  m
 * 
 * @param bAsynchronous :
 * set asynchronous or synchronous mode
 */
public void synchronize(final boolean bAsynchronous) {
    // Check a source device is defined
    if (StringUtils.isBlank((String) getValue(Const.XML_DEVICE_SYNCHRO_SOURCE))) {
        Messages.showErrorMessage(171);
        return;
    }
    final Device device = this;
    if (!device.isMounted()) {
        try {
            device.mount(true);
        } catch (final Exception e) {
            Log.error(11, getName(), e); // mount failed
            Messages.showErrorMessage(11, getName());
            return;
        }
    }
    if (bAsynchronous) {
        final Thread t = new Thread("Device Synchronize Thread") {
            @Override
            public void run() {
                synchronizeCommand();
            }
        };
        t.setPriority(Thread.MIN_PRIORITY);
        t.start();
    } else {
        synchronizeCommand();
    }
}

From source file:com.google.dart.compiler.metrics.Tracer.java

private BlockingQueue<TraceEvent> openLogWriter(final Writer writer, final String fileName) {
    try {//from  ww w .j a va 2s. c o  m
        if (outputFormat.equals(Format.HTML)) {
            writer.write("<HTML isdump=\"true\"><body>"
                    + "<style>body {font-family:Helvetica; margin-left:15px;}</style>"
                    + "<h2>Performance dump from GWT</h2>"
                    + "<div>This file contains data that can be viewed with the "
                    + "<a href=\"http://code.google.com/speedtracer\">SpeedTracer</a> "
                    + "extension under the <a href=\"http://chrome.google.com/\">"
                    + "Chrome</a> browser.</div><p><span id=\"info\">"
                    + "(You must install the SpeedTracer extension to open this file)</span></p>"
                    + "<div style=\"display: none\" id=\"traceData\" version=\"0.17\">\n");
        }
    } catch (IOException e) {
        System.err
                .println("Unable to write to dart.speedtracerlog '" + (fileName == null ? "" : fileName) + "'");
        e.printStackTrace();
        return null;
    }

    final BlockingQueue<TraceEvent> eventQueue = new LinkedBlockingQueue<TraceEvent>();

    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            try {
                // Wait for the other thread to drain the queue.
                eventQueue.add(shutDownSentinel);
                shutDownLatch.await();
            } catch (InterruptedException e) {
                // Ignored
            }
        }
    });

    // Background thread to write SpeedTracer events to log
    Thread logWriterWorker = new LogWriterThread(writer, fileName, eventQueue);

    // Lower than normal priority.
    logWriterWorker.setPriority((Thread.MIN_PRIORITY + Thread.NORM_PRIORITY) / 2);

    /*
     * This thread must be daemon, otherwise shutdown hooks would never begin to
     * run, and an app wouldn't finish.
     */
    logWriterWorker.setDaemon(true);
    logWriterWorker.setName("SpeedTracerLogger writer");
    logWriterWorker.start();
    return eventQueue;
}

From source file:weka.server.WekaServer.java

/**
 * Send the last time of execution of the supplied task to the master server
 * //  w  w w . j av  a2  s  .co  m
 * @param entry the task entry for the task in question
 */
protected void sendExecutionTimeToMaster(final WekaTaskEntry entry) {

    Thread t = new Thread() {
        @Override
        public void run() {

            PostMethod post = null;
            InputStream is = null;
            try {
                String url = "http://" + m_master;
                url = url.replace(" ", "%20");
                url += SetLastExecutionServlet.CONTEXT_PATH;
                url += "/?name=" + entry.toString();
                SimpleDateFormat sdf = new SimpleDateFormat(SetLastExecutionServlet.DATE_FORMAT);
                String formattedDate = sdf.format(entry.getLastExecution());
                url += "&lastExecution=" + formattedDate;

                post = new PostMethod(url);
                post.setDoAuthentication(true);
                post.addRequestHeader(new Header("Content-Type", "text/plain"));

                // Get HTTP client
                HttpClient client = ConnectionManager.getSingleton().createHttpClient();
                ConnectionManager.addCredentials(client, m_username, m_password);

                // Execute request
                int result = client.executeMethod(post);
                // System.out.println("[WekaServer] Response from master server : " +
                // result);
                if (result == 401) {
                    System.err.println("[WekaServer] Unable to send task last execution time back "
                            + "to master - authentication required.\n");
                } else {

                    // the response
                    is = post.getResponseBodyAsStream();
                    ObjectInputStream ois = new ObjectInputStream(is);
                    Object response = ois.readObject();
                    if (response.toString().startsWith(WekaServlet.RESPONSE_ERROR)) {
                        System.err.println("[WekaServer] A problem occurred while "
                                + "trying to send task last execution timeback to master server : \n" + "\t"
                                + response.toString());
                    } else {
                        // System.out.println("[WekaServer] " + response.toString());
                    }
                }
            } catch (Exception ex) {
                System.err.println("[WekaServer] A problem occurred while "
                        + "trying to send task last execution time back to master server : \n"
                        + ex.getMessage());
                ex.printStackTrace();
            } finally {
                if (is != null) {
                    try {
                        is.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }

                if (post != null) {
                    post.releaseConnection();
                }
            }
        }
    };

    t.setPriority(Thread.MIN_PRIORITY);
    t.start();
}

From source file:edu.ku.brc.specify.tasks.subpane.wb.ImageFrame.java

protected void generateThumbnailsInBackground(final List<WorkbenchRowImage> rowImages) {
    Collections.sort(rowImages);//from  ww  w . jav a 2 s.c o  m

    Thread thumbGenTask = new Thread() {
        @Override
        @SuppressWarnings("synthetic-access")
        public void run() {
            // This is just a weird workaround.
            // For some reason, using the List directly resulted in a ConcurrentModificationException everytime
            // this method was called from addImages().
            // It doesn't look like it should throw an exception at all.
            WorkbenchRowImage[] imgs = new WorkbenchRowImage[rowImages.size()];
            rowImages.toArray(imgs);
            for (WorkbenchRowImage rowImage : imgs) {
                final WorkbenchRowImage ri = rowImage;
                try {
                    final ImageIcon thumb = generateThumbnail(rowImage);

                    // cache it so we don't have to do this again and again
                    rowImage.setThumbnail(thumb);

                    // update the UI
                    Runnable updateTrayUI = new Runnable() {
                        public void run() {
                            log.info("Thumbnail generation complete.  Updating the UI.  " + ri);
                            if (row == ri.getWorkbenchRow()) {
                                tray.getModel().set(ri.getImageOrder(), thumb);
                                tray.repaint();
                            }
                        }
                    };
                    SwingUtilities.invokeLater(updateTrayUI);
                } catch (IOException e) {
                    UsageTracker.incrHandledUsageCount();
                    edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ImageFrame.class, e);
                    log.warn("Failed to generate a thumbnail for " + rowImage.getCardImageFullPath(), e);
                }
            }
        }
    };

    thumbGenTask.setName("GenThumbs");
    thumbGenTask.setDaemon(true);
    thumbGenTask.setPriority(Thread.MIN_PRIORITY);
    thumbGenTask.start();
}