}
private ConnectorClassFinder createRARClassLoader(final ClassLoader parent, String moduleDir,
final String moduleName, List<URI> appLibs)
throws ConnectorRuntimeException{
ConnectorClassFinder cl = null;
try{
final DelegatingClassLoader.ClassFinder librariesCL = getLibrariesClassLoader(appLibs);
cl = (ConnectorClassFinder)AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws Exception {
final ConnectorClassFinder ccf = new ConnectorClassFinder(parent, moduleName, librariesCL);
if (processEnv.getProcessType().isEmbedded()) {
events.register(new EventListener() {
public void event(Event event) {
if (event.is(EventTypes.PREPARE_SHUTDOWN)) {
ccf.done();
}
}
});
}
return ccf;