01: /*
02:
03: Derby - Class org.apache.derby.iapi.services.loader.ClassFactory
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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;
29:
30: /**
31: A class factory module to handle application classes
32: and generated classes.
33: */
34:
35: public interface ClassFactory {
36:
37: /**
38: Add a generated class to the class manager's class repository.
39:
40: @exception StandardException Standard Cloudscape error policy
41:
42: */
43: public GeneratedClass loadGeneratedClass(String fullyQualifiedName,
44: ByteArray classDump) throws StandardException;
45:
46: /**
47: Return a ClassInspector object
48: */
49: public ClassInspector getClassInspector();
50:
51: /**
52: Load an application class, or a class that is potentially an application class.
53:
54: @exception ClassNotFoundException Class cannot be found, or
55: a SecurityException or LinkageException was thrown loading the class.
56: */
57: public Class loadApplicationClass(String className)
58: throws ClassNotFoundException;
59:
60: /**
61: Load an application class, or a class that is potentially an application class.
62:
63: @exception ClassNotFoundException Class cannot be found, or
64: a SecurityException or LinkageException was thrown loading the class.
65: */
66: public Class loadApplicationClass(ObjectStreamClass classDescriptor)
67: throws ClassNotFoundException;
68:
69: /**
70: Was the passed in class loaded by a ClassManager.
71:
72: @return true if the class was loaded by a Cloudscape class manager,
73: false it is was loaded by the system class loader, or another class loader.
74: */
75: public boolean isApplicationClass(Class theClass);
76:
77: /**
78: Notify the class manager that a jar file has been modified.
79: @param reload Restart any attached class loader
80:
81: @exception StandardException thrown on error
82: */
83: public void notifyModifyJar(boolean reload)
84: 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 classpath)
92: throws StandardException;
93:
94: /**
95: Return the in-memory "version" of the class manager. The version
96: is bumped everytime the classes are re-loaded.
97: */
98: public int getClassLoaderVersion();
99: }
|