public void threadDidCleanup() { lock.lock(); }
public void finish() { lock.lock(); flush(); }
public void done() { lock.lock(); } }
public void finish() { lock.lock(); flush(); }
private void registryDidShutdown() { lock.lock(); // store into new data structure so we can remove them from registered beans ObjectName[] objects = registeredBeans.toArray(new ObjectName[registeredBeans.size()]); for (final ObjectName name : objects) { doUnregister(name); } this.registeredBeans.clear(); } }
/** * Returns the hidden field element, which can have its attributes filled in. * * @return the element * @throws IllegalStateException * if the element was not positioned */ public Element getElement() { lock.lock(); // Remove the listener if it hasn't been removed already. writer.removeListener(listener); if (hiddenFieldElement == null) throw new IllegalStateException( "The rendered content did not include any elements that allow for the positioning of the hidden form field's element."); return hiddenFieldElement; }
/** * Invokes run() on each contributed object. If the object throws a runtime exception, it is logged but startup * continues anyway. This method may only be {@linkplain OneShotLock invoked once}. */ @Override public void run() { lock.lock(); // Do we want extra exception catching here? for (Runnable r : configuration) { try { r.run(); } catch (RuntimeException ex) { // startup-failure=An exception occurred during startup: %s logger.error(String.format("An exception occurred during startup: %s", ExceptionUtils.toMessage(ex)), ex); } } // We don't need them any more since this method can only be run once. It's a insignificant // savings, but still a nice thing to do. configuration.clear(); }
/** * Invokes run() on each contributed object. If the object throws a runtime exception, it is logged but startup * continues anyway. This method may only be {@linkplain OneShotLock invoked once}. */ @Override public void run() { lock.lock(); // Do we want extra exception catching here? for (Runnable r : configuration) { try { r.run(); } catch (RuntimeException ex) { // startup-failure=An exception occurred during startup: %s logger.error("An exception occurred during startup: {}", ExceptionUtils.toMessage(ex), ex); } } // We don't need them any more since this method can only be run once. It's a insignificant // savings, but still a nice thing to do. configuration.clear(); }
@Override public synchronized void shutdown() { lock.lock(); registryShutdownHub.fireRegistryDidShutdown(); SerializationSupport.clearProvider(this); }
@Override public synchronized void shutdown() { lock.lock(); registryShutdownHub.fireRegistryDidShutdown(); SerializationSupport.clearProvider(this); }
/** * Discard this positioner (an alternative to invoking {@link #getElement()}). * If an {@link Element} has been created for the hidden field, that * element is removed. * * @since 5.2.0 */ public void discard() { lock.lock(); if (hiddenFieldElement != null) hiddenFieldElement.remove(); writer.removeListener(listener); }
/** * Fires the {@link RegistryShutdownListener#registryDidShutdown()} method on each listener. At the end, all the * listeners are discarded. */ public void fireRegistryDidShutdown() { lock.lock(); F.flow(preListeners).concat(listeners).each(new Worker<Runnable>() { @Override public void work(Runnable element) { try { element.run(); } catch (RuntimeException ex) { logger.error(ServiceMessages.shutdownListenerError(element, ex), ex); } } }); preListeners.clear(); listeners.clear(); }
/** * Fires the {@link RegistryShutdownListener#registryDidShutdown()} method on each listener. At the end, all the * listeners are discarded. */ public void fireRegistryDidShutdown() { lock.lock(); F.flow(preListeners).concat(listeners).each(new Worker<Runnable>() { @Override public void work(Runnable element) { try { element.run(); } catch (RuntimeException ex) { logger.error(ServiceMessages.shutdownListenerError(element, ex), ex); } } }); preListeners.clear(); listeners.clear(); }
public List<T> getOrdered() { lock.lock(); initializeGraph(); List<T> result = newList(); for (Orderable<T> orderable : trailer.getOrdered()) { T target = orderable.getTarget(); // Nulls are placeholders that are skipped. if (target != null) result.add(target); } return result; }
public List<T> getOrdered() { lock.lock(); initializeGraph(); List<T> result = newList(); for (Orderable<T> orderable : trailer.getOrdered()) { T target = orderable.getTarget(); // Nulls are placeholders that are skipped. if (target != null) result.add(target); } return result; }
public List<T> getOrdered() { lock.lock(); initializeGraph(); List<T> result = newList(); for (Orderable<T> orderable : trailer.getOrdered()) { T target = orderable.getTarget(); // Nulls are placeholders that are skipped. if (target != null) result.add(target); } return result; }
public List<T> getOrdered() { lock.lock(); initializeGraph(); List<T> result = newList(); for (Orderable<T> orderable : trailer.getOrdered()) { T target = orderable.getTarget(); // Nulls are placeholders that are skipped. if (target != null) result.add(target); } return result; }
/** * Constructs and returns the registry; this may only be done once. The caller is responsible for invoking * {@link org.apache.tapestry5.ioc.Registry#performRegistryStartup()}. */ public Registry build() { lock.lock(); PerThreadOperationTracker tracker = new PerThreadOperationTracker(loggerSource.getLogger(Registry.class)); RegistryImpl registry = new RegistryImpl(modules, proxyFactory, loggerSource, tracker); return new RegistryWrapper(registry); }
/** * Constructs and returns the registry; this may only be done once. The caller is responsible for invoking * {@link org.apache.tapestry5.ioc.Registry#performRegistryStartup()}. */ public Registry build() { lock.lock(); PerThreadOperationTracker tracker = new PerThreadOperationTracker(loggerSource.getLogger(Registry.class)); RegistryImpl registry = new RegistryImpl(modules, proxyFactory, loggerSource, tracker); return new RegistryWrapper(registry); }