Search in sources :

Example 11 with RpcBindingParam

use of com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam in project sofa-boot by alipay.

the class BoltBindingConverter method convert.

@Override
public RpcBinding convert(SofaService sofaServiceAnnotation, SofaServiceBinding sofaServiceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new BoltBindingParam();
    convertServiceAnnotation(bindingParam, sofaServiceAnnotation, sofaServiceBindingAnnotation, bindingConverterContext);
    return new BoltBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)

Example 12 with RpcBindingParam

use of com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam in project sofa-boot by alipay.

the class DubboBindingConverter method convert.

@Override
public RpcBinding convert(SofaService sofaServiceAnnotation, SofaServiceBinding sofaServiceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new DubboBindingParam();
    convertServiceAnnotation(bindingParam, sofaServiceAnnotation, sofaServiceBindingAnnotation, bindingConverterContext);
    return new DubboBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : DubboBindingParam(com.alipay.sofa.rpc.boot.runtime.param.DubboBindingParam) DubboBinding(com.alipay.sofa.rpc.boot.runtime.binding.DubboBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)

Example 13 with RpcBindingParam

use of com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam in project sofa-boot by alipay.

the class HttpBindingConverter method convert.

@Override
public RpcBinding convert(SofaReference sofaReferenceAnnotation, SofaReferenceBinding sofaReferenceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new HttpBindingParam();
    convertReferenceAnnotation(bindingParam, sofaReferenceBindingAnnotation, bindingConverterContext);
    return new HttpBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : HttpBindingParam(com.alipay.sofa.rpc.boot.runtime.param.HttpBindingParam) HttpBinding(com.alipay.sofa.rpc.boot.runtime.binding.HttpBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)

Example 14 with RpcBindingParam

use of com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam in project sofa-boot by alipay.

the class RestBindingConverter method convert.

@Override
public RpcBinding convert(SofaReference sofaReferenceAnnotation, SofaReferenceBinding sofaReferenceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new RestBindingParam();
    convertReferenceAnnotation(bindingParam, sofaReferenceBindingAnnotation, bindingConverterContext);
    return new RestBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : RestBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RestBindingParam) RestBinding(com.alipay.sofa.rpc.boot.runtime.binding.RestBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)

Example 15 with RpcBindingParam

use of com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam in project sofa-boot by alipay.

the class RpcBindingConverter method convert.

/**
 * convert xml Element to concrete {@link RpcBinding}
 *
 * @param element                 xml Element
 * @param bindingConverterContext binding converter context
 * @return RpcBinding Object
 */
@Override
public RpcBinding convert(Element element, BindingConverterContext bindingConverterContext) {
    RpcBindingParam param = createRpcBindingParam();
    // global-attrs,filter,method,route
    Element globalAttrsElement = DomUtils.getChildElementByTagName(element, RpcBindingXmlConstants.TAG_GLOBAL_ATTRS);
    Element routeElement = DomUtils.getChildElementByTagName(element, RpcBindingXmlConstants.TAG_ROUTE);
    List<Element> methodElements = DomUtils.getChildElementsByTagName(element, RpcBindingXmlConstants.TAG_METHOD);
    List<Element> parameterElements = DomUtils.getChildElementsByTagName(element, RpcBindingXmlConstants.TAG_PARAMETER);
    parseGlobalAttrs(globalAttrsElement, param, bindingConverterContext);
    parseFilter(globalAttrsElement, param, bindingConverterContext);
    parseMethod(methodElements, param);
    parseRoute(routeElement, param);
    parseParameter(parameterElements, param);
    return convert(param, bindingConverterContext);
}
Also used : Element(org.w3c.dom.Element) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)

Aggregations

RpcBindingParam (com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)34 BoltBinding (com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding)6 BoltBindingParam (com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)6 DubboBinding (com.alipay.sofa.rpc.boot.runtime.binding.DubboBinding)4 H2cBinding (com.alipay.sofa.rpc.boot.runtime.binding.H2cBinding)4 HttpBinding (com.alipay.sofa.rpc.boot.runtime.binding.HttpBinding)4 RestBinding (com.alipay.sofa.rpc.boot.runtime.binding.RestBinding)4 TripleBinding (com.alipay.sofa.rpc.boot.runtime.binding.TripleBinding)4 DubboBindingParam (com.alipay.sofa.rpc.boot.runtime.param.DubboBindingParam)4 H2cBindingParam (com.alipay.sofa.rpc.boot.runtime.param.H2cBindingParam)4 HttpBindingParam (com.alipay.sofa.rpc.boot.runtime.param.HttpBindingParam)4 RestBindingParam (com.alipay.sofa.rpc.boot.runtime.param.RestBindingParam)4 TripleBindingParam (com.alipay.sofa.rpc.boot.runtime.param.TripleBindingParam)4 ApplicationConfig (com.alipay.sofa.rpc.config.ApplicationConfig)4 MethodConfig (com.alipay.sofa.rpc.config.MethodConfig)4 RegistryConfig (com.alipay.sofa.rpc.config.RegistryConfig)4 Filter (com.alipay.sofa.rpc.filter.Filter)4 SofaBootRpcRuntimeException (com.alipay.sofa.rpc.boot.common.SofaBootRpcRuntimeException)2 RpcBinding (com.alipay.sofa.rpc.boot.runtime.binding.RpcBinding)2 ConsumerConfig (com.alipay.sofa.rpc.config.ConsumerConfig)2