KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > loader > ClientClassLoader


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer(s): Guillaume SAUTHIER
22  * --------------------------------------------------------------------------
23  * $Id: ClientClassLoader.java,v 1.3 2004/04/19 13:49:09 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.loader;
28
29 import java.io.IOException JavaDoc;
30 import java.net.URL JavaDoc;
31
32 /**
33  * ClassLoader used for loading Client classes and resources
34  *
35  * @author Guillaume Sauthier
36  */

37 public class ClientClassLoader extends AbsModuleClassLoader {
38
39     /** classes are located in the module root */
40     private static final String JavaDoc CLASSES_DIRECTORY = "";
41
42     /** WSDL files are located in META-INF/wsdl directory */
43     private static final String JavaDoc WSDL_DIRECTORY = "META-INF/wsdl/";
44
45     /**
46      * Create a new ClientClassLoader with default parent ClassLoader
47      *
48      * @param module an URL of Client files
49      *
50      * @throws IOException if creation fails
51      */

52     public ClientClassLoader(URL JavaDoc module) throws IOException JavaDoc {
53         super(new URL JavaDoc[]{module});
54     }
55
56     /**
57      * Create a new ClientClassLoader with specified parent ClassLoader
58      *
59      * @param module an URL of Client files
60      * @param parent the parent ClassLoader to use
61      *
62      * @throws IOException if creation fails
63      */

64     public ClientClassLoader(URL JavaDoc module, ClassLoader JavaDoc parent) throws IOException JavaDoc {
65         super(new URL JavaDoc[]{module}, parent);
66     }
67
68     /**
69      * Add the directory and the content of
70      * META-INF/wsdl/ in the ClassLoader.
71      *
72      * @throws IOException When initialisation fails.
73      */

74     protected void init() throws IOException JavaDoc {
75         super.init();
76         addInRepository(CLASSES_DIRECTORY);
77         addContentInRepository(WSDL_DIRECTORY);
78     }
79 }
80
Popular Tags