Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*******************************************************************************
* Copyright (c) 2011-2014 Fernando Petrola
*
* This file is part of Dragome SDK.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
******************************************************************************/
package com.dragome.utils;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.dragome.commons.AbstractProxyRelatedInvocationHandler;
import com.dragome.commons.ContinueReflection;
public class DragomeCallsiteFactory
{
protected static class InvocationHandlerForLambdas extends AbstractProxyRelatedInvocationHandler
{
private final Class> class1;
private final String methodName;
private final Object[] parameters;
private Class> returnType;
private String invokeName;
private String callType;
protected InvocationHandlerForLambdas(Class> class1, String methodName, Object[] parameters, Class> returnTypeClass, String invokeName, String callType)
{
this.class1= class1;
this.methodName= methodName;
this.parameters= parameters;
this.returnType= returnTypeClass;
this.invokeName= invokeName;
this.callType= callType;
}
@ContinueReflection
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
setProxy(proxy);
try
{
// if (returnType.getMethod(method.getName(), method.getParameterTypes()) != null)
if (!method.getName().equals(invokeName))
return invokeDefaultMethod(proxy, method, args);
if ("".equals(methodName))
return class1.newInstance();
List