01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.loaders;
05:
06: /**
07: * Manage loading relationship between named classloaders and classes
08: */
09: public interface ClassProvider {
10:
11: /**
12: * Given a class name and a classloader name, load the class
13: * @param className Class name
14: * @param loaderDesc Classloader name
15: * @return Class
16: * @throws ClassNotFoundException If class not found through loader
17: */
18: Class getClassFor(String className, String loaderDesc)
19: throws ClassNotFoundException;
20:
21: /**
22: * Get classloader name that loads class
23: * @param clazz Class
24: * @return Classloader name
25: */
26: String getLoaderDescriptionFor(Class clazz);
27:
28: /**
29: * Get classloader by name
30: * @param loaderDesc Classloader name
31: * @return Classloader
32: */
33: ClassLoader getClassLoader(String loaderDesc);
34:
35: /**
36: * Get name for classloader
37: * @param loader Loader
38: * @return Name
39: */
40: String getLoaderDescriptionFor(ClassLoader loader);
41:
42: /**
43: * Register named loader
44: * @param loader Loader
45: */
46: void registerNamedLoader(NamedClassLoader loader);
47: }
|