[Jboss-cvs] JBossAS SVN: r56388 - projects/microcontainer/trunk/container/src/main/org/jboss/classloading/spi

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 29 02:28:42 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-29 02:28:41 -0400 (Tue, 29 Aug 2006)
New Revision: 56388

Modified:
   projects/microcontainer/trunk/container/src/main/org/jboss/classloading/spi/Translator.java
Log:
Add an unregisterClassLoader method

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/classloading/spi/Translator.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/classloading/spi/Translator.java	2006-08-29 06:15:53 UTC (rev 56387)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/classloading/spi/Translator.java	2006-08-29 06:28:41 UTC (rev 56388)
@@ -22,6 +22,7 @@
 package org.jboss.classloading.spi;
 
 import java.lang.instrument.IllegalClassFormatException;
+import java.lang.instrument.Instrumentation;
 import java.security.ProtectionDomain;
 
 /**
@@ -34,10 +35,35 @@
  */
 public interface Translator
 {
-   byte[] transform(DomainClassLoader loader,
+   /**
+    * The implementation of this method may transform the supplied class file and 
+    * return a new replacement class file.
+    *
+    * @param loader - the DomainClassLoader owning the defining loader of the
+    *    class to be transformed, may be <code>null</code> if the bootstrap loader
+    * @param className - the name of the class in the internal form of fully
+    *    qualified class and interface names.
+    * @param classBeingRedefined - if this is a redefine, the class being redefined, 
+    *    otherwise <code>null</code>
+    * @param protectionDomain  - the protection domain of the class being defined or redefined
+    * @param classfileBuffer - the input byte buffer in class file format - must not be modified
+    *
+    * @throws IllegalClassFormatException if the input does not represent a well-formed class file
+    * @return  a well-formed class file buffer (the result of the transform), 
+               or <code>null</code> if no transform is performed.
+    * @see Instrumentation#redefineClasses
+    */
+   public byte[] transform(DomainClassLoader loader,
          String className,
          Class<?> classBeingRedefined,
          ProtectionDomain protectionDomain,
          byte[] classfileBuffer)
          throws IllegalClassFormatException;
+
+   /** Called to indicate that the ClassLoader is being discarded by the server.
+   *
+   * @param loader - a class loader that has possibly been used previously
+   *    as an argument to transform.
+   */
+   public void unregisterClassLoader(DomainClassLoader loader);
 }




More information about the jboss-cvs-commits mailing list