Fix: Filer -> Filter typo in example
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Oct 2015 21:26:25 +0000 (17:26 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 22 Oct 2015 21:26:25 +0000 (17:26 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/java-jul/FilerChangeListenerExample.java [deleted file]
doc/examples/java-jul/FilterChangeListenerExample.java [new file with mode: 0644]
doc/examples/java-jul/Makefile

diff --git a/doc/examples/java-jul/FilerChangeListenerExample.java b/doc/examples/java-jul/FilerChangeListenerExample.java
deleted file mode 100644 (file)
index 7e1ab5c..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-import java.io.IOException;
-import java.util.logging.Level;
-
-import org.lttng.ust.agent.ILttngHandler;
-import org.lttng.ust.agent.filter.FilterChangeNotifier;
-import org.lttng.ust.agent.filter.IFilterChangeListener;
-import org.lttng.ust.agent.jul.LttngLogHandler;
-import org.lttng.ust.agent.session.EventRule;
-import org.lttng.ust.agent.session.LogLevelSelector;
-
-/**
- * Example usage of a {@link IFilterChangeListener}.
- *
- * This listener will simply print to stdout the notifications it receives. To
- * try it, run the program, then issue "lttng enable-event" and
- * "lttng disable-event" commands for the JUL domain.
- *
- * @author Alexandre Montplaisir
- */
-public class FilerChangeListenerExample {
-
-       private static class ExampleFilterChangeListener implements IFilterChangeListener {
-
-               @Override
-               public void eventRuleAdded(EventRule rule) {
-                       System.out.println();
-                       System.out.println("New event rule enabled:");
-                       System.out.println("Event name: " + rule.getEventName());
-                       System.out.println(printLogLevel(rule.getLogLevelSelector()));
-                       System.out.println("Filter string: " + rule.getFilterString());
-               }
-
-               @Override
-               public void eventRuleRemoved(EventRule rule) {
-                       System.out.println();
-                       System.out.println("Event rule disabled:");
-                       System.out.println("Event name: " + rule.getEventName());
-                       System.out.println(printLogLevel(rule.getLogLevelSelector()));
-                       System.out.println("Filter string: " + rule.getFilterString());
-               }
-
-               /**
-                * Convenience method to print integer log level values into their JUL
-                * equivalent.
-                */
-               private static String printLogLevel(LogLevelSelector lls) {
-                       String llname = Level.parse(String.valueOf(lls.getLogLevel())).getName();
-                       return "Log level: " + llname + ", filter type: " + lls.getLogLevelType().toString();
-               }
-       }
-
-       /**
-        * Run the program.
-        *
-        * @param args
-        *            Command-line arguments (not used)
-        * @throws IOException
-        */
-       public static void main(String args[]) throws IOException {
-               /* We need at least one log handler to activate the LTTng agent */
-               ILttngHandler handler = new LttngLogHandler();
-
-               /* Create a listener and register it to the manager */
-               IFilterChangeListener listener = new ExampleFilterChangeListener();
-               FilterChangeNotifier.getInstance().registerListener(listener);
-
-               System.out.println("Press Enter to finish.");
-               System.in.read();
-
-               /* Unregister the listener */
-               FilterChangeNotifier.getInstance().unregisterListener(listener);
-
-               /* Cleanup the log handler we created */
-               handler.close();
-       }
-}
\ No newline at end of file
diff --git a/doc/examples/java-jul/FilterChangeListenerExample.java b/doc/examples/java-jul/FilterChangeListenerExample.java
new file mode 100644 (file)
index 0000000..c1f158a
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2015 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+import java.io.IOException;
+import java.util.logging.Level;
+
+import org.lttng.ust.agent.ILttngHandler;
+import org.lttng.ust.agent.filter.FilterChangeNotifier;
+import org.lttng.ust.agent.filter.IFilterChangeListener;
+import org.lttng.ust.agent.jul.LttngLogHandler;
+import org.lttng.ust.agent.session.EventRule;
+import org.lttng.ust.agent.session.LogLevelSelector;
+
+/**
+ * Example usage of a {@link IFilterChangeListener}.
+ *
+ * This listener will simply print to stdout the notifications it receives. To
+ * try it, run the program, then issue "lttng enable-event" and
+ * "lttng disable-event" commands for the JUL domain.
+ *
+ * @author Alexandre Montplaisir
+ */
+public class FilterChangeListenerExample {
+
+       private static class ExampleFilterChangeListener implements IFilterChangeListener {
+
+               @Override
+               public void eventRuleAdded(EventRule rule) {
+                       System.out.println();
+                       System.out.println("New event rule enabled:");
+                       System.out.println("Event name: " + rule.getEventName());
+                       System.out.println(printLogLevel(rule.getLogLevelSelector()));
+                       System.out.println("Filter string: " + rule.getFilterString());
+               }
+
+               @Override
+               public void eventRuleRemoved(EventRule rule) {
+                       System.out.println();
+                       System.out.println("Event rule disabled:");
+                       System.out.println("Event name: " + rule.getEventName());
+                       System.out.println(printLogLevel(rule.getLogLevelSelector()));
+                       System.out.println("Filter string: " + rule.getFilterString());
+               }
+
+               /**
+                * Convenience method to print integer log level values into their JUL
+                * equivalent.
+                */
+               private static String printLogLevel(LogLevelSelector lls) {
+                       String llname = Level.parse(String.valueOf(lls.getLogLevel())).getName();
+                       return "Log level: " + llname + ", filter type: " + lls.getLogLevelType().toString();
+               }
+       }
+
+       /**
+        * Run the program.
+        *
+        * @param args
+        *            Command-line arguments (not used)
+        * @throws IOException
+        */
+       public static void main(String args[]) throws IOException {
+               /* We need at least one log handler to activate the LTTng agent */
+               ILttngHandler handler = new LttngLogHandler();
+
+               /* Create a listener and register it to the manager */
+               IFilterChangeListener listener = new ExampleFilterChangeListener();
+               FilterChangeNotifier.getInstance().registerListener(listener);
+
+               System.out.println("Press Enter to finish.");
+               System.in.read();
+
+               /* Unregister the listener */
+               FilterChangeNotifier.getInstance().unregisterListener(listener);
+
+               /* Cleanup the log handler we created */
+               handler.close();
+       }
+}
index 8cbc23b35f70a621e625ed68d3db178a3442f012..f4dacdd621ee0699f3e770605a7cdcca565b080f 100644 (file)
@@ -40,7 +40,7 @@ JC = javac -classpath "$(CLASSPATH):."
 .java.class:
        $(JC) $(JFLAGS) $*.java
 
-CLASSES = Hello.java FilerChangeListenerExample.java
+CLASSES = Hello.java FilterChangeListenerExample.java
 
 all: classes
 
This page took 0.027495 seconds and 5 git commands to generate.