2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2015 EfficiOS Inc.
5 * Copyright (C) 2015 Alexandre Montplaisir <alexmonthy@efficios.com>
8 package org.lttng.ust.agent.filter;
10 import org.lttng.ust.agent.session.EventRule;
13 * Filter notification listener interface.
15 * Applications wanting to be notified of event filtering rule changes should
16 * implement this interface, then register their listener using
17 * {@link FilterChangeNotifier#registerListener}.
20 * The callbacks defined in this interface will be called whenever an event rule
21 * is added or removed. The manager will take care of the reference-counting in
22 * case multiple tracing sessions enable the exact same rules. For example, the
23 * {@link #eventRuleRemoved} callback is only called when there are no more
24 * session interested into it.
27 * Do not forget to unregister the listener after use, using
28 * {@link FilterChangeNotifier#unregisterListener}. If you do not, or if
29 * you use an anonymous listener for example, these will remain attached until
30 * the complete shutdown of the application.
33 * Only one thread is used to dispatch notifications, sequentially. This means
34 * that if a callback hangs it will prevent other listeners from receiving
35 * notifications. Please take care of not blocking inside the listener
36 * callbacks, and use separate threads for potentially long or blocking
40 * @author Alexandre Montplaisir
42 public interface IFilterChangeListener {
45 * Notification that a new event rule is now enabled in the tracing
49 * The event rule that was enabled
51 void eventRuleAdded(EventRule rule);
54 * Notification that an existing event rule is now disabled in the tracing
58 * The event rule that was disabled
60 void eventRuleRemoved(EventRule rule);