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