001 package org.shiftone.jrat.inject.bytecode.asm; 002 003 004 import org.objectweb.asm.Type; 005 import org.objectweb.asm.commons.Method; 006 import org.shiftone.jrat.inject.bytecode.InjectorStrategy; 007 008 009 /** 010 * @author jeff@shiftone.org (Jeff Drost) 011 */ 012 public interface Constants { 013 014 public static String initializeName = "$clinit" + InjectorStrategy.METHOD_POSTFIX; 015 public static Method initialize = Method.getMethod("void " + initializeName + "()"); 016 public static String classInitName = "<clinit>"; 017 public static String classInitDesc = "()V"; 018 public static Method classInit = Method.getMethod("void " + classInitName + "()"); 019 020 public interface Throwable { 021 public static Class CLASS = java.lang.Throwable.class; 022 public static Type TYPE = Type.getType(CLASS); 023 } 024 025 public interface Clock { 026 027 public static Class CLASS = org.shiftone.jrat.util.time.Clock.class; 028 public static Type TYPE = Type.getType(CLASS); 029 public static Method currentTimeNanos = Method.getMethod("long currentTimeMillis()"); 030 } 031 032 // public interface System { 033 // 034 // public static Class CLASS = java.lang.System.class; 035 // public static Type TYPE = Type.getType(CLASS); 036 // public static Method currentTimeMillis = Method.getMethod("long currentTimeMillis()"); 037 // } 038 039 public interface HandlerFactory { 040 041 public static Class CLASS = org.shiftone.jrat.core.HandlerFactory.class; 042 public static Type TYPE = Type.getType(CLASS); 043 public static Method getMethodHandler = 044 Method.getMethod(org.shiftone.jrat.core.spi.MethodHandler.class.getName() 045 + " getMethodHandler(String, String, String)"); 046 } 047 048 public interface MethodHandler { 049 050 public static Class CLASS = org.shiftone.jrat.core.spi.MethodHandler.class; 051 public static Type TYPE = Type.getType(CLASS); 052 public static Method onMethodStart = Method.getMethod("void onMethodStart(Object)"); 053 public static Method onMethodFinish = Method.getMethod("void onMethodFinish(Object, long, Throwable)"); 054 } 055 }