Tuesday, March 10, 2015

TimeoutException

com.sun.corba.se.impl.orbutil.threadpool.TimeoutException

TimeoutException is described in the javadoc comments as:

No description available.

Where is this exception thrown?

Following, is a list of exception messages cross-referenced to the source code responsible for throwing them. Click on the method link to view the code and see how the exception is thrown.

How is this exception thrown?

The following sub-sections identify where this exception is thrown, and how (or why) the code is throwing the exception.

Any source code quoted in this section is subject to the Java Research License unless stated otherwise.

com.sun.corba.se.impl.orbutil.threadpool.WorkQueueImpl.requestWork(long)

Work requestWork(long waitTime) throws TimeoutException, InterruptedException {
    Work workItem;
    synchronized (this) {
        if (theWorkQueue.size() != 0) {
            workItem = (Work) theWorkQueue.removeFirst();
            totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
            workItemsDequeued++;
            return workItem;
        }
        try {
            long remainingWaitTime = waitTime;
            long finishTime = System.currentTimeMillis() + waitTime;
            do {
                this.wait(remainingWaitTime);
                if (theWorkQueue.size() != 0) {
                    workItem = (Work) theWorkQueue.removeFirst();
                    totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
                    workItemsDequeued++;
                    return workItem;
                }
                remainingWaitTime = finishTime - System.currentTimeMillis();
            } while (remainingWaitTime > 0);
            throw new TimeoutException();
        } catch (InterruptedException ie) {
            throw ie;
        }
    }
}

Source: "Java SE Downloads: Java SE 6 JDK Source Code", at: http://www.oracle.com/technetwork/java/javase/downloads/index.html

No comments:

Post a Comment