@@ -243,8 +243,9 @@ public ServiceManager(Iterable<? extends Service> services) {
243
243
* during {@code Executor.execute} (e.g., a {@code RejectedExecutionException}) will be caught and
244
244
* logged.
245
245
*
246
- * <p>For fast, lightweight listeners that would be safe to execute in any thread, consider
247
- * calling {@link #addListener(Listener)}.
246
+ * <p>When selecting an executor, note that {@code directExecutor} is dangerous in some cases. See
247
+ * the discussion in the {@link ListenableFuture#addListener ListenableFuture.addListener}
248
+ * documentation.
248
249
*
249
250
* @param listener the listener to run when the manager changes state
250
251
* @param executor the executor in which the listeners callback methods will be run.
@@ -269,7 +270,14 @@ public void addListener(Listener listener, Executor executor) {
269
270
*
270
271
* @param listener the listener to run when the manager changes state
271
272
* @since 15.0
273
+ * @deprecated Use {@linkplain #addListener(Listener, Executor) the overload that accepts an
274
+ * executor}. For equivalent behavior, pass {@link MoreExecutors#directExecutor}. However,
275
+ * consider whether another executor would be more appropriate, as discussed in the docs for
276
+ * {@link ListenableFuture#addListener ListenableFuture.addListener}. This method is scheduled
277
+ * for deletion in October 2020.
272
278
*/
279
+ @ Beta // currently redundant, but ensures we keep this @Beta when we gradate the class!
280
+ @ Deprecated
273
281
public void addListener (Listener listener ) {
274
282
state .addListener (listener , directExecutor ());
275
283
}
0 commit comments