org.coodex.concrete.dubbo.DubboHelper Maven / Gradle / Ivy
/*
* Copyright (c) 2018 coodex.org ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.coodex.concrete.dubbo;
import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
import javassist.bytecode.*;
import javassist.bytecode.annotation.Annotation;
import javassist.bytecode.annotation.ClassMemberValue;
import org.coodex.concrete.common.bytecode.javassist.JavassistHelper;
import org.coodex.util.Common;
import org.coodex.util.GenericType;
import org.coodex.util.SingletonMap;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.alibaba.dubbo.common.bytecode.ClassGenerator.getClassPool;
public class DubboHelper {
public static final SingletonMap applications =
new SingletonMap(
new SingletonMap.Builder() {
@Override
public ApplicationConfig build(String key) {
return new ApplicationConfig(key);
}
}
);
public static final String SUBJOIN = "subjoin";
public static final String AGENT = "user-agent";
public static final String LOCATE = "locate";
public static final String RESULT = "result";
private static SignatureAttribute.Type returnType = JavassistHelper.classType(
new GenericType