Manage complete "event rules" in the Java agent
[deliverable/lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / AbstractLttngAgent.java
index c3fc339bc628b09234e1ed41962f2197fb221b8f..ef3b1dbe9afddddd5922a0e91d9999254c40209e 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.session.EventRule;
 
 /**
  * Base implementation of a {@link ILttngAgent}.
@@ -55,7 +56,7 @@ public abstract class AbstractLttngAgent<T extends ILttngHandler>
         * falls to 0, this means we can avoid sending log events through JNI
         * because nobody wants them.
         *
-        * It uses a concurrent hash set", so that the {@link #isEventEnabled} and
+        * It uses a concurrent hash map, so that the {@link #isEventEnabled} and
         * read methods do not need to take a synchronization lock.
         */
        private final Map<String, Integer> enabledEvents = new ConcurrentHashMap<String, Integer>();
@@ -189,12 +190,13 @@ public abstract class AbstractLttngAgent<T extends ILttngHandler>
        }
 
        @Override
-       public boolean eventEnabled(String eventName) {
+       public boolean eventEnabled(EventRule eventRule) {
+               String eventName = eventRule.getEventName();
+
                if (eventName.equals(WILDCARD)) {
                        enabledWildcards.incrementAndGet();
                        return true;
                }
-
                if (eventName.endsWith(WILDCARD)) {
                        /* Strip the "*" from the name. */
                        String prefix = eventName.substring(0, eventName.length() - 1);
This page took 0.024171 seconds and 5 git commands to generate.