thread.setContextClassLoader(_system.getClassLoader());
ThreadPool.getThreadPool().setIdleMin(4);
ThreadPool.getThreadPool().setPriorityIdleMin(4);
ResinELContext elContext = _args.getELContext();
Resin resin = Resin.createWatchdog(_system);
if (_args.getDataDirectory() != null)
resin.setDataDirectory(_args.getDataDirectory());
resin.preConfigureInit();
// XXX: needs to be config
InjectManager cdiManager = InjectManager.create();
Config.setProperty("resinHome", elContext.getResinHome());
Config.setProperty("resin", elContext.getResinVar());
Config.setProperty("server", elContext.getServerVar());
Config.setProperty("java", elContext.getJavaVar());
Config.setProperty("system", System.getProperties());
Config.setProperty("getenv", System.getenv());
ResinConfigLibrary.configure(cdiManager);