KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > util > FreeThread


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2002 Elmar Grom
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.izforge.izpack.util;
23
24 /*---------------------------------------------------------------------------*/
25 /**
26  * This class implements a thred that can be used to free native libraries safely.
27  *
28  * @version 0.0.1 / 2/6/02
29  * @author Elmar Grom
30  */

31 /*---------------------------------------------------------------------------*/
32 public class FreeThread extends Thread JavaDoc
33 {
34
35     private String JavaDoc name = "";
36
37     private NativeLibraryClient client = null;
38
39     /*--------------------------------------------------------------------------*/
40     /**
41      * Standard constructor.
42      *
43      * @param name the name of the library to free. The exact form of the name may be operating
44      * system dependent. On Microsoft Windows this must be just the library name, without path but
45      * with extension.
46      * @param client reference of the client object that is linked with the library to be freed.
47      */

48     /*--------------------------------------------------------------------------*/
49     public FreeThread(String JavaDoc name, NativeLibraryClient client)
50     {
51         this.name = name;
52         this.client = client;
53     }
54
55     /*--------------------------------------------------------------------------*/
56     /**
57      * The run() method. Frees the library. Note that the thread is likely to get 'frozen' and the
58      * application can only be treminated through a call to <code>System.exit()</code>.
59      */

60     /*--------------------------------------------------------------------------*/
61     public void run()
62     {
63         client.freeLibrary(name);
64     }
65 }
66 /*---------------------------------------------------------------------------*/
67
Popular Tags