Thread.currentThread().setContextClassLoader(loader);
}else{
loader = runtime.createConnectorClassLoader(moduleDir, null, rarModuleName);
}
ConnectorArchivist connectorArchivist = runtime.getConnectorArchvist();
//TODO V3 what happens to embedded .rar ? as its parent classloader should be application CL
//setting the classloader so that annotation processor can make use of it.
connectorArchivist.setClassLoader(loader);
//fileArchive.entries("META-INF/ra.xml");
//TODO V3 need to check whether ra.xml is present, if so, check the version. process annotations
//only if its 1.6 or above ?
connectorArchivist.setAnnotationProcessingRequested(true);
return connectorArchivist.open(fileArchive);
} catch (IOException ex) {
ConnectorRuntimeException cre = new ConnectorRuntimeException(
"Failed to read the connector deployment descriptors");
cre.initCause(ex);
_logger.log(Level.SEVERE, "rardeployment.connector_descriptor_read_error", moduleDir);