[slf4j-dev] svn commit: r1216 - in slf4j/trunk/slf4j-ext/src/main/java/org/slf4j: agent instrumentation

ravn at slf4j.org ravn at slf4j.org
Sat Oct 25 17:50:23 CEST 2008


Author: ravn
Date: Sat Oct 25 17:50:23 2008
New Revision: 1216

Added:
   slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/package.html
   slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/package.html
Modified:
   slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
   slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java

Log:
added javadoc

Added: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/package.html
==============================================================================
--- (empty file)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/agent/package.html	Sat Oct 25 17:50:23 2008
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+
+<html>
+<head>
+<title></title>
+</head>
+
+
+<body>
+<p>"-javaagent" routines for SLF4J.</p>
+<p>The "-javaagent" flag provided in Java 5+ allows for writing
+agents in Java, which previously was possible in native code only. The
+full details are available at <a
+	href="http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html">http://java.sun.com/javase/6/docs/api/java/lang/instrument/package-summary.html</a>.
+Please notice that code made available to the java agent is also available to the actual program executed.
+
+</p>
+
+</body>
+</html>

Modified: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java
==============================================================================
--- slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java	(original)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/JavassistHelper.java	Sat Oct 25 17:50:23 2008
@@ -8,6 +8,10 @@
 import javassist.bytecode.CodeAttribute;
 import javassist.bytecode.LocalVariableAttribute;
 
+/**
+ * Helper methods for Javassist functionality.
+ *
+ */
 public class JavassistHelper {
 
   /**

Modified: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java
==============================================================================
--- slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java	(original)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/LogTransformer.java	Sat Oct 25 17:50:23 2008
@@ -19,13 +19,25 @@
 import org.slf4j.helpers.MessageFormatter;
 
 /**
+ * <p>
  * LogTransformer does the work of analyzing each class, and if appropriate add
  * log statements to each method to allow logging entry/exit.
- * 
+ * </p>
+ * <p>
+ * This class is based on the article <a href="http://today.java.net/pub/a/today/2008/04/24/add-logging-at-class-load-time-with-instrumentation.html"
+ * >Add Logging at Class Load Time with Java Instrumentation</a>.
+ * </p>
  */
 public class LogTransformer implements ClassFileTransformer {
 
-  // http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html
+  /**
+   * Builder provides a flexible way of configuring some of many options on the
+   * parent class instead of providing many constructors.
+   * 
+   * {@link http
+   * ://rwhansen.blogspot.com/2007/07/theres-builder-pattern-that-joshua.html}
+   * 
+   */
   public static class Builder {
 
     /**
@@ -215,7 +227,8 @@
    * process a single method - this means add entry/exit logging if requested.
    * It is only called for methods with a body.
    * 
-   * @param method method to work on
+   * @param method
+   *          method to work on
    * @throws NotFoundException
    * @throws CannotCompileException
    */

Added: slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/package.html
==============================================================================
--- (empty file)
+++ slf4j/trunk/slf4j-ext/src/main/java/org/slf4j/instrumentation/package.html	Sat Oct 25 17:50:23 2008
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+
+<html>
+<head>
+<title></title>
+</head>
+
+
+<body>
+<p>Java instrumentation routines for SLF4J.</p>
+
+<p>Byte code instrumentation is an way to change behaviour of java
+classes at <i>load time</i>. This is done in-between the original byte
+codes are retrieved and the class object is constructed by the class
+loader. Currently this depends on the javassist library from JBoss
+(which in turn uses it extensively in their application server).</p>
+</body>
+</html>



More information about the slf4j-dev mailing list