KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > system > server > NoAnnotationURLClassLoader


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.system.server;
23
24 import java.net.URL JavaDoc;
25 import java.net.URLClassLoader JavaDoc;
26 import java.net.URLStreamHandlerFactory JavaDoc;
27
28 /**
29  * A URL classloader to avoid URL annotation of classes in RMI
30  *
31  * @author <a HREF="mailto:Adrian.Brock@HappeningTimes.com">Adrian Brock</a>
32  * @version $Revision: 37459 $
33  */

34 public class NoAnnotationURLClassLoader
35    extends URLClassLoader JavaDoc
36 {
37    /** The value returned by {@link getURLs}. */
38    private static final URL JavaDoc[] EMPTY_URL_ARRAY = {};
39
40    /**
41     * Construct a <tt>URLClassLoader</tt>
42     *
43     * @param urls the URLs to load classes from.
44     */

45    public NoAnnotationURLClassLoader(URL JavaDoc[] urls)
46    {
47       super(urls);
48    }
49
50    /**
51     * Construct a <tt>URLClassLoader</tt>
52     *
53     * @param urls the URLs to load classes from.
54     * @param parent the parent classloader.
55     */

56    public NoAnnotationURLClassLoader(URL JavaDoc[] urls, ClassLoader JavaDoc parent)
57    {
58       super(urls, parent);
59    }
60
61    /**
62     * Construct a <tt>URLClassLoader</tt>
63     *
64     * @param urls the URLs to load classes from.
65     * @param parent the parent classloader.
66     * @param factory the url stream factory.
67     */

68    public NoAnnotationURLClassLoader(URL JavaDoc[] urls, ClassLoader JavaDoc parent,
69                                      URLStreamHandlerFactory JavaDoc factory)
70    {
71       super(urls, parent, factory);
72    }
73
74    /**
75    * Return all library URLs
76    *
77    * <p>Do not remove this method without running the WebIntegrationTestSuite
78    */

79    public URL JavaDoc[] getAllURLs()
80    {
81       return super.getURLs();
82    }
83
84    /**
85    * Return an empty URL array to force the RMI marshalling subsystem to
86    * use the <tt>java.server.codebase</tt> property as the annotated codebase.
87    *
88    * <p>Do not remove this method without discussing it on the dev list.
89    *
90    * @return Empty URL[]
91    */

92    public URL JavaDoc[] getURLs()
93    {
94       return EMPTY_URL_ARRAY;
95    }
96 }
97
Popular Tags