c.getfield(parseStateClass, "leftOver", "B"); c.dup(); final BranchEnd end = c.ifne();
c.getfield(parseStateClass, "stringBuilder", DescriptorUtils.makeDescriptor(StringBuilder.class)); c.astore(STATE_STRING_BUILDER_VAR); c.dup(); c.getfield(parseStateClass, "parseState", "I"); c.dup(); c.istore(CURRENT_STATE_VAR); c.getfield(parseStateClass, "pos", "I"); c.istore(STATE_POS_VAR); c.dup(); c.getfield(parseStateClass, "current", HTTP_STRING_DESCRIPTOR); c.astore(STATE_CURRENT_VAR); c.getfield(parseStateClass, "currentBytes", "[B"); c.astore(STATE_CURRENT_BYTES_VAR);
public void getfield(String className, String field, Class<?> fieldType) { getfield(className, field, DescriptorUtils.makeDescriptor(fieldType)); }
public void getfield(String className, String field, Class<?> fieldType) { getfield(className, field, DescriptorUtils.makeDescriptor(fieldType)); }
public void getfield(String className, String field, Class<?> fieldType) { getfield(className, field, DescriptorUtils.makeDescriptor(fieldType)); }
public void getfield(String className, String field, Class<?> fieldType) { getfield(className, field, DescriptorUtils.makeDescriptor(fieldType)); }
public void getfield(String className, String field, Class<?> fieldType) { getfield(className, field, DescriptorUtils.makeDescriptor(fieldType)); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
protected void getMethodHandlerField(ClassFile file, CodeAttribute b) { b.getfield(file.getName(), METHOD_HANDLER_FIELD_NAME, DescriptorUtils.makeDescriptor(getMethodHandlerType())); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
@Override protected void addSerializationSupport(ClassFile proxyClassType) { final Class<Exception>[] exceptions = new Class[]{ObjectStreamException.class}; final ClassMethod writeReplace = proxyClassType.addMethod(AccessFlag.PRIVATE, "writeReplace", LJAVA_LANG_OBJECT); writeReplace.addCheckedExceptions(exceptions); CodeAttribute b = writeReplace.getCodeAttribute(); b.newInstruction(SerializableClientProxy.class.getName()); b.dup(); b.aload(0); b.getfield(proxyClassType.getName(), BEAN_ID_FIELD, BeanIdentifier.class); b.aload(0); b.getfield(proxyClassType.getName(), CONTEXT_ID_FIELD, String.class); b.invokespecial(SerializableClientProxy.class.getName(), INIT_METHOD_NAME, "(" + LBEAN_IDENTIFIER + LJAVA_LANG_STRING + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR); b.returnInstruction(); }
/** * Adds the following code to a delegating method: * <p/> * <code> * if(!this.constructed) return super.thisMethod() * </code> * <p/> * This means that the proxy will not start to delegate to the underlying * bean instance until after the constructor has finished. */ protected void addConstructedGuardToMethodBody(final ClassMethod classMethod, String className) { if (!useConstructedFlag()) { return; } // now create the conditional final CodeAttribute cond = classMethod.getCodeAttribute(); cond.aload(0); cond.getfield(classMethod.getClassFile().getName(), CONSTRUCTED_FLAG_NAME, BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR); // jump if the proxy constructor has finished BranchEnd jumpMarker = cond.ifne(); // generate the invokespecial call to the super class method // this is run when the proxy is being constructed cond.aload(0); cond.loadMethodParameters(); cond.invokespecial(className, classMethod.getName(), classMethod.getDescriptor()); cond.returnInstruction(); cond.branchEnd(jumpMarker); }