KickJava   Java API By Example, From Geeks To Geeks.

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


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: EjbJarClassLoader.java,v 1.4 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 EJB classes and resources
34  *
35  * @author Guillaume Sauthier
36  */

37 public class EjbJarClassLoader 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 EjbJarClassLoader with default parent ClassLoader
47      *
48      * @param modules an URL[] of EjbJar files
49      *
50      * @throws IOException if creation fails
51      */

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

64     public EjbJarClassLoader(URL JavaDoc[] modules, ClassLoader JavaDoc parent) throws IOException JavaDoc {
65         super(modules, parent);
66     }
67
68     /**
69      * Add the directory and the content of META-INF/wsdl/ in the ClassLoader
70      *
71      * @throws IOException When WEB-INF/classes and WEB-INF/wsdl directories cannot be added
72      * in loader
73      */

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