本文整理匯總了Java中org.springframework.boot.loader.jar.Handler類的典型用法代碼示例。如果您正苦於以下問題:Java Handler類的具體用法?Java Handler怎麽用?Java Handler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Handler類屬於org.springframework.boot.loader.jar包,在下文中一共展示了Handler類的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;
}
}
示例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);
}
}