1 8 package org.codehaus.aspectwerkz.extension.hotswap; 9 10 import org.codehaus.aspectwerkz.hook.impl.ClassPreProcessorHelper; 11 import org.codehaus.aspectwerkz.exception.WrappedRuntimeException; 12 13 19 public class HotSwapClient { 20 21 static { 22 System.loadLibrary("aspectwerkz"); 23 } 24 25 34 private static native int hotswap(String className, Class klazz, byte[] newBytes, int newLength); 35 36 42 public static void hotswap(final Class klazz, final byte[] newBytes) { 43 int code = hotswap(klazz.getName(), klazz, newBytes, newBytes.length); 44 if (code != 0) { 45 throw new RuntimeException ("HotSwap failed for " + klazz.getName() + ": " + code); 46 } 47 } 48 49 } | Popular Tags |