/** * For only test purpose */ static public void clear() { LISTENER_HUB.clear(); }
/** {@inheritDoc} */ public void removeAllItems() { currentItemIndex = 0; items.clear(); }
@Override public void clear() { super.clear(); synchronized(this) { knownGroupNamesInList = null; } }
public void clearAsyncErrors() { asyncErrors.clear(); }
/** * Removes all of the elements from this set. * The set will be empty after this call returns. */ public void clear() { al.clear(); }
public void clearAssetEventListeners() { eventListeners.clear(); }
public void setAssetEventListener(AssetEventListener listener){ eventListeners.clear(); eventListeners.add(listener); }
public void destroy() { for (MappedFile mf : this.mappedFiles) { mf.destroy(1000 * 3); } this.mappedFiles.clear(); this.flushedWhere = 0; // delete parent directory File file = new File(storePath); if (file.isDirectory()) { file.delete(); } }
public void close() throws IOException { open = false; IOUtils.closeAll( partitions ); partitions.clear(); }
private void fireAction(CriticalComponent component) { for (CriticalAction action : actions) { try { action.run(component); } catch (Throwable e) { logger.warn(e.getMessage(), e); } } actions.clear(); }
@Override public void clear() { actions.clear(); components.clear(); }
@Override public void close() throws IOException { safeClose(mbeanHandle); serverMetrics.clear(); } }
public void run() { for (IConnectionListener listener : connectionListeners) { listener.notifyDisconnected(con); } connectionListeners.clear(); } }, threadId);
public void close() { timerTask.cancel(); avgs.clear(); }
@Override public void close() throws JMSException { for (JmsBaseMessageConsumer messageConsumer : consumerList) { messageConsumer.close(); } consumerList.clear(); }
@Override public void destroy() { // close scheduled service stopRegulate(); // remove cache resource InvocationStatFactory.removeListener(listener); measureModels.clear(); measureCounter.set(0); // release strategy measureStrategy = null; regulationStrategy = null; weightDegradeStrategy = null; logDegradeStrategy = null; recoverStrategy = null; }
private synchronized void cleanUp(boolean unregister) { pause(); if (unregister) { LOGGER.debug("Unregistering {} with AlertingProviderRegistry.", this); alertingProviderRegistry.unregisterAlertingProvider(this); } listeners.clear(); setAlertMessaging(null); }
/** * Completely replaces views. * * <p> * This operation is NOT provided as an atomic operation, but rather * the sole purpose of this is to define a setter for this to help * introspecting code, such as system-config-dsl plugin */ // even if we want to offer this atomic operation, CopyOnWriteArrayList // offers no such operation public void setViews(Collection<View> views) throws IOException { BulkChange bc = new BulkChange(this); try { this.views.clear(); for (View v : views) { addView(v); } } finally { bc.commit(); } }
private void loadConfig() throws IOException { XmlFile cfg = getConfigFile(); if (cfg.exists()) { // reset some data that may not exist in the disk file // so that we can take a proper compensation action later. primaryView = null; views.clear(); // load from disk cfg.unmarshal(Jenkins.this); } try { checkRawBuildsDir(buildsDir); setBuildsAndWorkspacesDir(); } catch (InvalidBuildsDir invalidBuildsDir) { throw new IOException(invalidBuildsDir); } }
@Test public void dependencyStartedFirstAndIsSmartLifecycle() throws Exception { CopyOnWriteArrayList<Lifecycle> startedBeans = new CopyOnWriteArrayList<>(); TestSmartLifecycleBean beanNegative = TestSmartLifecycleBean.forStartupTests(-99, startedBeans); TestSmartLifecycleBean bean99 = TestSmartLifecycleBean.forStartupTests(99, startedBeans); TestSmartLifecycleBean bean7 = TestSmartLifecycleBean.forStartupTests(7, startedBeans); TestLifecycleBean simpleBean = TestLifecycleBean.forStartupTests(startedBeans); StaticApplicationContext context = new StaticApplicationContext(); context.getBeanFactory().registerSingleton("beanNegative", beanNegative); context.getBeanFactory().registerSingleton("bean7", bean7); context.getBeanFactory().registerSingleton("bean99", bean99); context.getBeanFactory().registerSingleton("simpleBean", simpleBean); context.getBeanFactory().registerDependentBean("bean7", "simpleBean"); context.refresh(); context.stop(); startedBeans.clear(); // clean start so that simpleBean is included context.start(); assertTrue(beanNegative.isRunning()); assertTrue(bean99.isRunning()); assertTrue(bean7.isRunning()); assertTrue(simpleBean.isRunning()); assertEquals(4, startedBeans.size()); assertEquals(-99, getPhase(startedBeans.get(0))); assertEquals(7, getPhase(startedBeans.get(1))); assertEquals(0, getPhase(startedBeans.get(2))); assertEquals(99, getPhase(startedBeans.get(3))); context.stop(); }