當前位置: 首頁>>代碼示例>>Java>>正文


Java Handler.setUseFastConnectionExceptions方法代碼示例

本文整理匯總了Java中org.springframework.boot.loader.jar.Handler.setUseFastConnectionExceptions方法的典型用法代碼示例。如果您正苦於以下問題:Java Handler.setUseFastConnectionExceptions方法的具體用法?Java Handler.setUseFastConnectionExceptions怎麽用?Java Handler.setUseFastConnectionExceptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.loader.jar.Handler的用法示例。


在下文中一共展示了Handler.setUseFastConnectionExceptions方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadClass

import org.springframework.boot.loader.jar.Handler; //導入方法依賴的package包/類
@Override
protected Class<?> loadClass(String name, boolean resolve)
		throws ClassNotFoundException {
	Handler.setUseFastConnectionExceptions(true);
	try {
		try {
			definePackageIfNecessary(name);
		}
		catch (IllegalArgumentException ex) {
			// Tolerate race condition due to being parallel capable
			if (getPackage(name) == null) {
				// This should never happen as the IllegalArgumentException indicates
				// that the package has already been defined and, therefore,
				// getPackage(name) should not return null.
				throw new AssertionError("Package " + name + " has already been "
						+ "defined but it could not be found");
			}
		}
		return super.loadClass(name, resolve);
	}
	finally {
		Handler.setUseFastConnectionExceptions(false);
	}
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:25,代碼來源:LaunchedURLClassLoader.java

示例2: loadClass

import org.springframework.boot.loader.jar.Handler; //導入方法依賴的package包/類
/**
 * Attempt to load classes from the URLs before delegating to the parent loader.
 */
@Override
protected Class<?> loadClass(String name, boolean resolve)
		throws ClassNotFoundException {
	synchronized (LaunchedURLClassLoader.LOCK_PROVIDER.getLock(this, name)) {
		Class<?> loadedClass = findLoadedClass(name);
		if (loadedClass == null) {
			Handler.setUseFastConnectionExceptions(true);
			try {
				loadedClass = doLoadClass(name);
			}
			finally {
				Handler.setUseFastConnectionExceptions(false);
			}
		}
		if (resolve) {
			resolveClass(loadedClass);
		}
		return loadedClass;
	}
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:24,代碼來源:LaunchedURLClassLoader.java

示例3: findResource

import org.springframework.boot.loader.jar.Handler; //導入方法依賴的package包/類
@Override
public URL findResource(String name) {
	Handler.setUseFastConnectionExceptions(true);
	try {
		return super.findResource(name);
	}
	finally {
		Handler.setUseFastConnectionExceptions(false);
	}
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:LaunchedURLClassLoader.java

示例4: findResources

import org.springframework.boot.loader.jar.Handler; //導入方法依賴的package包/類
@Override
public Enumeration<URL> findResources(String name) throws IOException {
	Handler.setUseFastConnectionExceptions(true);
	try {
		return super.findResources(name);
	}
	finally {
		Handler.setUseFastConnectionExceptions(false);
	}
}
 
開發者ID:vikrammane23,項目名稱:https-github.com-g0t4-jenkins2-course-spring-boot,代碼行數:11,代碼來源:LaunchedURLClassLoader.java

示例5: hasMoreElements

import org.springframework.boot.loader.jar.Handler; //導入方法依賴的package包/類
@Override
public boolean hasMoreElements() {
	try {
		Handler.setUseFastConnectionExceptions(true);
		return this.rootResources.hasMoreElements()
				|| this.localResources.hasMoreElements();
	}
	finally {
		Handler.setUseFastConnectionExceptions(false);
	}
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:12,代碼來源:LaunchedURLClassLoader.java


注:本文中的org.springframework.boot.loader.jar.Handler.setUseFastConnectionExceptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。