/** * Cleans up resources. * * @since Ant 1.8.0 */ protected void cleanup() { if (readerLoader != null) { readerLoader.cleanup(); readerLoader = null; } }
public void cleanup() { if (cleanup) { ((AntClassLoader) loader).cleanup(); } } }
/** * Cleans up resources. * * @since Ant 1.8.0 */ protected void cleanup() { if (loader != null) { loader.cleanup(); loader = null; } }
/** * Cleans up any resources held by this classloader at the end * of a build. * * @param event the buildFinished event */ public void buildFinished(final BuildEvent event) { cleanup(); }
/** {@inheritDoc} */ public void close() { cleanup(); }
/** * Cleans up any resources held by this classloader at the end of * a subbuild if it has been created for the subbuild's project * instance. * * @param event the buildFinished event * * @since Ant 1.6.2 */ public void subBuildFinished(final BuildEvent event) { if (event.getProject() == project) { cleanup(); } }
/** {@inheritDoc}. */ @Override public boolean eval() throws BuildException { if (classname == null) { throw new BuildException("No classname defined"); } ClassLoader preLoadClass = loader; try { Class<?> clazz = loadClass(classname); if (method != null) { return isMethodFound(clazz); } if (field != null) { return isFieldFound(clazz); } throw new BuildException("Neither method nor field defined"); } finally { if (preLoadClass != loader && loader != null) { loader.cleanup(); loader = null; } } }
FileUtils.close(is); if (cleanup && cL != null) { ((AntClassLoader) cL).cleanup();
@SuppressWarnings("resource") AntClassLoader loader = (AntClassLoader) genericLoader; loader.cleanup();
@SuppressWarnings("resource") AntClassLoader loader = (AntClassLoader) genericLoader; loader.cleanup();
loader.cleanup(); loader = null;
loader.cleanup();
if (loader != null) { loader.resetThreadContextLoader(); loader.cleanup(); loader = null;
if (loader != null) { loader.resetThreadContextLoader(); loader.cleanup(); loader = null;
/** * Removes a classloader if needed. * @since Ant 1.7 */ private void deleteClassLoader() { if (classLoader != null) { classLoader.cleanup(); classLoader = null; } if (mirrorLoader instanceof SplitClassLoader) { ((SplitClassLoader) mirrorLoader).cleanup(); } mirrorLoader = null; }
/** * Reset the project */ public void reset() { getTargets().clear(); setDefault(null); setDescription(null); setName(IAntCoreConstants.EMPTY_STRING); synchronized (loaderLock) { if (loaders != null) { Iterator<Entry<String, AntClassLoader>> i = loaders.entrySet().iterator(); Entry<String, AntClassLoader> e = null; while (i.hasNext()) { e = i.next(); AntClassLoader acl = e.getValue(); acl.cleanup(); acl.clearAssertionStatus(); } } } }
@Override protected void tearDown() throws Exception { cl.cleanup(); super.tearDown(); if (Launcher.isWindows()) { // Current Resource loader implementation keep files open even if we close the classloader. // This check has been never working correctly in Windows. // TODO: Fix it as a part of JENKINS-38696 return; } // because the dir is used by FIleSystemJarCache to asynchronously load stuff // we might fail to shut it down right away for (int i=0; ; i++) { try { FileUtils.deleteDirectory(dir); return; } catch (IOException e) { if (i==3) throw e; Thread.sleep(1000); } } }
if (loader != null) { loader.resetThreadContextLoader(); loader.cleanup();
if (loader != null) { loader.resetThreadContextLoader(); loader.cleanup();