唯品会saturn开发环境中避免设置saturnLibDir

最近在看vipshop的Saturn,为更好跟踪分享Saturn saturn,简单修改启动代码,将classpath 中所有path自动设置为saturnLibDir.

只需要修改一个函数 :com.vip.saturn.job.executor.Main的setExecutorClassLoader,修改后代码如下

private void setExecutorClassLoader(ClassLoader executorClassLoader) throws MalformedURLException {
		if (executorClassLoader == null) {
			
			if (saturnLibDir!=null) {
			List urls = getUrls(new File(saturnLibDir));
				this.executorClassLoader = new SaturnClassLoader(urls.toArray(new URL[urls.size()]),
					Main.class.getClassLoader());
			}else
			{
				String path = System.getProperty("java.class.path");
				String[] paths = path.split(";");
				List urls =new ArrayList();
				for (int i=0;i

你可能感兴趣的:(saturn,Vipshop,saturn,libDir)