Intercept all methods calls.

@param obj     The enhanced CGLIB instance
@param method  Intercepted method
@param args    Method arguments
@param proxy   This method proxy
511175
@Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        if (method.getName().equals("annotationType")) {
            return annotationType;
        } else if (method.getName().equals("toString")) { 
            return toString();
        } else if (method.getName().equals("equals")) {
           return annotationEquals(args[0]);
        } else if (method.getName().equals("hashCode")) { 
            return proxy.hashCode();
        } else {
            return attributeData.get(method.getName());
        }
       
    }
1046709
public static Object invokeMethod(Object obj, Method method, Object... params) {
        try {
            method.setAccessible(true);
            return method.invoke(obj, params);
        }
        catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException ex) {
            throw new RuntimeException(ex);
        }
    }
1321585
@Override
	public Object invokeMethod(Object... args) {
		Assert.state(this.parameterTypes.length == args.length,
				"Wrong number of arguments, expected no more than: ["
						+ this.parameterTypes.length + "]");

		try {
			// Extract the target from an Advised as late as possible
			// in case it contains a lazy initialization
			Object target = extractTarget(this.object, this.method);
			return method.invoke(target, args);
		}
		catch (Exception e) {
			throw new IllegalArgumentException("Unable to invoke method: [" + this.method
					+ "] on object: [" + this.object + "] with arguments: ["
					+ Arrays.toString(args) + "]", e);
		}
	}
669005
public void call(String method, Object[] args)
        throws IOException
    {
        int length = args != null ? args.length : 0;

        startCall(method, length);

        for (int i = 0; i < length; i++)
            writeObject(args[i]);

        completeCall();
    }

    /**
     * Starts the method call.  Clients would use <code>startCall</code>
     * instead of <code>call</code> if they wanted finer control over
     * writing the arguments, or needed to write headers.
     *
     * <code><pre>
     * c major minor
     * m b16 b8 method-name
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void startCall(String method, int length)
        throws IOException
    {
        os.write('c');
        os.write(_version);
        os.write(0);

        os.write('m');
        int len = method.length();
        os.write(len >> 8);
        os.write(len);
        printString(method, 0, len);
    }

    /**
     * Writes the call tag.  This would be followed by the
     * headers and the method tag.
     *
     * <code><pre>
     * c major minor
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void startCall()
        throws IOException
    {
        os.write('c');
        os.write(0);
        os.write(1);
    }

    /**
     * Writes the method tag.
     *
     * <code><pre>
     * m b16 b8 method-name
     * </pre></code>
     *
     * @param method the method name to call.
     */
    public void writeMethod(String method)
        throws IOException
    {
        os.write('m');
        int len = method.length();
        os.write(len >> 8);
        os.write(len);
        printString(method, 0, len);
    }

    /**
     * Completes.
     *
     * <code><pre>
     * z
     * </pre></code>
     */
    public void completeCall()
        throws IOException
    {
        os.write('z');
    }

    /**
     * Starts the reply
     *
     * <p>A successful completion will have a single value:
     *
     * <pre>
     * r
     * </pre>
     */
    public void startReply()
        throws IOException
    {
        os.write('r');
        os.write(1);
        os.write(0);
    }

    /**
     * Completes reading the reply
     *
     * <p>A successful completion will have a single value:
     *
     * <pre>
     * z
     * </pre>
     */
    public void completeReply()
        throws IOException
    {
        os.write('z');
    }

    /**
     * Writes a header name.  The header value must immediately follow.
     *
     * <code><pre>
     * H b16 b8 foo <em>value</em>
     * </pre></code>
     */
    public void writeHeader(String name)
        throws IOException
    {
        int len = name.length();

        os.write('H');
        os.write(len >> 8);
        os.write(len);

        printString(name);
    }

    /**
     * Writes a fault.  The fault will be written
     * as a descriptive string followed by an object:
     *
     * <code><pre>
     * f
     * &lt;string>code
     * &lt;string>the fault code
     *
     * &lt;string>message
     * &lt;string>the fault mesage
     *
     * &lt;string>detail
     * mt\x00\xnnjavax.ejb.FinderException
     *     ...
     * z
     * z
     * </pre></code>
     *
     * @param code the fault code, a three digit
     */
    public void writeFault(String code, String message, Object detail)
        throws IOException
    {
        // hessian/3525
        os.write('r');
        os.write(1);
        os.write(0);

        os.write('f');
        writeString("code");
        writeString(code);

        writeString("message");
        writeString(message);

        if (detail != null) {
            writeString("detail");
            writeObject(detail);
        }
        os.write('z');

        os.write('z');
    }
648309
@RuntimeType
    public Object interceptInterface(@AllArguments Object[] params,
                                     @Origin Method method) throws Throwable {
        if (ProxyParent.canInvoke(method)) {
            return Interception.invokeWrap(interception, null, method, null, params,
                () -> ProxyParent.invoke(method, proxyParent));
        } else {
            return Interception.invokeWrap(interception, null, method, null, params, null);
        }
    }
112807
protected void addSpecialMethods(ClassFile proxyClassType, ClassMethod staticConstructor) {
        try {
            // Add special methods for interceptors
            for (Method method : LifecycleMixin.class.getMethods()) {
                BeanLogger.LOG.addingMethodToProxy(method);
                MethodInformation methodInfo = new RuntimeMethodInformation(method);
                createInterceptorBody(proxyClassType.addMethod(method), methodInfo, false, staticConstructor);
            }
            Method getInstanceMethod = TargetInstanceProxy.class.getMethod("weld_getTargetInstance");
            Method getInstanceClassMethod = TargetInstanceProxy.class.getMethod("weld_getTargetClass");
            generateGetTargetInstanceBody(proxyClassType.addMethod(getInstanceMethod));
            generateGetTargetClassBody(proxyClassType.addMethod(getInstanceClassMethod));

            Method setMethodHandlerMethod = ProxyObject.class.getMethod("weld_setHandler", MethodHandler.class);
            generateSetMethodHandlerBody(proxyClassType.addMethod(setMethodHandlerMethod));

            Method getMethodHandlerMethod = ProxyObject.class.getMethod("weld_getHandler");
            generateGetMethodHandlerBody(proxyClassType.addMethod(getMethodHandlerMethod));
       } catch (Exception e) {
            throw new WeldException(e);
        }
    }
1166578
public JsonNode callMethod(final JsiiObjectRef objRef, final String method, final ArrayNode args) {
        ObjectNode req = makeRequest("invoke", objRef);
        req.put("method", method);
        req.set("args", args);

        JsonNode resp = this.runtime.requestResponse(req);
        return resp.get("result");
    }
1242724
public static MethodInvokeProxy proxyByName(Object target,String methodName,Object ...args)
	{
		Method m=findMethodByName(target, methodName);
		if(m!=null)
		{
			return new MethodInvokeProxy(target, m, args);
		}
		return null;
	}
505901
public Object invoke(Object proxy, Method method, Object[] args)
        throws Throwable
    {
        String mangleName;

        synchronized (_mangleMap) {
            mangleName = _mangleMap.get(method);
        }

        if (mangleName == null) {
            String methodName = method.getName();
            Class<?>[] params = method.getParameterTypes();

            // equals and hashCode are special cased
            if (methodName.equals("equals")
                && params.length == 1 && params[0].equals(Object.class)) {
                Object value = args[0];
                if (value == null || !Proxy.isProxyClass(value.getClass()))
                    return Boolean.FALSE;

                Object proxyHandler = Proxy.getInvocationHandler(value);

                if (!(proxyHandler instanceof HessianProxy))
                    return Boolean.FALSE;

                HessianProxy handler = (HessianProxy) proxyHandler;

                return new Boolean(_url.equals(handler.getURL()));
            }
            else if (methodName.equals("hashCode") && params.length == 0)
                return new Integer(_url.hashCode());
            else if (methodName.equals("getHessianType"))
                return proxy.getClass().getInterfaces()[0].getName();
            else if (methodName.equals("getHessianURL"))
                return _url.toString();
            else if (methodName.equals("toString") && params.length == 0)
                return "HessianProxy[" + _url + "]";

            if (!_factory.isOverloadEnabled())
                mangleName = method.getName();
            else
                mangleName = mangleName(method);

            synchronized (_mangleMap) {
                _mangleMap.put(method, mangleName);
            }
        }

        InputStream is = null;
        HessianConnection conn = null;

        try {
            if (log.isLoggable(Level.FINER))
                log.finer("Hessian[" + _url + "] calling " + mangleName);

            conn = sendRequest(mangleName, args);

            is = getInputStream(conn);

            if (log.isLoggable(Level.FINEST)) {
                PrintWriter dbg = new PrintWriter(new LogWriter(log));
                HessianDebugInputStream dIs = new HessianDebugInputStream(is, dbg);

                dIs.startTop2();

                is = dIs;
            }

            AbstractHessianInput in;

            int code = is.read();

            if (code == 'H') {
                int major = is.read();
                int minor = is.read();

                in = _factory.getHessian2Input(is);

                Object value = in.readReply(method.getReturnType());

                return value;
            }
            else if (code == 'r') {
                int major = is.read();
                int minor = is.read();

                in = _factory.getHessianInput(is);

                in.startReplyBody();

                Object value = in.readObject(method.getReturnType());

                if (value instanceof InputStream) {
                    value = new ResultInputStream(conn, is, in, (InputStream) value);
                    is = null;
                    conn = null;
                }
                else
                    in.completeReply();

                return value;
            }
            else
                throw new HessianProtocolException("'" + (char) code + "' is an unknown code");
        } catch (HessianProtocolException e) {
            throw new HessianRuntimeException(e);
        } finally {
            try {
                if (is != null)
                    is.close();
            } catch (Exception e) {
                log.log(Level.FINE, e.toString(), e);
            }

            try {
                if (conn != null)
                    conn.destroy();
            } catch (Exception e) {
                log.log(Level.FINE, e.toString(), e);
            }
        }
    }
405970
@Override
  public Object invoke(Object[] argv) throws Throwable {
    if (handle == null) {
      throw new IllegalStateException(
          "Default method handler invoked before proxy has been bound.");
    }
    return handle.invokeWithArguments(argv);
  }
720158
public Object invoke(Object p_proxy, Method m, Object[] args) throws Throwable {
		Debug.logVerbose("<################################>Action: JdonFramework core entrance", module);
		Debug.logVerbose("[JdonFramework]<################>execute method=" + m.getDeclaringClass().getName() + "." + m.getName(), module);
		Object result = null;
		try {
			result = aopClient.invoke(targetMetaRequest, m, args);
			Debug.logVerbose("[JdonFramework]<################>finish executing method=" + m.getDeclaringClass().getName() + "." + m.getName()
					+ " successfully!", module);
			Debug.logVerbose("<################################><end:", module);
		} catch (Exception ex) {
			Debug.logError(ex, module);
		} catch (Throwable ex) {
			throw new Throwable(ex);
		}

		return result;

	}
1214557
public Object invoke(Object proxy, Method method, Object[] args)
        throws Throwable
    {
        String methodName = method.getName();
        Class[] params = method.getParameterTypes();

        // equals and hashCode are special cased
        if (methodName.equals("equals") &&
            params.length == 1 && params[0].equals(Object.class)) {
            Object value = args[0];
            if (value == null || !Proxy.isProxyClass(value.getClass()))
                return new Boolean(false);

            BurlapProxy handler = (BurlapProxy) Proxy.getInvocationHandler(value);

            return new Boolean(_url.equals(handler.getURL()));
        }
        else if (methodName.equals("hashCode") && params.length == 0)
            return new Integer(_url.hashCode());
        else if (methodName.equals("getBurlapType"))
            return proxy.getClass().getInterfaces()[0].getName();
        else if (methodName.equals("getBurlapURL"))
            return _url.toString();
        else if (methodName.equals("toString") && params.length == 0)
            return getClass().getSimpleName() + "[" + _url + "]";

        InputStream is = null;

        URLConnection conn = null;
        HttpURLConnection httpConn = null;
        try {
            conn = _factory.openConnection(_url);

            httpConn = (HttpURLConnection) conn;

            httpConn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "text/xml");

            OutputStream os;

            try {
                os = conn.getOutputStream();
            } catch (Exception e) {
                throw new BurlapRuntimeException(e);
            }

            BurlapOutput out = _factory.getBurlapOutput(os);

            if (!_factory.isOverloadEnabled()) {
            }
            else if (args != null)
                methodName = methodName + "__" + args.length;
            else
                methodName = methodName + "__0";

            if (log.isLoggable(Level.FINE))
                log.fine(this + " calling " + methodName + " (" + method + ")");

            out.call(methodName, args);

            try {
                os.flush();
            } catch (Exception e) {
                throw new BurlapRuntimeException(e);
            }

            if (conn instanceof HttpURLConnection) {
                httpConn = (HttpURLConnection) conn;
                int code = 500;

                try {
                    code = httpConn.getResponseCode();
                } catch (Exception e) {
                }

                if (code != 200) {
                    StringBuffer sb = new StringBuffer();
                    int ch;

                    try {
                        is = httpConn.getInputStream();

                        if (is != null) {
                            while ((ch = is.read()) >= 0)
                                sb.append((char) ch);

                            is.close();
                        }

                        is = httpConn.getErrorStream();
                        if (is != null) {
                            while ((ch = is.read()) >= 0)
                                sb.append((char) ch);
                        }
                    } catch (FileNotFoundException e) {
                        throw new BurlapRuntimeException(code + ": " + String.valueOf(e));
                    } catch (IOException e) {
                    }

                    if (is != null)
                        is.close();

                    throw new BurlapProtocolException(code + ": " + sb.toString());
                }
            }

            is = conn.getInputStream();

            AbstractBurlapInput in = _factory.getBurlapInput(is);

            return in.readReply(method.getReturnType());
        } catch (BurlapProtocolException e) {
            throw new BurlapRuntimeException(e);
        } finally {
            try {
                if (is != null)
                    is.close();
            } catch (IOException e) {
            }

            if (httpConn != null)
                httpConn.disconnect();
        }
    }
894240
public static <T> Object callMethod(Object obj,
                                        Class<T> c,
                                        String name,
                                        Class<?>[] classes,
                                        Object[] args) {
        try {
            Method m = getMethod(c, name, classes);
            return m.invoke(obj, args);
        } catch(InvocationTargetException e) {
            throw getCause(e);
        } catch(IllegalAccessException e) {
            throw new IllegalStateException(e);
        }
    }
251570
private void createProxyJsMethod(Builder componentExposedTypeBuilder,
      ExecutableElement originalMethod, String proxyMethodName) {
    Emit emitAnnotation = originalMethod.getAnnotation(Emit.class);

    MethodSpec.Builder proxyMethodBuilder = MethodSpec
        .methodBuilder(proxyMethodName)
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(JsMethod.class)
        .addAnnotation(getUnusableByJSAnnotation())
        .returns(ClassName.get(originalMethod.getReturnType()));

    originalMethod
        .getParameters()
        .forEach(parameter -> proxyMethodBuilder.addParameter(TypeName.get(parameter.asType()),
            parameter.getSimpleName().toString()));

    String methodCallParameters = getSuperMethodCallParameters(originalMethod);
    boolean hasReturnValue = !"void".equals(originalMethod.getReturnType().toString());
    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("$T result = super.$L($L)",
          originalMethod.getReturnType(),
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    } else {
      proxyMethodBuilder.addStatement("super.$L($L)",
          originalMethod.getSimpleName().toString(),
          methodCallParameters);
    }

    if (emitAnnotation != null) {
      addEmitEventCall(originalMethod, proxyMethodBuilder, methodCallParameters);
    }

    if (hasReturnValue) {
      proxyMethodBuilder.addStatement("return result");
    }

    componentExposedTypeBuilder.addMethod(proxyMethodBuilder.build());
  }
400500
public void call(String method, Object[] args)
        throws IOException
    {
        int length = args != null ? args.length : 0;

        startCall(method, length);

        for (int i = 0; i < length; i++)
            writeObject(args[i]);

        completeCall();
    }

    /**
     * Starts the method call:
     *
     * <code><pre>
     * C
     * </pre></code>
     *
     * @param method the method name to call.
     */
    abstract public void startCall()
        throws IOException;

    /**
     * Starts the method call:
     *
     * <code><pre>
     * C string int
     * </pre></code>
     *
     * @param method the method name to call.
     */
    abstract public void startCall(String method, int length)
        throws IOException;

    /**
     * For Hessian 2.0, use the Header envelope instead
     *
     * @deprecated
     */
    public void writeHeader(String name)
        throws IOException
    {
        throw new UnsupportedOperationException(getClass().getSimpleName());
    }

    /**
     * Writes the method tag.
     *
     * <code><pre>
     * string
     * </pre></code>
     *
     * @param method the method name to call.
     */
    abstract public void writeMethod(String method)
        throws IOException;

    /**
     * Completes the method call:
     *
     * <code><pre>
     * </pre></code>
     */
    abstract public void completeCall()
        throws IOException;

    /**
     * Writes a boolean value to the stream.  The boolean will be written
     * with the following syntax:
     *
     * <code><pre>
     * T
     * F
     * </pre></code>
     *
     * @param value the boolean value to write.
     */
    abstract public void writeBoolean(boolean value)
        throws IOException;

    /**
     * Writes an integer value to the stream.  The integer will be written
     * with the following syntax:
     *
     * <code><pre>
     * I b32 b24 b16 b8
     * </pre></code>
     *
     * @param value the integer value to write.
     */
    abstract public void writeInt(int value)
        throws IOException;

    /**
     * Writes a long value to the stream.  The long will be written
     * with the following syntax:
     *
     * <code><pre>
     * L b64 b56 b48 b40 b32 b24 b16 b8
     * </pre></code>
     *
     * @param value the long value to write.
     */
    abstract public void writeLong(long value)
        throws IOException;

    /**
     * Writes a double value to the stream.  The double will be written
     * with the following syntax:
     *
     * <code><pre>
     * D b64 b56 b48 b40 b32 b24 b16 b8
     * </pre></code>
     *
     * @param value the double value to write.
     */
    abstract public void writeDouble(double value)
        throws IOException;

    /**
     * Writes a date to the stream.
     *
     * <code><pre>
     * T  b64 b56 b48 b40 b32 b24 b16 b8
     * </pre></code>
     *
     * @param time the date in milliseconds from the epoch in UTC
     */
    abstract public void writeUTCDate(long time)
        throws IOException;

    /**
     * Writes a null value to the stream.
     * The null will be written with the following syntax
     *
     * <code><pre>
     * N
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeNull()
        throws IOException;

    /**
     * Writes a string value to the stream using UTF-8 encoding.
     * The string will be written with the following syntax:
     *
     * <code><pre>
     * S b16 b8 string-value
     * </pre></code>
     *
     * If the value is null, it will be written as
     *
     * <code><pre>
     * N
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeString(String value)
        throws IOException;

    /**
     * Writes a string value to the stream using UTF-8 encoding.
     * The string will be written with the following syntax:
     *
     * <code><pre>
     * S b16 b8 string-value
     * </pre></code>
     *
     * If the value is null, it will be written as
     *
     * <code><pre>
     * N
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeString(char[] buffer, int offset, int length)
        throws IOException;

    /**
     * Writes a byte array to the stream.
     * The array will be written with the following syntax:
     *
     * <code><pre>
     * B b16 b18 bytes
     * </pre></code>
     *
     * If the value is null, it will be written as
     *
     * <code><pre>
     * N
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeBytes(byte[] buffer)
        throws IOException;

    /**
     * Writes a byte array to the stream.
     * The array will be written with the following syntax:
     *
     * <code><pre>
     * B b16 b18 bytes
     * </pre></code>
     *
     * If the value is null, it will be written as
     *
     * <code><pre>
     * N
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeBytes(byte[] buffer, int offset, int length)
        throws IOException;

    /**
     * Writes a byte buffer to the stream.
     */
    abstract public void writeByteBufferStart()
        throws IOException;

    /**
     * Writes a byte buffer to the stream.
     *
     * <code><pre>
     * b b16 b18 bytes
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeByteBufferPart(byte[] buffer,
                                             int offset,
                                             int length)
        throws IOException;

    /**
     * Writes the last chunk of a byte buffer to the stream.
     *
     * <code><pre>
     * b b16 b18 bytes
     * </pre></code>
     *
     * @param value the string value to write.
     */
    abstract public void writeByteBufferEnd(byte[] buffer,
                                            int offset,
                                            int length)
        throws IOException;

    /**
     * Writes a full output stream.
     */
    public void writeByteStream(InputStream is)
        throws IOException
    {
        writeByteBufferStart();

        if (_byteBuffer == null)
            _byteBuffer = new byte[1024];

        byte[] buffer = _byteBuffer;

        int len;
        while ((len = is.read(buffer, 0, buffer.length)) > 0) {
            if (len < buffer.length) {
                int len2 = is.read(buffer, len, buffer.length - len);

                if (len2 < 0) {
                    writeByteBufferEnd(buffer, 0, len);
                    return;
                }

                len += len2;
            }

            writeByteBufferPart(buffer, 0, len);
        }

        writeByteBufferEnd(buffer, 0, 0);
    }

    /**
     * Writes a reference.
     *
     * <code><pre>
     * Q int
     * </pre></code>
     *
     * @param value the integer value to write.
     */
    abstract protected void writeRef(int value)
        throws IOException;

    /**
     * Removes a reference.
     */
    public boolean removeRef(Object obj)
        throws IOException
    {
        return false;
    }

    /**
     * Replaces a reference from one object to another.
     */
    abstract public boolean replaceRef(Object oldRef, Object newRef)
        throws IOException;

    /**
     * Adds an object to the reference list.  If the object already exists,
     * writes the reference, otherwise, the caller is responsible for
     * the serialization.
     *
     * <code><pre>
     * R b32 b24 b16 b8
     * </pre></code>
     *
     * @param object the object to add as a reference.
     *
     * @return true if the object has already been written.
     */
    abstract public boolean addRef(Object object)
        throws IOException;

    /**
     * @param obj
     * @return
     */
    abstract public int getRef(Object obj);

    /**
     * Resets the references for streaming.
     */
    public void resetReferences()
    {
    }

    /**
     * Writes a generic object to the output stream.
     */
    abstract public void writeObject(Object object)
        throws IOException;

    /**
     * Writes the list header to the stream.  List writers will call
     * <code>writeListBegin</code> followed by the list contents and then
     * call <code>writeListEnd</code>.
     *
     * <code><pre>
     * V
     *   x13 java.util.ArrayList   # type
     *   x93                       # length=3
     *   x91                       # 1
     *   x92                       # 2
     *   x93                       # 3
     * &lt;/list>
     * </pre></code>
     */
    abstract public boolean writeListBegin(int length, String type)
        throws IOException;

    /**
     * Writes the tail of the list to the stream.
     */
    abstract public void writeListEnd()
        throws IOException;

    /**
     * Writes the map header to the stream.  Map writers will call
     * <code>writeMapBegin</code> followed by the map contents and then
     * call <code>writeMapEnd</code>.
     *
     * <code><pre>
     * M type (<key> <value>)* Z
     * </pre></code>
     */
    abstract public void writeMapBegin(String type)
        throws IOException;

    /**
     * Writes the tail of the map to the stream.
     */
    abstract public void writeMapEnd()
        throws IOException;

    /**
     * Writes the object header to the stream (for Hessian 2.0), or a
     * Map for Hessian 1.0.  Object writers will call
     * <code>writeObjectBegin</code> followed by the map contents and then
     * call <code>writeObjectEnd</code>.
     *
     * <code><pre>
     * C type int <key>*
     * C int <value>*
     * </pre></code>
     *
     * @return true if the object has already been defined.
     */
    public int writeObjectBegin(String type)
        throws IOException
    {
        writeMapBegin(type);

        return -2;
    }

    /**
     * Writes the end of the class.
     */
    public void writeClassFieldLength(int len)
        throws IOException
    {
    }

    /**
     * Writes the tail of the object to the stream.
     */
    public void writeObjectEnd()
        throws IOException
    {
    }

    public void writeReply(Object o)
        throws IOException
    {
        startReply();
        writeObject(o);
        completeReply();
    }

    public void startReply()
        throws IOException
    {
    }

    public void completeReply()
        throws IOException
    {
    }

    public void writeFault(String code, String message, Object detail)
        throws IOException
    {
    }

    public void flush()
        throws IOException
    {
    }

    public void close()
        throws IOException
    {
    }
}
300263
public static void scanner(Class<?> implementObjectClass, Class<?>... proxyClass) {

        if (AopCache.isScannedClass(implementObjectClass)) {
            return;
        }
        Method[] methods = ReflectUtil.getAllMethod(implementObjectClass);

        if (methods != null) {

            AopConfig config = null;
            Before before = null;
            After after = null;
            Class<?>[] argsType;

            for (Method method : methods) {

                config = new AopConfig();
                argsType = method.getParameterTypes();

                if (argsType != null && argsType.length > 0) {
                    for (Class<?> clazz : argsType) {
                        config.setArgs(clazz.getName());
                    }
                }

                before = method.getAnnotation(Before.class);
                after = method.getAnnotation(After.class);

                config.setMethodName(method.getName());
                if (proxyClass != null && proxyClass.length > 0) {
                    config.setClassPath(proxyClass[0].getName());
                } else {
                    config.setClassPath(implementObjectClass.getName());
                }

                if (before == null && after == null) {
                    config.setUsedAop(false);
                } else {
                    config.setUsedAop(true);
                    if (before != null) {
                        config.setBefore(before);
                        try {
                            Object instance = AopCache.getCutPoint(before.cutClass());
                            if (instance != null) {
                                config.setBeforeInstance(instance);
                            } else {
                                instance = before.cutClass().newInstance();
                                config.setBeforeInstance(instance);
                                AopCache.putCutPoint(instance);
                            }
                        } catch (InstantiationException e) {
                            e.printStackTrace();
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        }
                    }
                    if (after != null) {
                        config.setAfter(after);
                        try {
                            Object instance = AopCache.getCutPoint(after.cutClass());
                            if (instance != null) {
                                config.setAfterInstance(instance);
                            } else {
                                instance = after.cutClass().newInstance();
                                config.setAfterInstance(instance);
                                AopCache.putCutPoint(instance);
                            }
                        } catch (InstantiationException e) {
                            e.printStackTrace();
                        } catch (IllegalAccessException e) {
                            e.printStackTrace();
                        }
                    }
                }

                AopCache.putAopConfig(config);
            }
        }
    }
1008173
public static synchronized InvocationHandler putMethodProxy(Method method, InvocationHandler invocationHandler) {
		return methodProxies.put(method, invocationHandler);
	}