Cleanup: Add Javadoc to all public methods and members
[lttng-ust.git] / doc / examples / java-log4j / Hello.java
index a0105adf7199b1a67144e7788066d05ba4269d02..c0393392e96bea7a9d402d088b441391fdd3bdb3 100644 (file)
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
-import java.io.IOException;
 
-import org.apache.log4j.Logger;
 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;
 
@@ -35,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();
 
@@ -48,8 +57,10 @@ public class Hello
                /* Trigger a tracing event using the JUL Logger created before. */
                helloLog.info("Hello World, the answer is " + answer);
 
-               System.out.println("Firing hello delay in 10 seconds...");
+               System.out.println("Firing hello delay in 5 seconds...");
                Thread.sleep(5000);
                helloLog.info("Hello World delayed...");
+
+               lttngAgent.dispose();
        }
 }
This page took 0.023712 seconds and 4 git commands to generate.