|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassResolver
An object which is used to resolve classes and class-path resources. This is needed because, in an application server, different class loaders may be involved in loading different HiveMind modules. For example, the HiveMind library may be on the system claasspath, and modules may include EJBs and WARs, each loaded by a different classloader.
The class loader for the framework needs to be able to see resources in the application, but the application's class loader is a descendent of the framework's class loader. To resolve this, we need a 'hook', an instance that provides access to the application's class loader.
Method Summary | |
---|---|
java.lang.Class |
checkForClass(java.lang.String type)
Like findClass(String) , but simply returns null if the class does not exist (i.e.,
if ClassNotFoundException is thrown). |
java.lang.Class |
findClass(java.lang.String type)
Forwarded, to the the method Class.forName(String, boolean, ClassLoader) ,
using the resolver's class loader. |
java.lang.ClassLoader |
getClassLoader()
Returns a ClassLoader that can see all the classes the resolver can access. |
java.net.URL |
getResource(java.lang.String name)
Forwarded, unchanged, to the class loader. |
Method Detail |
---|
java.net.URL getResource(java.lang.String name)
java.lang.Class findClass(java.lang.String type)
Class.forName(String, boolean, ClassLoader)
,
using the resolver's class loader.
Since 1.1, the type may include primitive types and arrays (of primitives or of objects).
ApplicationRuntimeException
- on any error.java.lang.Class checkForClass(java.lang.String type)
findClass(String)
, but simply returns null if the class does not exist (i.e.,
if ClassNotFoundException
is thrown). This is used in certain spots when (typically)
the exact package for a class is not known.
java.lang.ClassLoader getClassLoader()
ClassLoader
that can see all the classes the resolver can access.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |