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:com.espertech.esper.dataflow.runnables.GraphSourceRunnable.java

public void run() {
    try {/*from  ww w .j  ava 2s .  c o  m*/
        runLoop();
    } catch (InterruptedException ex) {
        log.debug("Interruped runnable: " + ex.getMessage(), ex);
    } catch (RuntimeException ex) {
        log.error("Exception encountered: " + ex.getMessage(), ex);
        handleException(ex);
    }

    invokeCompletionListeners();
}

From source file:com.espertech.esper.dataflow.runnables.GraphSourceRunnable.java

public void runSync() throws InterruptedException {
    try {/*from  w  w  w  .java  2s. c  o m*/
        runLoop();
    } catch (InterruptedException ex) {
        log.debug("Interruped runnable: " + ex.getMessage(), ex);
        throw ex;
    } catch (RuntimeException ex) {
        log.error("Exception encountered: " + ex.getMessage(), ex);
        handleException(ex);
        throw ex;
    }
}

From source file:com.thoughtworks.go.util.ProcessWrapper.java

public int waitForExit() {
    int returnValue = -1;
    try {/*from  w w  w . j  a v a2s  . c o m*/
        returnValue = process.waitFor();
        processOutputStream.readToEnd();
        processErrorStream.readToEnd();
    } catch (InterruptedException ignored) {
        LOGGER.warn(ignored.getMessage(), ignored);
    } finally {
        close();
    }
    return returnValue;
}

From source file:com.att.aro.core.cloud.aws.AwsRepository.java

@Override
public String get(String remotePath, String localPath) {
    String downloadedFilePath = "";
    if (s3Client != null && (localPath != null && localPath.length() > 0)
            && (remotePath != null && remotePath.length() > 0)) {
        downloadedFilePath = localPath + "/" + remotePath;
        try {//  ww w. j  a v a2  s.c o  m
            File downloadTarget = new File(downloadedFilePath);
            Download myDownload = transferMgr.download(new GetObjectRequest(bucketName, remotePath),
                    downloadTarget);
            myDownload.waitForCompletion();
            transferMgr.shutdownNow();
        } catch (AmazonClientException ace) {
            LOGGER.error("Error Message:    " + ace.getMessage());
        } catch (InterruptedException ire) {
            LOGGER.error(ire.getMessage());
        } catch (Exception exception) {
            LOGGER.error(exception.getMessage(), exception);
        }
    }
    return downloadedFilePath;
}

From source file:fr.aliasource.webmail.common.cache.FileCache.java

public W getData() {
    if (!exists()) {
        try {//from   ww w . j a v a2  s. co  m
            update();
        } catch (InterruptedException e) {
            logger.error(e.getMessage(), e);
            return null;
        }
    }
    return loadFromCache();
}

From source file:net.meddeb.pqmessenger.MsgDaemon.java

@Override
public void init(DaemonContext daemonContext) throws DaemonInitException, Exception {
    String[] args = daemonContext.getArguments();
    connected = false;/*from   ww  w  .j  a va2s.  c o  m*/
    msgEngine = new MsgEngine(args);
    logger = Logger.getLogger(this.getClass());
    mainThread = new Thread() {
        @Override
        public synchronized void start() {
            MsgDaemon.this.stopped = false;
            super.start();
        }

        @Override
        public void run() {
            logger.info("");
            logger.info("-------------------------");
            logger.info(LoggingMsg.getLog("pqMsgStart"));
            logger.info("-------------------------");
            while (!stopped) {
                logger.info(LoggingMsg.getLog("pqMsgTrycnx"));
                msgEngine.startConnection();
                if (msgEngine.isConnectionStarted()) {
                    connected = true;
                } else {
                    String msg = LoggingMsg.getLog("pqMsgCnxFail");
                    msg = MessageFormat.format(msg, msgEngine.getStrTimeretry());
                    logger.info(msg);
                }
                while ((true) && (msgEngine.isConnectionStarted())) {
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        logger.error("e: " + e.getMessage());
                    }
                }
                if (connected) {
                    logger.info(LoggingMsg.getLog("pqMsgdcnx"));
                    connected = false;
                }
                try {
                    Thread.sleep(msgEngine.getTimeRetry());
                } catch (InterruptedException e) {
                    logger.error("e: " + e.getMessage());
                } //wait 
            }
        }
    };

}

From source file:com.bt.aloha.testing.mockphones.HangUpDialogBean.java

@Override
public void processInitialInvite(final Request request, final ServerTransaction serverTransaction,
        final String dialogId) {
    log.debug(String.format("Replying to initial invite for mockphone dialog %s", dialogId));

    ConcurrentUpdateBlock concurrentUpdateBlock = new ConcurrentUpdateBlock() {
        public void execute() {
            DialogInfo dialogInfo = getDialogCollection().get(dialogId);
            MediaDescription offerMediaDescription = null;
            if (dialogInfo.isSdpInInitialInvite()) {
                String sdp = new String(request.getRawContent());
                if (getDialogBeanHelper().hasActiveVideoMediaDescription(sdp)) {
                    getDialogBeanHelper().sendResponse(request, serverTransaction,
                            Response.NOT_ACCEPTABLE_HERE);
                    return;
                }/*from  w  w w.java2 s  . c  om*/
                offerMediaDescription = getDialogBeanHelper().getActiveMediaDescriptionFromMessageBody(sdp);
                dialogInfo.setRemoteOfferMediaDescription(offerMediaDescription);
            }
            List<MediaDescription> responseMediaDescriptions = new Vector<MediaDescription>();
            responseMediaDescriptions.add(getInitialInviteOkResponseMediaDescription(offerMediaDescription));
            if (request.getRequestURI().toString().contains("video"))
                responseMediaDescriptions.add(SessionDescriptionHelper.getVideoDescription());

            SessionDescriptionHelper.setMediaDescription(dialogInfo.getSessionDescription(),
                    responseMediaDescriptions, dialogInfo.getDynamicMediaPayloadTypeMap());

            dialogInfo.setDialogState(DialogState.Early);
            getDialogCollection().replace(dialogInfo);

            try {
                Thread.sleep(INTERVAL_BETWEEN_INVITE_RESPONSES);
            } catch (InterruptedException e) {
                log.error(e.getMessage(), e);
            }
            getDialogBeanHelper().sendResponse(request, serverTransaction, Response.RINGING);
            try {
                Thread.sleep(INTERVAL_BETWEEN_INVITE_RESPONSES);
            } catch (InterruptedException e) {
                log.error(e.getMessage(), e);
            }

            getDialogBeanHelper().sendInviteOkResponse(request, serverTransaction, dialogInfo.getLocalTag(),
                    dialogInfo.getSipUserName(), dialogInfo.getSessionDescription());

            int timeUntilHangup = dialogInfo.getIntProperty(HANG_UP_PERIOD_PROPERTY_KEY,
                    DEFAULT_SHORT_HANG_UP_PERIOD);
            log.info(String.format("Scheduling hangup for Hangup mockphone %s in %d secs", dialogInfo.getId(),
                    timeUntilHangup));
            ScheduledFuture<?> runHangupTimer = runHangupTimer(dialogInfo, timeUntilHangup);
            log.debug(String.format("Scheduling for hangup using future [%s] for dialogId %s", runHangupTimer,
                    dialogId));
            getTimers().put(dialogId, runHangupTimer);
        }

        public String getResourceId() {
            return dialogId;
        }
    };
    getConcurrentUpdateManager().executeConcurrentUpdate(concurrentUpdateBlock);
}

From source file:com.aliyun.openservices.odps.console.pub.StopInstanceCommand.java

public void run() throws OdpsException, ODPSConsoleException {

    Odps odps = getCurrentOdps();/*from  w  ww .ja  v a 2 s . co m*/
    Instance instance = odps.instances().get(instanceId);
    instance.stop();

    if (synchronizeFlag) {
        while (!instance.isTerminated()) {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new UserInterruptException(e.getMessage());
            }
        }

        synchronizeFlag = false;
        writeStatus(instance.getStatus().toString());

        return;
    }

    writeStatus(null);

}

From source file:gda.device.scannable.StringPVConditionMonitor.java

@Override
protected void testShouldPause() throws DeviceException {
    if (!isConnected()) {
        logger.error("Epics channels not connected.");
    }/*  w  w  w.j  a v  a  2  s  .  c o m*/

    if (!machineIsRunning()) {
        return;
    }

    while (!beamOnTarget()) {
        try {
            sendAndPrintMessage("Port shutter closed : pausing until it is opened");
            Thread.sleep(60000);
        } catch (InterruptedException e) {
            // someone trying to kill the thread so re-throw to kill any scan
            throw new DeviceException(e.getMessage(), e);
        }
    }

}

From source file:eu.optimis.ip.gui.client.resources.DbServerThread.java

public void startServer() {
    server.start();//from   w w  w . ja  v a 2  s. c  om
    while (!isOnline()) {
        try {
            Thread.sleep(500);
        } catch (InterruptedException ex) {
            Logger.getLogger(Accounting.class.getName()).log(Level.WARNING,
                    "Error when Thread.sleep(): " + ex.getMessage());
        }
    }
}