dubbo学习笔记 六 dubbo-container
2016-12-18 12:52
429 查看
这个模块比较简单,东西也不多,好写
看下SpringContainer吧,里面就是把META-INF/spring 下面的文件加载起来
看下SpringContainer吧,里面就是把META-INF/spring 下面的文件加载起来
public class SpringContainer implements Container { private static final Logger logger = LoggerFactory.getLogger(SpringContainer.class); public static final String SPRING_CONFIG = "dubbo.spring.config"; public static final String DEFAULT_SPRING_CONFIG = "classpath*:META-INF/spring/*.xml"; static ClassPathXmlApplicationContext context; public static ClassPathXmlApplicationContext getContext() { return context; } public void start() { String configPath = ConfigUtils.getProperty(SPRING_CONFIG); if (configPath == null || configPath.length() == 0) { configPath = DEFAULT_SPRING_CONFIG; } context = new ClassPathXmlApplicationContext(configPath.split("[,\\s]+")); context.start(); } public void stop() { try { if (context != null) { context.stop(); context.close(); context = null; } } catch (Throwable e) { logger.error(e.getMessage(), e); } } }
相关文章推荐
- The JVM Architecture Explained
- 【软件周刊】要的就是速度,Angular 4.0.0 beta0 发布;JetBrains 带来全新 Go IDE — Gogland
- 1086. Tree Traversals Again (25)
- stitching_detail算法介绍(二)
- RAID认识(二)RAID关键技术的应用
- 阿里云人工智能科学家闵万里犀利点评:现在的人工智能有点过热 | 2016 云栖大会
- 谷歌新 AI 实验室主管 Hugo 深度学习教程:神经网络、CV、NLP 难点解析
- 莫名奇妙的Error:Failed to crunch
- vs Debug Assertion Failed
- Linux 上使用 Gmail SMTP 服务器发送邮件通知
- [资源帖]IJCAI 2016 下载地址
- socketpair的用法和理解
- 绘图;BeginPaint;PAINTSTRUCT(&ps);SetArcDirection函数改变弧线的方向;LineDDA函数
- STL迭代器的"特性萃取机"-----Traits
- Installation failed with message:INSTALL_CANCELED_BY_USER
- 解决ssh的"Write failed: Broken pipe"问题
- avfoundataion框架使用
- Windows10 64Bit完美配置Theano并实现GPU加速并解决((CNMeM is disable,CuDNN not available))
- POJ 3068 "Shortest" pair of paths 已翻译
- MatConvNet--Using MatConvNet to train convnets