Example usage for java.lang InterruptedException printStackTrace

List of usage examples for java.lang InterruptedException printStackTrace

Introduction

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

Prototype

public void printStackTrace(PrintStream s) 

Source Link

Document

Prints this throwable and its backtrace to the specified print stream.

Usage

From source file:Main.java

public static void main(String[] args) {
    new Main().display();
    new Thread(new Runnable() {
        @Override/* w  w  w.j a  v  a  2s .  c o m*/
        public void run() {
            for (int i = 0; i < 3; i++) {
                try {
                    Thread.sleep(1000);
                    System.out.println((i + 1) + "s. elapsed.");
                } catch (InterruptedException e) {
                    e.printStackTrace(System.err);
                }
            }
        }
    }).start();
}

From source file:com.chicm.cmraft.rpc.RpcServer.java

public boolean startRpcServer() {
    try {/*ww w .  j  a  v  a 2 s .  c  om*/
        new NettyListener().start();
    } catch (InterruptedException e) {
        e.printStackTrace(System.out);
        return false;
    }
    return true;
}

From source file:com.jstar.eclipse.jobs.VerificationJob.java

@Override
protected IStatus run(IProgressMonitor monitor) {
    String spec;/*ww w. j av a  2s  .c  o m*/

    if (isSpecInSource) {
        spec = AnnotationProcessingService.getInstance().processAnnotations(selectedFile).getAbsolutePath();
        Utils.getInstance().makeImportsReady(selectedFile);
    } else {
        spec = specFile;
    }

    List<File> jimpleFiles = JStar.getInstance().convertToJimple(selectedFile);

    try {
        selectedFile.clearMarkers();

        for (File jimpleFile : jimpleFiles) {
            process = JStar.getInstance().executeJStar(selectedFile.getWorkingDirectory(),
                    selectedFile.getJavaProject().getGeneratedDir(), spec, logicFile, absFile,
                    jimpleFile.getAbsolutePath(), mode, debugMode);
            ConsoleService.getInstance().printToConsole(selectedFile, process);
        }

        ConsoleService.getInstance().printToConsole("jStar Verification is completed.");
    } catch (CoreException ce) {
        ce.printStackTrace(ConsoleService.getInstance().getConsoleStream());
    } catch (IOException ioe) {
        ioe.printStackTrace(ConsoleService.getInstance().getConsoleStream());
    } catch (JSONException jsone) {
        jsone.printStackTrace(ConsoleService.getInstance().getConsoleStream());
    } catch (InterruptedException ie) {
        ie.printStackTrace(ConsoleService.getInstance().getConsoleStream());
    }

    return Status.OK_STATUS;
}