KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > classloader > ClassLoaderManager


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
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 package org.apache.cocoon.components.classloader;
17
18 import org.apache.avalon.framework.component.Component;
19
20 import java.io.File JavaDoc;
21 import java.io.IOException JavaDoc;
22
23 /**
24  * A class loader manager acting as a proxy for a <b>single</b>
25  * <code>RepositoryClassLoader</code>.
26  * This class guarantees that a single class loader instance exists so
27  * that it can be safely reinstantiated for dynamic class reloading
28  *
29  * @author <a HREF="mailto:ricardo@apache.org">Ricardo Rocha</a>
30  * @version CVS $Id: ClassLoaderManager.java 30932 2004-07-29 17:35:38Z vgritsenko $
31  */

32 public interface ClassLoaderManager extends Component {
33
34     String JavaDoc ROLE = ClassLoaderManager.class.getName();
35
36     /**
37     * Add a directory to the proxied class loader
38     *
39     * @param directoryName The repository name
40     * @exception IOException If the directory is invalid
41     */

42     void addDirectory(File JavaDoc directoryName) throws IOException JavaDoc;
43
44     /**
45     * Load a class through the proxied class loader
46     *
47     * @param className The name of the class to be loaded
48     * @return The loaded class
49     * @exception ClassNotFoundException If the class is not found
50     */

51     Class JavaDoc loadClass(String JavaDoc className) throws ClassNotFoundException JavaDoc;
52
53     /**
54     * Reinstantiate the proxied class loader to allow for class reloading
55     *
56     */

57     void reinstantiate();
58 }
59
Popular Tags