Class loader utilities.
git-svn-id: svn://10.0.0.236/trunk@16958 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a7dc225454
commit
9e4c52a9f9
@ -35,4 +35,27 @@ public class JNIUtils {
|
||||
public static Object GetCurrentThread() {
|
||||
return Thread.currentThread();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stub SecurityManager class, to expose access to class loaders.
|
||||
*/
|
||||
static class StubSecurityManager extends SecurityManager {
|
||||
public ClassLoader getCurrentClassLoader() {
|
||||
return currentClassLoader();
|
||||
}
|
||||
}
|
||||
|
||||
private static StubSecurityManager stubManager = new StubSecurityManager();
|
||||
|
||||
/**
|
||||
* Returns the current class loader.
|
||||
*/
|
||||
public static Object GetCurrentClassLoader() {
|
||||
return stubManager.getCurrentClassLoader();
|
||||
}
|
||||
|
||||
public static Object GetObjectClassLoader(Object object) {
|
||||
return object.getClass().getClassLoader();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user