Search in sources :

Example 1 with BurlapInput

use of com.caucho.burlap.io.BurlapInput in project LinkAgent by shulieTech.

the class BurlapServletServiceInterceptor method getMethodArgs.

public Object[] getMethodArgs(InputStream is, BurlapSkeleton burlapSkeleton) {
    try {
        BurlapInput in = new BurlapInput(is);
        HessianInputFactory.HeaderType header = _inputFactory.readHeader(is);
        while ((in.readHeader()) != null) {
            in.readObject();
        }
        String methodName = in.readMethod();
        int argLength = in.readMethodArgLength();
        Method method = null;
        try {
            Map map = Reflect.on(burlapSkeleton).get(HessianConstants.DYNAMIC_FIELD_METHOD_MAP);
            method = (Method) map.get(methodName + "__" + argLength);
        } catch (ReflectException e) {
        }
        if (method != null) {
        } else if ("_hessian_getAttribute".equals(methodName)) {
            String attrName = in.readString();
            in.completeCall();
        } else if (method == null) {
        }
        Class<?>[] args = method.getParameterTypes();
        if (argLength != args.length && argLength >= 0) {
            return null;
        }
        Object[] values = new Object[args.length];
        for (int i = 0; i < args.length; i++) {
            values[i] = in.readObject(args[i]);
        }
        in.completeCall();
        return new Object[] { methodName, args };
    } catch (IOException e) {
        return EMPTY_ARGS;
    }
}
Also used : Method(java.lang.reflect.Method) IOException(java.io.IOException) ReflectException(com.shulie.instrument.simulator.api.reflect.ReflectException) BurlapInput(com.caucho.burlap.io.BurlapInput) HessianInputFactory(com.caucho.hessian.io.HessianInputFactory) Map(java.util.Map)

Aggregations

BurlapInput (com.caucho.burlap.io.BurlapInput)1 HessianInputFactory (com.caucho.hessian.io.HessianInputFactory)1 ReflectException (com.shulie.instrument.simulator.api.reflect.ReflectException)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 Map (java.util.Map)1