Add filter change notification mechanism to the Java agent
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / AbstractLttngAgent.java
index ef3b1dbe9afddddd5922a0e91d9999254c40209e..8531eaec7c3b8ddab23f0b7aa1e668ffc3376124 100644 (file)
@@ -30,6 +30,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import org.lttng.ust.agent.client.ILttngTcpClientListener;
 import org.lttng.ust.agent.client.LttngTcpSessiondClient;
+import org.lttng.ust.agent.filter.FilterChangeNotifier;
 import org.lttng.ust.agent.session.EventRule;
 
 /**
@@ -191,6 +192,9 @@ public abstract class AbstractLttngAgent<T extends ILttngHandler>
 
        @Override
        public boolean eventEnabled(EventRule eventRule) {
+               /* Notify the filter change manager of the command */
+               FilterChangeNotifier.getInstance().addEventRule(eventRule);
+
                String eventName = eventRule.getEventName();
 
                if (eventName.equals(WILDCARD)) {
@@ -208,6 +212,9 @@ public abstract class AbstractLttngAgent<T extends ILttngHandler>
 
        @Override
        public boolean eventDisabled(String eventName) {
+               /* Notify the filter change manager of the command */
+               FilterChangeNotifier.getInstance().removeEventRules(eventName);
+
                if (eventName.equals(WILDCARD)) {
                        int newCount = enabledWildcards.decrementAndGet();
                        if (newCount < 0) {
This page took 0.023915 seconds and 5 git commands to generate.