public void shutdownResolverExecutor() { Executor current = executor.getAndClear(); if (current instanceof ExecutorService) { ((ExecutorService) current).shutdown(); } } }
/** * Returns the module loader for this wiring. If the module * loader does not exist yet then one will be created * @return the module loader for this wiring. */ public ModuleLoader getModuleLoader() { return loader.getInitialized(loaderInitializer); }
private static <T> T unchecked(Exception exception) { return AtomicLazyInitializer.<T, RuntimeException> unchecked0(exception); }
private void invalidate0(boolean releaseLoader) { // set the isValid to false first isValid = false; ModuleLoader current = releaseLoader ? loader.getAndClear() : loader.get(); revision.getRevisions().getContainer().getAdaptor().invalidateWiring(this, current); }
void loadFragments(Collection<ModuleRevision> fragments) { ModuleLoader current = loader.get(); if (current != null) { current.loadFragments(fragments); } }
/** * Atomically gets the current initialized value. If the current value is {@code null} * then the supplied initializer is called to create the value returned. * @param initializer the initializer to call if the current value is {@code null} * @return the initialized value. May return {@code null} if initializer returns null. */ public final V getInitialized(Callable<V> initializer) { V result = holder.get(); if (result != null) { return result; } // Must hold a lock to ensure the operation is atomic. synchronized (holder) { result = holder.get(); if (result != null) { return result; } try { result = initializer.call(); } catch (Exception e) { unchecked(e); } holder.set(result); return result; } }
private void invalidate0(boolean releaseLoader) { // set the isValid to false first isValid = false; ModuleLoader current = releaseLoader ? loader.getAndClear() : loader.get(); revision.getRevisions().getContainer().getAdaptor().invalidateWiring(this, current); }
void loadFragments(Collection<ModuleRevision> fragments) { ModuleLoader current = loader.get(); if (current != null) { current.loadFragments(fragments); } }
/** * Atomically gets the current initialized value. If the current value is {@code null} * then the supplied initializer is called to create the value returned. * @param initializer the initializer to call if the current value is {@code null} * @return the initialized value. May return {@code null} if initializer returns null. */ public final V getInitialized(Callable<V> initializer) { V result = holder.get(); if (result != null) { return result; } // Must hold a lock to ensure the operation is atomic. synchronized (holder) { result = holder.get(); if (result != null) { return result; } try { result = initializer.call(); } catch (Exception e) { unchecked(e); } holder.set(result); return result; } }
private void invalidate0(boolean releaseLoader) { // set the isValid to false first isValid = false; ModuleLoader current = releaseLoader ? loader.getAndClear() : loader.get(); revision.getRevisions().getContainer().getAdaptor().invalidateWiring(this, current); }
/** * Returns the module loader for this wiring. If the module * loader does not exist yet then one will be created * @return the module loader for this wiring. */ public ModuleLoader getModuleLoader() { return loader.getInitialized(loaderInitializer); }
void loadFragments(Collection<ModuleRevision> fragments) { ModuleLoader current = loader.get(); if (current != null) { current.loadFragments(fragments); } }
private static <T> T unchecked(Exception exception) { return AtomicLazyInitializer.<T, RuntimeException> unchecked0(exception); }
/** * Atomically gets the current initialized value. If the current value is {@code null} * then the supplied initializer is called to create the value returned. * @param initializer the initializer to call if the current value is {@code null} * @return the initialized value. May return {@code null} if initializer returns null. */ public final V getInitialized(Callable<V> initializer) { V result = holder.get(); if (result != null) { return result; } // Must hold a lock to ensure the operation is atomic. synchronized (holder) { result = holder.get(); if (result != null) { return result; } try { result = initializer.call(); } catch (Exception e) { unchecked(e); } holder.set(result); return result; } }
public void shutdownResolverExecutor() { Executor current = executor.getAndClear(); if (current instanceof ExecutorService) { ((ExecutorService) current).shutdown(); } }
private void invalidate0(boolean releaseLoader) { // set the isValid to false first isValid = false; ModuleLoader current = releaseLoader ? loader.getAndClear() : loader.get(); revision.getRevisions().getContainer().getAdaptor().invalidateWiring(this, current); }
/** * Returns the module loader for this wiring. If the module * loader does not exist yet then one will be created * @return the module loader for this wiring. */ public ModuleLoader getModuleLoader() { return loader.getInitialized(loaderInitializer); }
void loadFragments(Collection<ModuleRevision> fragments) { ModuleLoader current = loader.get(); if (current != null) { current.loadFragments(fragments); } }
private static <T> T unchecked(Exception exception) { return AtomicLazyInitializer.<T, RuntimeException> unchecked0(exception); }
/** * Atomically gets the current initialized value. If the current value is {@code null} * then the supplied initializer is called to create the value returned. * @param initializer the initializer to call if the current value is {@code null} * @return the initialized value. May return {@code null} if initializer returns null. */ public final V getInitialized(Callable<V> initializer) { V result = holder.get(); if (result != null) { return result; } // Must hold a lock to ensure the operation is atomic. synchronized (holder) { result = holder.get(); if (result != null) { return result; } try { result = initializer.call(); } catch (Exception e) { unchecked(e); } holder.set(result); return result; } }