KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > key > passwd > swing > RemoteControlThread


1 /*
2  * Copyright 2006 Schlichtherle IT Services
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package de.schlichtherle.key.passwd.swing;
18
19 /**
20  * @author Christian Schlichtherle
21  * @version @version@
22  * @since TrueZIP 6.1
23  */

24 public class RemoteControlThread extends Thread JavaDoc {
25     private final RemoteControl rc;
26
27     public RemoteControlThread(final String JavaDoc id) {
28         this(new RemoteControl(id));
29     }
30
31     public RemoteControlThread(RemoteControl rc) {
32         super(rc, "Remote Control Thread for \"" + rc.id + "\"");
33         this.rc = rc;
34         //setPriority(Thread.MAX_PRIORITY);
35
//setDaemon(true); // thread may die.
36
}
37
38     /**
39      * Returns non-<code>null</code> if and only if this thread has
40      * terminated because an assertion error happened.
41      */

42     public Throwable JavaDoc getThrowable() {
43         return rc.throwable;
44     }
45
46     public void run() {
47         super.run();
48         final Throwable JavaDoc t = getThrowable();
49         if (t != null)
50             t.printStackTrace();
51     }
52 }
Popular Tags