2 * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 package org.lttng.ust.agent.filter;
20 import org.lttng.ust.agent.session.EventRule;
23 * Filter notification listener interface.
25 * Applications wanting to be notified of event filtering rule changes should
26 * implement this interface, then register their listener using
27 * {@link FilterChangeNotifier#registerListener}.
30 * The callbacks defined in this interface will be called whenever an event rule
31 * is added or removed. The manager will take care of the reference-counting in
32 * case multiple tracing sessions enable the exact same rules. For example, the
33 * {@link #eventRuleRemoved} callback is only called when there are no more
34 * session interested into it.
37 * Do not forget to unregister the listener after use, using
38 * {@link FilterChangeNotifier#unregisterListener}. If you do not, or if
39 * you use an anonymous listener for example, these will remain attached until
40 * the complete shutdown of the application.
43 * Only one thread is used to dispatch notifications, sequentially. This means
44 * that if a callback hangs it will prevent other listeners from receiving
45 * notifications. Please take care of not blocking inside the listener
46 * callbacks, and use separate threads for potentially long or blocking
50 * @author Alexandre Montplaisir
52 public interface IFilterChangeListener {
55 * Notification that a new event rule is now enabled in the tracing
59 * The event rule that was enabled
61 void eventRuleAdded(EventRule rule);
64 * Notification that an existing event rule is now disabled in the tracing
68 * The event rule that was disabled
70 void eventRuleRemoved(EventRule rule);