KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > loader > ClassFactory


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.loader.ClassFactory
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.loader;
23
24 import org.apache.derby.iapi.error.StandardException;
25
26 import org.apache.derby.iapi.util.ByteArray;
27
28 import java.io.ObjectStreamClass JavaDoc;
29
30
31 /**
32     A class factory module to handle application classes
33     and generated classes.
34 */

35
36 public interface ClassFactory {
37
38     /**
39         Add a generated class to the class manager's class repository.
40
41         @exception StandardException Standard Cloudscape error policy
42
43     */

44     public GeneratedClass loadGeneratedClass(String JavaDoc fullyQualifiedName, ByteArray classDump)
45         throws StandardException;
46
47     /**
48         Return a ClassInspector object
49     */

50     public ClassInspector getClassInspector();
51
52     /**
53         Load an application class, or a class that is potentially an application class.
54
55         @exception ClassNotFoundException Class cannot be found, or
56         a SecurityException or LinkageException was thrown loading the class.
57     */

58     public Class JavaDoc loadApplicationClass(String JavaDoc className)
59         throws ClassNotFoundException JavaDoc;
60
61     /**
62         Load an application class, or a class that is potentially an application class.
63
64         @exception ClassNotFoundException Class cannot be found, or
65         a SecurityException or LinkageException was thrown loading the class.
66     */

67     public Class JavaDoc loadApplicationClass(ObjectStreamClass JavaDoc classDescriptor)
68         throws ClassNotFoundException JavaDoc;
69
70     /**
71         Was the passed in class loaded by a ClassManager.
72
73         @return true if the class was loaded by a Cloudscape class manager,
74         false it is was loaded by the system class loader, or another class loader.
75     */

76     public boolean isApplicationClass(Class JavaDoc theClass);
77
78     /**
79         Notify the class manager that a jar file has been modified.
80         @param reload Restart any attached class loader
81
82         @exception StandardException thrown on error
83     */

84     public void notifyModifyJar(boolean reload) throws StandardException ;
85
86     /**
87         Notify the class manager that the classpath has been modified.
88
89         @exception StandardException thrown on error
90     */

91     public void notifyModifyClasspath(String JavaDoc classpath) throws StandardException ;
92
93     /**
94         Return the in-memory "version" of the class manager. The version
95         is bumped everytime the classes are re-loaded.
96     */

97     public int getClassLoaderVersion();
98 }
99
Popular Tags