1373
|
1 |
package stx.libjava.groovy;
|
|
2 |
|
|
3 |
import java.security.AccessController;
|
|
4 |
import java.security.PrivilegedAction;
|
|
5 |
|
|
6 |
import org.codehaus.groovy.control.CompilationUnit;
|
|
7 |
import org.codehaus.groovy.control.SourceUnit;
|
|
8 |
|
|
9 |
public class GroovyClassLoader extends groovy.lang.GroovyClassLoader {
|
|
10 |
|
|
11 |
protected ClassCollector createCollector(CompilationUnit unit, SourceUnit su) {
|
|
12 |
InnerLoader loader = AccessController.doPrivileged(new PrivilegedAction<InnerLoader>() {
|
|
13 |
public InnerLoader run() {
|
|
14 |
return new InnerLoader(GroovyClassLoader.this);
|
|
15 |
}
|
|
16 |
});
|
|
17 |
return new SystemClassCollector(loader, unit, su);
|
|
18 |
}
|
|
19 |
|
|
20 |
public static class SystemClassCollector extends groovy.lang.GroovyClassLoader.ClassCollector {
|
|
21 |
|
|
22 |
protected SystemClassCollector(InnerLoader cl, CompilationUnit unit, SourceUnit su) {
|
|
23 |
super(cl, unit, su);
|
|
24 |
}
|
|
25 |
|
|
26 |
public native GroovyClassLoader getDefiningClassLoader();
|
|
27 |
|
|
28 |
}
|
|
29 |
}
|