AsyncCompleter(final Executor executor, final ExceptionPolicy policy, final ExecutorCompletionServiceFactory completionServiceFactory, CompletionServiceDecorator completionServiceDecorator) { this.executor = notNull("executor", executor); this.policy = notNull("policy", policy); this.completionServiceFactory = notNull("completionServiceFactory", completionServiceFactory); this.completionServiceDecorator = completionServiceDecorator; }
Default(final String name, final Type type, final int priority, final UncaughtExceptionHandler exceptionHandler) { namePrefix = notNull("name", name) + ":thread-"; this.type = notNull("type", type); isTrue("priority too low", priority >= Thread.MIN_PRIORITY); isTrue("priority too high", priority <= Thread.MAX_PRIORITY); this.priority = priority; final SecurityManager securityManager = System.getSecurityManager(); final ThreadGroup parent = (securityManager != null) ? securityManager.getThreadGroup() : Thread.currentThread().getThreadGroup(); group = new ThreadGroup(parent, name); this.exceptionHandler = exceptionHandler; }
Future<T> check(Future<T> f) { isTrue("Expected the future to be in the list of registered futures", futures.remove(f)); return f; }
public RuntimeExecutionException(final String message, final ExecutionException cause) { super(message, notNull("cause", cause)); } }
public Builder name(final String name) { this.name = notNull("name", name); return this; }
public LoadingCache(final SynchronizedLoadingCacheDecorator cache, final CacheLoader<K, V> loader) throws CacheException { super(cache, DEFAULT_NUMBER_OF_MUTEXES); this.loader = notNull("loader", loader); this.delegate = cache; }
public RuntimeTimeoutException(final String message, final TimeoutException cause) { super(message, notNull("cause", cause)); }
private static <K, V> CopyOnWriteSortedMap<K, V> comparedTreeMap(final Map<? extends K, ? extends V> map, final Type viewType, final Comparator<? super K> comparator) { notNull("comparator", comparator); return new CopyOnWriteSortedMap<K, V>(map, viewType) { private static final long serialVersionUID = -7243810284130497340L; @Override public <N extends Map<? extends K, ? extends V>> SortedMap<K, V> copy(final N map) { final TreeMap<K, V> treeMap = new TreeMap<K, V>(comparator); treeMap.putAll(map); return treeMap; } }; } }
public Builder type(final Type type) { this.type = notNull("type", type); return this; }
public AtomicReferenceUpdater(final AtomicReference<T> reference) { this.reference = notNull("reference", reference); }
IgnoreAndReturnNull(final com.google.common.base.Supplier<T> delegate) { this.delegate = notNull("delegate", delegate); }
public Builder completionServiceFactory(final ExecutorCompletionServiceFactory completionServiceFactory) { this.completionServiceFactory = notNull("completionServiceFactory", completionServiceFactory); return this; }
public Builder uncaughtExceptionHandler(final Thread.UncaughtExceptionHandler exceptionHandler) { this.exceptionHandler = notNull("exceptionHandler", exceptionHandler); return this; }
public RuntimeInterruptedException(final InterruptedException cause) { super(notNull("cause", cause)); }
public RuntimeInterruptedException(final String message, final InterruptedException cause) { super(message, notNull("cause", cause)); }
public RuntimeTimeoutException(final TimeoutException cause) { super(notNull("cause", cause)); }
public RuntimeExecutionException(final ExecutionException cause) { super(notNull("cause", cause)); }