• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RegistryConfigBean类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.weibo.api.motan.config.springsupport.RegistryConfigBean的典型用法代码示例。如果您正苦于以下问题:Java RegistryConfigBean类的具体用法?Java RegistryConfigBean怎么用?Java RegistryConfigBean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RegistryConfigBean类属于com.weibo.api.motan.config.springsupport包,在下文中一共展示了RegistryConfigBean类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registryConfig

点赞 2

import com.weibo.api.motan.config.springsupport.RegistryConfigBean; //导入依赖的package包/类
@Bean(name = "registry")
public RegistryConfigBean registryConfig() {
    RegistryConfigBean config = new RegistryConfigBean();
    config.setRegProtocol("zookeeper");
    config.setAddress(environment.getProperty("spring.motan.zookeeper"));
    config.setConnectTimeout(200000);
    return config;
}
 

开发者ID:yu199195,
项目名称:myth,
代码行数:9,
代码来源:MotanServerConfiguration.java

示例2: registryConfig

点赞 2

import com.weibo.api.motan.config.springsupport.RegistryConfigBean; //导入依赖的package包/类
@Bean(name = "registry")
public RegistryConfigBean registryConfig() {
    RegistryConfigBean config = new RegistryConfigBean();
    config.setRegProtocol("zookeeper");
    config.setAddress(environment.getProperty("spring.motan.zookeeper"));
    config.setConnectTimeout(3000000);
    return config;
}
 

开发者ID:yu199195,
项目名称:myth,
代码行数:9,
代码来源:MotanServerConfiguration.java

示例3: registryConfig

点赞 2

import com.weibo.api.motan.config.springsupport.RegistryConfigBean; //导入依赖的package包/类
@Bean(name = "registry")
public RegistryConfigBean registryConfig() {
    RegistryConfigBean config = new RegistryConfigBean();
    config.setRegProtocol("zookeeper");
    config.setAddress(environment.getProperty("spring.motan.zookeeper"));
    config.setConnectTimeout(300000);
    return config;
}
 

开发者ID:yu199195,
项目名称:myth,
代码行数:9,
代码来源:MotanClientConfiguration.java

示例4: registryConfig

点赞 2

import com.weibo.api.motan.config.springsupport.RegistryConfigBean; //导入依赖的package包/类
@Bean
public RegistryConfigBean registryConfig() {
	RegistryConfigBean registry = new RegistryConfigBean();
	registry.setBeanName("registryConfig");
	registry.setAddress(registryAddress);
	registry.setRegProtocol(registryProtocol);
	registry.setConnectTimeout(registryConnectionTimeout);
	registry.setCheck("true");
	return registry;

}
 

开发者ID:swxiao,
项目名称:bubble2,
代码行数:12,
代码来源:BaseMotanConfiguration.java

示例5: baseServiceConfig

点赞 2

import com.weibo.api.motan.config.springsupport.RegistryConfigBean; //导入依赖的package包/类
/**
 * define BasicServiceConfigBean
 * 
 * 属性来自Motan的配置文档
 * @see https://github.com/weibocom/motan/blob/master/docs/wiki/zh_configuration.md
 * 
 * 挑了一些属性,不全,后续补全
 */
@Bean
@Conditional(BasicServiceConfigCondition.class)
   public BasicServiceConfigBean baseServiceConfig(BasicServiceConfigProperties basicServiceConfig, RegistryConfigBean registryConfigBean) {
       BasicServiceConfigBean config = new BasicServiceConfigBean();
       
       if (!StringUtils.isEmpty(basicServiceConfig.getExport())) {
       	config.setExport(basicServiceConfig.getExport());
       } else {
       	// 未设置export,使用ProtocolConfigBeanName : port暴露
       	if (StringUtils.isEmpty(basicServiceConfig.getExportPort())) {
           	throw new RuntimeException("need service export port...");
           }
       	config.setExport(PROTOCOL_CONFIG_BEAN_NAME + ":" + basicServiceConfig.getExportPort());
       }
       
       if (!StringUtils.isEmpty(basicServiceConfig.getExtConfigId())) {
        ExtConfig extConfig = new ExtConfig();
        extConfig.setId(basicServiceConfig.getExtConfigId());
        config.setExtConfig(extConfig);
       }
	if (!StringUtils.isEmpty(basicServiceConfig.getProxy())) {
		config.setProxy(basicServiceConfig.getProxy());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getGroup())) {
		config.setGroup(basicServiceConfig.getGroup());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getVersion())) {
		config.setVersion(basicServiceConfig.getVersion());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getThrowException())) {
		config.setThrowException(basicServiceConfig.getThrowException());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getApplication())) {
		config.setApplication(basicServiceConfig.getApplication());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getShareChannel())) {
		config.setShareChannel(basicServiceConfig.getShareChannel());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getRegistry())) {
		// 追加内部的注册配置bean
		config.setRegistry(REGISTRY_CONFIG_BEAN_NAME + "," + basicServiceConfig.getRegistry());
	} else {
		config.setRegistry(REGISTRY_CONFIG_BEAN_NAME);
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getAccessLog())) {
		config.setAccessLog(basicServiceConfig.getAccessLog());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getUsegz())) {
		config.setUsegz(basicServiceConfig.getUsegz());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getMingzSize())) {
		config.setMingzSize(basicServiceConfig.getMingzSize());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getCodec())) {
		config.setCodec(basicServiceConfig.getCodec());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getFilter())) {
		config.setFilter(basicServiceConfig.getFilter());
	}
	if (!StringUtils.isEmpty(basicServiceConfig.getModule())) {
		config.setModule(basicServiceConfig.getModule());
	}
	if (basicServiceConfig.getActives() != null) {
		config.setActives(basicServiceConfig.getActives());
	}
	if (basicServiceConfig.getRegister() != null) {
		config.setRegister(basicServiceConfig.getRegister());
	}
	
       return config;
   }
 

开发者ID:mazhaoyong,
项目名称:api-server-seed,
代码行数:80,
代码来源:MotanConfig.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)