@Override public ServiceBindingOptions eagerLoad() { lock.check(); eagerLoad = true; return this; }
public void threadDidCleanup() { lock.lock(); }
/** * Checks to see if the lock has been set (via {@link #lock()}). * * @throws IllegalStateException * if the lock is set */ public void check() { try { acquireReadLock(); innerCheck(); } finally { releaseReadLock(); } }
/** * Checks the lock, then sets it. */ public void lock() { try { takeWriteLock(); innerCheck(); lock = true; } finally { releaseWriteLock(); } } }
/** * Checks the lock, then sets it. */ public void lock() { try { takeWriteLock(); innerCheck(); lock = true; } finally { releaseWriteLock(); } } }
@Override public ServiceBindingOptions preventDecoration() { lock.check(); preventDecoration = true; return this; }
public void finish() { lock.lock(); flush(); }
/** * Checks to see if the lock has been set (via {@link #lock()}). * * @throws IllegalStateException * if the lock is set */ public void check() { try { acquireReadLock(); innerCheck(); } finally { releaseReadLock(); } }
@Override public ServiceBindingOptions preventReloading() { lock.check(); preventReloading = true; return this; }
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(); } }
@Override public ServiceBindingOptions eagerLoad() { lock.check(); eagerLoad = true; return this; }
public void done() { lock.lock(); } }
public void setRootElement(ComponentPageElement component) { lifecycleListenersLock.check(); rootElement = component; }
public void finish() { lock.lock(); flush(); }
@Override public ServiceBindingOptions preventDecoration() { lock.check(); preventDecoration = true; return this; }
@Override public ServiceBindingOptions preventReloading() { lock.check(); preventReloading = true; return this; }
/** * 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; }
@Override public void addRegistryWillShutdownListener(Runnable listener) { assert listener != null; lock.check(); preListeners.add(listener); }
/** * 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(); }