1   /*
2    * Copyright (C) The Spice Group. All rights reserved.
3    *
4    * This software is published under the terms of the Spice
5    * Software License version 1.1, a copy of which has been included
6    * with this distribution in the LICENSE.txt file.
7    */
8   package org.codehaus.spice.netserve.connection.handlers;
9   
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
18      implements ThreadControl
19  {
20      private final Thread m_thread;
21  
22      public MockThreadControl( Thread thread )
23      {
24          m_thread = thread;
25      }
26  
27      public void join( long milliSeconds )
28          throws InterruptedException
29      {
30          m_thread.join( milliSeconds );
31      }
32  
33      public void interrupt()
34          throws IllegalStateException, SecurityException
35      {
36          m_thread.interrupt();
37      }
38  
39      public boolean isFinished()
40      {
41          return !m_thread.isAlive();
42      }
43  
44      public Throwable getThrowable()
45      {
46          return null;
47      }
48  }