All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Alachisoft.NCache.Common.RPCFramework.DotNetRPC.TargetMethod Maven / Gradle / Ivy

package Alachisoft.NCache.Common.RPCFramework.DotNetRPC;

import Alachisoft.NCache.Common.RPCFramework.ITargetMethod;

import java.lang.reflect.InvocationTargetException;

public class TargetMethod implements ITargetMethod {
    private java.lang.reflect.Method _method;
    private String _specifiedMethodName;
    private int _overlaod;
    private Object _target;

    public TargetMethod(Object targetObject, java.lang.reflect.Method methodInfo, String methodName, int overload) {
        _target = targetObject;
        _method = methodInfo;
        _specifiedMethodName = methodName;
        _overlaod = overload;
    }

    public final String GetMethodName() {
        return _specifiedMethodName;
    }

    public final int GetOverlaod() {
        return _overlaod;
    }

    public final Object GetMethodReflectionInfo() {
        return _method;
    }

    public final int GetNumberOfArguments() {
        return _method.getParameterTypes().length;
    }

    @Override
    public final Object Invoke(Object[] arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        Object val = null;
        val = _method.invoke(_target, arguments);

        return val;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy