Example usage for org.apache.commons.threadpool ThreadPool invokeLater

List of usage examples for org.apache.commons.threadpool ThreadPool invokeLater

Introduction

In this page you can find the example usage for org.apache.commons.threadpool ThreadPool invokeLater.

Prototype

public void invokeLater(Runnable task);

Source Link

Document

Dispatch a new task onto this pool to be invoked asynchronously later.

Usage

From source file:net.hardisonbrewing.signingserver.SigservAutorunApplication.java

public static void mainAutoRunOnStartup(String[] args) {

    log.info("Running auto run application");

    ModuleHandleStore.put();/* w  w  w  . j a  v a  2  s .c  o  m*/
    IconService.updateIcon();
    OptionsManager.registerOptionsProvider(new OptionsProvider());

    ThreadPool threadPool = new DefaultThreadPool(1);
    threadPool.invokeLater(new NetworkRequiredTask());
}

From source file:net.hardisonbrewing.signingserver.service.network.NetworkReadyListener.java

private void runNetworkReady() {

    ThreadPool threadPool = new DefaultThreadPool(1);
    threadPool.invokeLater(new Runnable() {

        public void run() {

            try {
                onNetworkReady();// ww w.j a v  a 2 s.  c  om
                runState = STATE_RAN;
            } catch (Exception e) {
                runState = STATE_READY;
            }
        }
    });
}

From source file:net.hardisonbrewing.signingserver.ui.CodSigningScreen.java

protected void onVisibilityChange(boolean visible) {

    super.onVisibilityChange(visible);

    if (visible && !startedThreads) {
        startedThreads = true;//from ww  w  .j  av a  2s.  co m
        ThreadPool threadPool = new DefaultThreadPool(signingAuthorities.length);
        for (int i = 0; i < signingAuthorities.length; i++) {
            threadPool.invokeLater(new SignCodsTask(signingAuthorities[i]));
        }
    }
}