[jboss-cvs] JBoss Profiler SVN: r423 - branches/JBossProfiler2/src/main/org/jboss/profiler/agent.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 14 11:48:48 EST 2008


Author: jesper.pedersen
Date: 2008-02-14 11:48:47 -0500 (Thu, 14 Feb 2008)
New Revision: 423

Added:
   branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Transformer.java
Log:
Added Transformer interface

Added: branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Transformer.java
===================================================================
--- branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Transformer.java	                        (rev 0)
+++ branches/JBossProfiler2/src/main/org/jboss/profiler/agent/Transformer.java	2008-02-14 16:48:47 UTC (rev 423)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profiler.agent;
+
+import java.lang.instrument.ClassFileTransformer;
+import java.lang.instrument.IllegalClassFormatException;
+import java.io.BufferedInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.security.ProtectionDomain;
+
+/**
+ * The transformer interface
+ * @author Jesper Pedersen <jep at worldleaguesports.com>
+ */
+public interface Transformer extends ClassFileTransformer {
+
+  /**
+   * The transform method
+   * @param loader The class loader
+   * @param className The class name
+   * @param classBeingRedefined The class being redefined
+   * @param protectionDomain The protection domain
+   * @param classfileBuffer The class buffer
+   * @return The transformed class; null if no transformation have been done
+   * @exception IllegalClassFormatException If the class can't be transformed
+   */
+  public byte[] transform(ClassLoader loader, 
+                          String className, 
+                          Class<?> classBeingRedefined, 
+                          ProtectionDomain protectionDomain, 
+                          byte[] classfileBuffer) throws IllegalClassFormatException;
+
+  /**
+   * Load non instrumented class
+   * @param className The class name
+   * @param loader The class loader
+   * @return The bytes
+   * @exception IOException If an error occurs
+   */
+  public byte[] loadNonInstrumented(String className, ClassLoader loader) throws IOException;
+
+  /**
+   * Load instrumented class
+   * @param className The class name
+   * @param loader The class loader
+   * @return The bytes
+   * @exception IOException If an error occurs
+   */
+  public byte[] loadInstrumented(String className, ClassLoader loader) throws IOException;
+}




More information about the jboss-cvs-commits mailing list