OSGi 系列(十八)之 基于注解的 Blueprint

1. 注解实现 blueprint

第一步:bundle 添加 Bundle-Blueprint-Annotation

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Blueprint-Annotation>true</Bundle-Blueprint-Annotation>
</instructions>
</configuration>
</plugin>

第二步:karaf 要安装以下 4 个 bundle:

install -s mvn:org.apache.xbean/xbean-bundleutils/3.18
install -s mvn:org.apache.xbean/xbean-finder/3.18
install -s mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.annotation.api/1.0.1
install -s mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.annotation.impl/1.0.1

注意 karaf 4.1.5 上要重启 aries-blueprint:

feature:stop aries-blueprint
feature:start aries-blueprint

或直接在 standard-4.1.5-features.xml 文件中 aries-blueprint 中添加:

<feature name="aries-blueprint" description="Aries Blueprint" version="4.1.5">
<feature>aries-proxy</feature>
<bundle dependency="true" start-level="20">mvn:org.apache.aries/org.apache.aries.util/1.1.3</bundle>
<!-- Making the compatibility bundle a dependency allows it to only be installed on-demand -->
<bundle dependency="true" start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0</bundle> <!-- 添加 Bundle-Blueprint-Annotation 支持 -->
<bundle start-level="20">mvn:org.apache.xbean/xbean-bundleutils/3.18</bundle>
<bundle start-level="20">mvn:org.apache.xbean/xbean-finder/3.18</bundle>
<bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.annotation.api/1.0.1</bundle>
<bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.annotation.impl/1.0.1</bundle> <bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1</bundle>
<bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.1.0</bundle>
<bundle start-level="20">mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.8.3</bundle>
<conditional>
<condition>bundle</condition>
<bundle start-level="30">mvn:org.apache.karaf.bundle/org.apache.karaf.bundle.blueprintstate/4.1.5</bundle>
</conditional>
<capability>
osgi.service;effective:=active;objectClass=org.apache.aries.blueprint.services.ParserService,
osgi.extender; osgi.extender="osgi.blueprint";uses:="org.osgi.service.blueprint.container,org.osgi.service.blueprint.reflect";version:Version="1.0"
</capability>
</feature>

2. blueprint 注解使用

Blueprint Annotations官网

http://blog.csdn.net/Rongbo_J/article/details/53728846

OSGi 系列(十八)之 基于注解的 Blueprint的更多相关文章

  1. Web 前端开发精华文章集锦(jQuery、HTML5、CSS3)【系列十八】

    <Web 前端开发精华文章推荐>2013年第六期(总第十八期)和大家见面了.梦想天空博客关注 前端开发 技术,分享各种增强网站用户体验的 jQuery 插件,展示前沿的 HTML5 和 C ...

  2. 学习ASP.NET Core Razor 编程系列十八——并发解决方案

    学习ASP.NET Core Razor 编程系列目录 学习ASP.NET Core Razor 编程系列一 学习ASP.NET Core Razor 编程系列二——添加一个实体 学习ASP.NET ...

  3. 为什么不建议给MySQL设置Null值?《死磕MySQL系列 十八》

    大家好,我是咔咔 不期速成,日拱一卒 之前ElasticSearch系列文章中提到了如何处理空值,若为Null则会直接报错,因为在ElasticSearch中当字段值为null时.空数组.null值数 ...

  4. Java系列--第八篇 基于Maven的SSME之定时邮件发送

    关于ssme这个我的小示例项目,想做到麻雀虽小,五脏俱全,看到很多一些web都有定时发送邮件的功能,想我ssme也加入一下这种功能,经查询相关文档,发现spring本身自带了一个调度器quartz,下 ...

  5. Hadoop 系列(八)—— 基于 ZooKeeper 搭建 Hadoop 高可用集群

    一.高可用简介 Hadoop 高可用 (High Availability) 分为 HDFS 高可用和 YARN 高可用,两者的实现基本类似,但 HDFS NameNode 对数据存储及其一致性的要求 ...

  6. 【iCore3 双核心板_FPGA】实验二十八:基于SDRAM 的VGA 驱动器的设计

    本实验设计的VGA显示驱动完全基于FPGA实现,用SDRAM做缓存设备,通过ARM控制VGA显示的内容.ARM 通过FSMC总线向FPGA发送数据,由于总线的速度和VGA的显示速度与SDRAM的读写速 ...

  7. BizTalk开发系列(十八) 使用信封拆分数据库消息

    之前写了一篇的<BizTalk开发系列(十七) 信封架构(Envelop)> 是关于信封架构及其拆装原理的,都是理论性的内容.信封在BizTalk开发过程中最常用的应该是在读取SQL Se ...

  8. SSE图像算法优化系列十八:三次卷积插值的进一步SSE优化。

    本文是在学习https://blog.csdn.net/housisong/article/details/1452249一文的基础上对算法的理解和重新整理,再次非常感谢原文作者的深入分析以及分享. ...

  9. 文献综述十八:基于SSH框架的进销存管理系统设计与实现

    一.基本信息 标题:基于SSH框架的进销存管理系统设计与实现 时间:2017 出版源:内蒙古科技与经济 文件分类:对框架的研究 二.研究背景 进销存管理系统在各企业中广泛应用,使用SSH框架,很大程度 ...

随机推荐

  1. Python分页转Mybatis pagehelper格式分页

    最近工作里遇到一个需求要把之前用Java写的一个http接口替换成用Python写的,出参是带了mybatis pageHelper中PageInfo信息的一个JSON串,而Python这边分页不会涉 ...

  2. 在Android中把内容写到XML文件中

    在Android中把内容写到XML文件中 saveXmlButton.setOnClickListener(new OnClickListener() { @Override public void ...

  3. mysql 5.7新特新 操作json 数组

    ; UPDATE EDI.edi_history SET response_summary = JSON_REPLACE(response_summary, ; 对于json数组,使用$[*]  然后 ...

  4. go遍历目录

    package main import ( "fmt" "io/ioutil" "os" "path/filepath" ...

  5. Others-Goldengate 数据同步

    GoldenGate 是一家创建于1995年的美国公司,开发总部设在旧金山,在北美,欧洲和亚洲(包括新加坡.印度.澳大利亚)设有支持中心. 公司名称 GoldenGate 总部地点 旧金山 成立时间 ...

  6. UI5-文档-4.8-Translatable Texts

    在这一步中,我们将UI的文本移动到一个单独的资源文件中. 这样,他们都在一个中心位置,可以很容易地翻译成其他语言.这个国际化过程(简称i18n)是在SAPUI5中通过使用一种特殊的资源模型和标准的数据 ...

  7. UI5-文档-4.4-XML Views

    将所有UI放到index.html文件将很快导致一个混乱的设置,有相当多的工作在我们前面.我们先用sap.m.Text进行模块化.控件导入专用视图. SAPUI5支持多种视图类型(XML.HTML.J ...

  8. Shiro权限总结

    参考学习地址   shiro 瞅完就会用(ssm+shiro)    Spring Shiro配置实现用户认证和授权 anon:它对应的过滤器里面是空的,什么都没做,另外.do和.jsp后面的*表示参 ...

  9. Hive 和 HBase区别

    作者:yuan daisy 链接:https://www.zhihu.com/question/21677041/answer/78289309 来源:知乎 著作权归作者所有.商业转载请联系作者获得授 ...

  10. textbox显示定位到最后一行(最新一行)

    this.textBox1.Select(this.txtMsgInfo.TextLength, 0); this.textBox1.ScrollToCaret();