@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterface(interfaces, ExpirableEntry.class.getName().replace('.', '/')); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { NotClearable.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); } }
public ClassAdapter create(final ClassVisitor visitor, final ClassLoader loader) { try { String tcClassLocation = "jar:" + bundle.getLocation() + "!/" + ByteCodeUtil.classNameToFileName(tcClassNameDots); ClassReader tcCR = new ClassReader(new URL(tcClassLocation).openStream()); ClassNode tcCN = new ClassNode(); tcCR.accept(tcCN, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); AsmClassInfo.getClassInfo(jClassNameDots, loader); ClassVisitor cv = new SerialVersionUIDAdder(new MergeTCToJavaClassAdapter(visitor, (TransparencyClassAdapter) visitor, jClassNameDots, tcClassNameDots, tcCN, new HashMap())); return new CacheManagerAdapter(cv); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Call the renamed version of a method, using the same parameters and * return type as the original. * <p> * TODO: breaks when used with LocalVariablesSorter * @param owner the slash-and-dollar-delimited name of the type whose method is being called */ public static void callRenamedMethod(String owner, int access, String name, String desc, MethodVisitor mv) { ByteCodeUtil.prepareStackForMethodCall(access, desc, mv); int invokeOp = Modifier.isStatic(access) ? INVOKESTATIC : INVOKESPECIAL; mv.visitMethodInsn(invokeOp, owner, getWrappedName(name), desc); }
int opReturn = type.getOpcode(IRETURN); int lviCaughtException = ByteCodeUtil.getFirstLocalVariableOffset(access, desc); int lviReturn = lviCaughtException + 1;
public ClassAdapter create(final ClassVisitor visitor, final ClassLoader loader) { try { String tcClassLocation = "jar:" + bundle.getLocation() + "!/" + ByteCodeUtil.classNameToFileName(tcClassNameDots); ClassReader tcCR = new ClassReader(new URL(tcClassLocation).openStream()); ClassNode tcCN = new ClassNode(); tcCR.accept(tcCN, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); AsmClassInfo.getClassInfo(jClassNameDots, loader); ClassVisitor cv = new SerialVersionUIDAdder(new MergeTCToJavaClassAdapter(visitor, (TransparencyClassAdapter) visitor, jClassNameDots, tcClassNameDots, tcCN, new HashMap())); return new CacheManagerAdapter(cv); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Call the renamed version of a method, using the same parameters and * return type as the original. */ private void callRenamedMethod() { ByteCodeUtil.prepareStackForMethodCall(access, desc, mv); int invokeOp = Modifier.isStatic(access) ? INVOKESTATIC : INVOKESPECIAL; visitMethodInsn(invokeOp, ownerType, getWrappedName(name), desc); }
int opReturn = type.getOpcode(IRETURN); int lviCaughtException = ByteCodeUtil.getFirstLocalVariableOffset(access, desc); int lviReturn = lviCaughtException + 1;
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterface(interfaces, ExpirableEntry.class.getName().replace('.', '/')); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { NotClearable.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); } }
public ClassAdapter create(ClassVisitor visitor, ClassLoader loader) { try { String tcClassLocation = "jar:"+bundle.getLocation()+"!/" + ByteCodeUtil.classNameToFileName(tcClassNameDots);
@Override public void visit(final int version, final int access, final String name, final String signature, final String superName, String[] interfaces) { // Can't directly reference HibernateCacheInstanceRetriver.class here since it will fail to load interfaces = ByteCodeUtil.addInterface(interfaces, "org/terracotta/modules/hibernatecache/HibernateCacheInstanceRetriever"); super.visit(version, access, name, signature, superName, interfaces); this.owner = name; }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { TCMap.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterface(interfaces, ExpirableEntry.class.getName().replace('.', '/')); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { TCMap.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { String[] newInterfaces = ByteCodeUtil.addInterface(interfaces, Type.getInternalName(HibernateStatsBeanAware.class)); newInterfaces = ByteCodeUtil.addInterface(newInterfaces, Type.getInternalName(SampledStatistics.class)); super.visit(version, access, name, signature, superName, newInterfaces); this.owner = name; }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { NotClearable.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); } }
@Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { String[] newInterfaces = ByteCodeUtil.addInterface(interfaces, Type.getInternalName(SampledSecondLevelCacheStatistics.class)); super.visit(version, access, name, signature, superName, newInterfaces); this.owner = name; }
@Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { interfaces = ByteCodeUtil.addInterfaces(interfaces, new String[] { TCMap.class.getName().replace('.', '/') }); super.visit(version, access, name, signature, superName, interfaces); }
@Override public void visit(final int version, final int access, final String name, final String signature, final String superName, final String[] interfaces) { super.visit(version, access, name, signature, superName, ByteCodeUtil.addInterface(interfaces, Type.getInternalName(SessionFactoryNameAware.class))); this.owner = name; }