01: /*
02: * Copyright (C) The Spice Group. All rights reserved.
03: *
04: * This software is published under the terms of the Spice
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.spice.netserve.connection.handlers;
09:
10: import org.codehaus.spice.threadpool.ThreadControl;
11:
12: /**
13: *
14: * @author Peter Donald
15: * @version $Revision: 1.2 $ $Date: 2004/03/21 23:42:59 $
16: */
17: class MockThreadControl implements ThreadControl {
18: private final Thread m_thread;
19:
20: public MockThreadControl(Thread thread) {
21: m_thread = thread;
22: }
23:
24: public void join(long milliSeconds) throws InterruptedException {
25: m_thread.join(milliSeconds);
26: }
27:
28: public void interrupt() throws IllegalStateException,
29: SecurityException {
30: m_thread.interrupt();
31: }
32:
33: public boolean isFinished() {
34: return !m_thread.isAlive();
35: }
36:
37: public Throwable getThrowable() {
38: return null;
39: }
40: }
|