コード例 #1
0
 public void resetThreadContextLoader() {
   if (LoaderUtils.isContextLoaderAvailable() && this.isContextLoaderSaved) {
     LoaderUtils.setContextClassLoader(this.savedContextLoader);
     this.savedContextLoader = null;
     this.isContextLoaderSaved = false;
   }
 }
コード例 #2
0
 public void setThreadContextLoader() {
   if (this.isContextLoaderSaved) {
     throw new BuildException("Context loader has not been reset");
   }
   if (LoaderUtils.isContextLoaderAvailable()) {
     this.savedContextLoader = LoaderUtils.getContextClassLoader();
     ClassLoader loader = this;
     if (this.project != null && "only".equals(this.project.getProperty("build.sysclasspath"))) {
       loader = this.getClass().getClassLoader();
     }
     LoaderUtils.setContextClassLoader(loader);
     this.isContextLoaderSaved = true;
   }
 }