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

com.feilong.lib.ognl.security.UserMethod Maven / Gradle / Ivy

Go to download

feilong is a suite of core and expanded libraries that include utility classes, http, excel,cvs, io classes, and much much more.

There is a newer version: 4.0.8
Show newest version
package com.feilong.lib.ognl.security;

import java.lang.reflect.Method;
import java.security.PrivilegedExceptionAction;

/**
 * A signature for {@link OgnlSecurityManager#isAccessDenied(java.security.Permission)}. Also executes user methods with not any permission.
 *
 * @author Yasser Zamani
 * @since 3.1.24
 */
public class UserMethod implements PrivilegedExceptionAction{

    private final Object   target;

    private final Method   method;

    private final Object[] argsArray;

    public UserMethod(Object target, Method method, Object[] argsArray){
        this.target = target;
        this.method = method;
        this.argsArray = argsArray;
    }

    @Override
    public Object run() throws Exception{
        return method.invoke(target, argsArray);
    }
}