use of com.alipay.sofa.rpc.boot.runtime.adapter.helper.ProviderConfigHelper in project sofa-boot by sofastack.
the class RpcBindingAdapter method preOutBinding.
/**
* pre out binding
*
* @param contract binding contract
* @param binding binding object
* @param target binding target
* @param sofaRuntimeContext sofa runtime context
*/
@Override
public void preOutBinding(Object contract, RpcBinding binding, Object target, SofaRuntimeContext sofaRuntimeContext) {
ApplicationContext applicationContext = sofaRuntimeContext.getSofaRuntimeManager().getRootApplicationContext();
ProviderConfigContainer providerConfigContainer = applicationContext.getBean(ProviderConfigContainer.class);
String uniqueName = providerConfigContainer.createUniqueName((Contract) contract, binding);
ProviderConfigHelper providerConfigHelper = applicationContext.getBean(ProviderConfigHelper.class);
ProviderConfig providerConfig = providerConfigHelper.getProviderConfig((Contract) contract, binding, target);
try {
providerConfigContainer.addProviderConfig(uniqueName, providerConfig);
} catch (Exception e) {
throw new ServiceRuntimeException(LogCodes.getLog(LogCodes.ERROR_PROXY_PUBLISH_FAIL), e);
}
}
use of com.alipay.sofa.rpc.boot.runtime.adapter.helper.ProviderConfigHelper in project sofa-boot by alipay.
the class RpcBindingAdapter method preOutBinding.
/**
* pre out binding
*
* @param contract binding contract
* @param binding binding object
* @param target binding target
* @param sofaRuntimeContext sofa runtime context
*/
@Override
public void preOutBinding(Object contract, RpcBinding binding, Object target, SofaRuntimeContext sofaRuntimeContext) {
ApplicationContext applicationContext = sofaRuntimeContext.getSofaRuntimeManager().getRootApplicationContext();
ProviderConfigContainer providerConfigContainer = applicationContext.getBean(ProviderConfigContainer.class);
String uniqueName = providerConfigContainer.createUniqueName((Contract) contract, binding);
ProviderConfigHelper providerConfigHelper = applicationContext.getBean(ProviderConfigHelper.class);
ProviderConfig providerConfig = providerConfigHelper.getProviderConfig((Contract) contract, binding, target);
try {
providerConfigContainer.addProviderConfig(uniqueName, providerConfig);
} catch (Exception e) {
throw new ServiceRuntimeException(LogCodes.getLog(LogCodes.ERROR_PROXY_PUBLISH_FAIL), e);
}
}
Aggregations