Example usage for java.lang InterruptedException getMessage

List of usage examples for java.lang InterruptedException getMessage

Introduction

In this page you can find the example usage for java.lang InterruptedException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.apache.manifoldcf.crawler.connectors.rss.ThrottledFetcher.java

/** Note that we're about to need a handle (and make sure we have enough) */
protected static void registerGlobalHandle(int maxHandles) throws ManifoldCFException {
    try {//from   w w w.  j  a v a 2s  . com
        synchronized (globalHandleCounterLock) {
            while (globalHandleCount >= maxHandles) {
                globalHandleCounterLock.wait();
            }
            globalHandleCount++;
        }
    } catch (InterruptedException e) {
        throw new ManifoldCFException("Interrupted: " + e.getMessage(), e, ManifoldCFException.INTERRUPTED);
    }
}

From source file:org.codehaus.grepo.statistics.service.TestStatisticsInterfaceImpl.java

/**
 * {@inheritDoc}/*from w  w w. j a  v  a  2 s  . c  o m*/
 */
@MethodStatistics
public void statsMethod1(long sleepTime) {
    if (sleepTime > 0) {
        try {
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            logger.error(e.getMessage(), e);
        }
    }
}

From source file:org.yestech.notify.service.TerracottaNotificationProducer.java

@Override
public void send(INotificationJob notificationJob) {
    final String notificationXml = XmlUtils.toXml(notificationJob);
    try {// ww w.j a  v  a2 s. com
        pipe.put(notificationXml);
    } catch (InterruptedException e) {
        logger.error(e.getMessage(), e);
        throw new RuntimeException(e);
    }
}

From source file:org.jspringbot.keyword.ssh.ExecuteWhileOutputIsNot.java

@Override
public Object execute(Object[] params) {
    try {//  www . j a v a 2 s  .c o  m
        helper.executeWhileOutputIsNot(String.valueOf(params[0]), String.valueOf(params[1]),
                Long.parseLong(String.valueOf(params[2])), Long.parseLong((String) params[3]));
    } catch (InterruptedException e) {
        throw new IllegalStateException(e.getMessage(), e);
    }

    return null;
}

From source file:com.sharneng.net.portforward.Cleaner.java

@Override
public void run() {
    while (true) {
        cleanup();/*w ww .  j  a v a  2 s  .  co m*/
        try {
            wait(CLEAN_INTERVAL);
        } catch (InterruptedException e) {
            log.error(e.getMessage(), e);
        }
    }
}

From source file:org.trustedanalytics.dataproviders.RandomDataProvider.java

public void init() {
    new Thread(() -> {
        LOG.info("start consumer thread");
        while (true) {
            try {
                Thread.sleep(1000);
                dataConsumer.processMessage(generateRandomFloatArray());
            } catch (InterruptedException e) {
                LOG.error(e.getMessage(), e);
                Thread.currentThread().interrupt();
            }/*from w  ww  .j a  v  a 2s  .com*/
        }
    }).start();
}

From source file:com.doubleview.fastcrawler.fetcher.IdleConnectionMonitorThread.java

@Override
public void run() {
    try {/*from  www  . j a  va2  s .  c  om*/
        while (!shutdown) {
            synchronized (this) {
                wait(5000);
                // Close expired connections
                connMgr.closeExpiredConnections();
                // Optionally, close connections that have been idle longer than 30 sec
                connMgr.closeIdleConnections(30, TimeUnit.SECONDS);
            }
        }
    } catch (InterruptedException ignored) {
        logger.error(ignored.getMessage(), ignored);
    }
}

From source file:com.aalmeida.lightning.LightningDaemon.java

public void stop() throws Exception {
    this.stopped = true;
    try {/*from   ww w . j av a  2s .  c om*/
        this.thread.join(1000L);
    } catch (InterruptedException e) {
        System.err.println(e.getMessage());
        throw e;
    }
}

From source file:demo.service.MyServiceImpl.java

/**
 * Thread sleeps 0 - 500 milliseconds./*from  ww  w .j  a v a  2s .  co  m*/
 */
private void sleepRandomMillis() {
    int sleepTime = random.nextInt(500);
    try {
        if (sleepTime > 0) {
            Thread.sleep(Integer.valueOf(sleepTime).longValue());
        }
    } catch (InterruptedException e) {
        logger.error(e.getMessage(), e);
    }
}

From source file:org.xeneo.plugin.ActivityPluginRuntimeTest.java

@Test
public void testStartMultipleDifferentConfigurations() {

    // mock.isExistingActivity("");        
    // replay(mock);

    for (int i = 0; i < n; i++) {

        PluginConfiguration pc1 = new PluginConfiguration();
        pc1.setPluginClass(className);/* w  ww .java2s.  c  om*/
        pc1.setPluginURI("http://myplugin.com/" + i);
        pc1.setOwnerURI("http://owner.com/" + i);

        runtime.startActivityPlugin(pc1);
    }

    try {
        Thread.sleep(10000L);
    } catch (InterruptedException ex) {
        logger.error(ex.getMessage());
    }
}