Cleanup: Add Javadoc to all public methods and members
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 22 Jul 2015 02:50:54 +0000 (22:50 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 22 Jul 2015 15:10:25 +0000 (11:10 -0400)
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/java-jul/Hello.java
doc/examples/java-log4j/Hello.java
liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/LTTngAgent.java
liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/LTTngSessiondCmd2_6.java
liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/LogFrameworkSkeleton.java
liblttng-ust-java-agent/java/lttng-ust-agent-jul/org/lttng/ust/agent/jul/LTTngJUL.java
liblttng-ust-java-agent/java/lttng-ust-agent-log4j/org/lttng/ust/agent/log4j/LTTngLog4j.java

index 588ec815daf302f950ed7db355093139a6c636a3..28360c721a809bc2eae8d2c4ae8d382b3e102787 100644 (file)
@@ -27,8 +27,13 @@ import java.util.logging.Logger;
  */
 import org.lttng.ust.agent.LTTngAgent;
 
-public class Hello
-{
+/**
+ * Example application using the LTTng-UST Java JUL agent.
+ *
+ * @author David Goulet
+ */
+public class Hello {
+
        /* Of course :) */
        private static final int answer = 42;
 
@@ -38,8 +43,14 @@ public class Hello
         */
        private static LTTngAgent lttngAgent;
 
-       public static void main(String args[]) throws Exception
-       {
+       /**
+        * Application start
+        *
+        * @param args
+        *            Command-line arguments
+        * @throws Exception
+        */
+       public static void main(String args[]) throws Exception {
                /*
                 * For this example, a custom "hello" logger is created. Note that JUL
                 * has a default "global" that can also be used.
index 38725cb6a7e04b9c3032497cb99b030652b2c83d..c0393392e96bea7a9d402d088b441391fdd3bdb3 100644 (file)
@@ -24,8 +24,13 @@ import org.apache.log4j.BasicConfigurator;
 import org.apache.log4j.Logger;
 import org.lttng.ust.agent.LTTngAgent;
 
-public class Hello
-{
+/**
+ * Example application using the LTTng-UST Java JUL agent.
+ *
+ * @author Christian Babeux
+ */
+public class Hello {
+
        /* Of course :) */
        private static final int answer = 42;
 
@@ -33,8 +38,14 @@ public class Hello
 
        private static LTTngAgent lttngAgent;
 
-       public static void main(String args[]) throws Exception
-       {
+       /**
+        * Application start
+        *
+        * @param args
+        *            Command-line arguments
+        * @throws Exception
+        */
+       public static void main(String args[]) throws Exception {
                BasicConfigurator.configure();
                lttngAgent = LTTngAgent.getLTTngAgent();
 
index ca7bc777fa24b1042acf3d41bbd27fcc4e73a547..e83504d94d8f3f26072cca3b0765da8182597850 100644 (file)
@@ -22,6 +22,11 @@ import java.lang.reflect.InvocationTargetException;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 
+/**
+ * The central agent managing the JUL and Log4j handlers.
+ *
+ * @author David Goulet
+ */
 public class LTTngAgent {
 
        /* Domains */
@@ -181,8 +186,11 @@ public class LTTngAgent {
                }
        }
 
-       /*
+       /**
         * Public getter to acquire a reference to this singleton object.
+        *
+        * @return The agent instance
+        * @throws IOException
         */
        public static synchronized LTTngAgent getLTTngAgent() throws IOException {
                if (curAgent == null) {
@@ -273,8 +281,11 @@ public class LTTngAgent {
                return numThreads;
        }
 
-
-       public void dispose() throws IOException {
+       /**
+        * Dispose the agent. Applications should call this once they are done
+        * logging.
+        */
+       public void dispose() {
                if (this.useJUL) {
                        julUserClient.destroy();
                        julRootClient.destroy();
index 7a33e4252c679f72b9cd1516064e9ca4057b83c7..03635c2e80dcda8d401e0d5e244f3de90df6eb2f 100644 (file)
@@ -149,6 +149,8 @@ interface LTTngSessiondCmd2_6 {
                /**
                 * Execute enable handler action which is to enable the given handler
                 * to the received name.
+                *
+                * @param log
                 */
                public void execute(LogFramework log) {
                        if (log.enableLogger(this.name)) {
@@ -187,6 +189,8 @@ interface LTTngSessiondCmd2_6 {
                /**
                 * Execute disable handler action which is to disable the given handler
                 * to the received name.
+                *
+                * @param log
                 */
                public void execute(LogFramework log) {
                        if (log.disableLogger(this.name)) {
index 6d1ea9f68c9e85889e19db7a185588c2bc52d0a7..4a58d2e22322ec2e64702047c1a6fd06b9b28b1e 100644 (file)
 
 package org.lttng.ust.agent;
 
-import java.util.Map;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
+/**
+ * Basic implementation of LogFramework.
+ *
+ * @author Christian Babeux
+ */
 public abstract class LogFrameworkSkeleton implements LogFramework {
 
        /* A map of event name and reference count */
        private final Map<String, Integer> enabledLoggers;
 
+       /**
+        * Constructor
+        */
        public LogFrameworkSkeleton() {
                this.enabledLoggers = new HashMap<String, Integer>();
        }
@@ -88,6 +96,11 @@ public abstract class LogFrameworkSkeleton implements LogFramework {
                enabledLoggers.clear();
        }
 
+       /**
+        * Get the number of enabled events.
+        *
+        * @return The number of enabled events
+        */
        protected Integer getEventCount() {
                return enabledLoggers.size();
        }
index 6a3eac95cc8ce90c0acbffcd6197268f9ab24c39..2f21d62ebcd5e87b8d2b42eb06f93f79802be353 100644 (file)
@@ -21,17 +21,27 @@ package org.lttng.ust.agent.jul;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Vector;
-
 import java.util.logging.LogManager;
 import java.util.logging.Logger;
 
 import org.lttng.ust.agent.LogFrameworkSkeleton;
 
+/**
+ * JUL logging framework
+ *
+ * @author Christian Babeux
+ */
 public class LTTngJUL extends LogFrameworkSkeleton {
 
        private LTTngLogHandler handler;
        private Boolean attached;
 
+       /**
+        * Constructor
+        *
+        * @param isRoot
+        *            If this logger is a root logger or not.
+        */
        public LTTngJUL(Boolean isRoot) {
                super();
                this.handler = new LTTngLogHandler(isRoot);
index 6e892bcc220983a59f772401e4690ea62dd8970d..534cc94945620a8dd7860e521533ba5342cf68e1 100644 (file)
@@ -24,14 +24,24 @@ import java.util.Vector;
 
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
-
 import org.lttng.ust.agent.LogFrameworkSkeleton;
 
+/**
+ * log4j logging framework
+ *
+ * @author Christian Babeux
+ */
 public class LTTngLog4j extends LogFrameworkSkeleton {
 
        private LTTngLogAppender appender;
        private Boolean attached;
 
+       /**
+        * Constructor
+        *
+        * @param isRoot
+        *            If this logger is a root logger or not.
+        */
        public LTTngLog4j(Boolean isRoot) {
                super();
                this.appender = new LTTngLogAppender(isRoot);
This page took 0.029557 seconds and 4 git commands to generate.