001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of either the BSD licence or the GNU Lesser General
006 * Public Licence.  These should be distributed with the code. 
007 * If you do not have copies see:
008 *
009 *      http://www.opensource.org/licenses/bsd-license.php
010 *      http://www.gnu.org/copyleft/lesser.html
011 *
012 * Copyright for this code is held jointly by the individual
013 * authors.  These should be listed in @author doc comments.
014 *
015 * For more information on the BioJava project and its aims,
016 * or to join the biojava-l mailing list, visit the home page
017 * at:
018 *
019 *      http://www.biojava.org/
020 *
021 */
022 
023package org.biojava.utils;
024
025/**
026 * Exception which is thrown if a child process managed by <code>ProcessTools</code>
027 * exceeds a specified time limit.  Generally indicates that the results should
028 * not be trusted!
029 *
030 * @author Thomas Down
031 * @since 1.4
032 */
033 
034public class ProcessTimeoutException extends Exception {
035    private final int returnCode;
036    
037    public ProcessTimeoutException(int rc) {
038        super();
039        this.returnCode = rc;
040    }
041    
042    public ProcessTimeoutException(int rc, String message) {
043        super(message);
044        this.returnCode = rc;
045    }
046    
047    /**
048     * Get the return code from the dying child process.
049     */
050    
051    public int getReturnCode() {
052        return returnCode;
053    }
054}