serviceMix开发笔记

版本:5.4

下载5.4版本并解压到本地(如D:/xiaodx/softs/apache-servicemix-5.4.0)

运行:打开终端,进入bin目录下并运行servicemix

命令行使用查看运行中的bundle

   karaf@root> osgi:list

   或

   karaf@root> la

命令行使用查找指定名称的bundle

   karaf@root> osgi:list | grep camel

命令行使用查看日志

   karaf@root> log:display 

命令行使用查看异常

   karaf@root> log:display-exception

命令行使用设置日志级别和查看指定的日志级别

   karaf@root> log:set DEBUG

   karaf@root> log:display | grep DEBUG

查看已经安装的featrue

   karaf@root> features:list

查找安装的feature

   karaf@root> features:list | grep camel

安装webconsole

   karaf@root> features:install webconsole

访问webconsole

   http://localhost:8181/system/console (用户和密码smx/smx)

安装jndi服务

   karaf@root> features:install jndi

安装blueprint-web模块

   karaf@root> features:install blueprint-web

安装war支持

   karaf@root> features:install pax-war

使用Pax-web

   https://ops4j1.jira.com/wiki/display/paxweb/Pax+Web

serviceMix 的 maven库

   http://repo2.maven.org/maven2/org/apache/servicemix/bundles/

查看指定模块提供的服务

   bundle-service mid

blueprint文档

   http://aries.apache.org/documentation/tutorials.html

   http://aries.apache.org/modules/blueprint.html

Cellar 相关

    http://karaf.apache.org/manual/cellar/latest/user-guide/index.html

    http://karaf.apache.org/index/subprojects/cellar.html

Cellar安装

    3.x

      feature:repo-add mvn:org.apache.karaf.cellar/apache-karaf-cellar/3.0.1/xml/features

   feature:install cellar

    2.x

      features:addUrl mvn:org.apache.karaf.cellar/apache-karaf-cellar/2.3.4/xml/features

   features:install cellar

   features:install cellar-obr

   features:install cellar-dosgi

   features:install cellar-cloud

服务的注册

    <service id="carBrandService" interface="com.osgi.springweb.service.CarBrandService"          ref="carBrandServiceImpl">

<service-properties>

          <entry key="v" value="2"/>

      </service-properties>

</service>

JNDI获取服务

    语法:osgi:service/<interface>[/<filter>](/<filter>.html)

    样例1:

        Context ctx = new InitialContext();

        Runnable r = (Runnable)ctx.lookup("osgi:service/java.lang.Runnable");

     样例2:

        Context ctx = new InitialContext();

        Runnable r = (Runnable)ctx.lookup("osgi:service/java.lang.Runnable/(v=v1.0)");//指定属性(v=v1.0),用‘/’连接

karaf配置文件相关

    http://www.sachinhandiekar.com/2013/08/using-external-properties-in-apache.html

ibm blueprint

    http://www.ibm.com/developerworks/library/os-osgiblueprint/

相关:

     http://www.tuicool.com/articles/7fI7Jb

     http://docs.hazelcast.org/docs/3.1/manual/html-single/#ConfigTcpIp

     http://blog.nanthrax.net/2011/11/apache-karaf-cellar-and-dosgi/ 

CDI相关

    https://github.com/ops4j/org.ops4j.pax.cdi

    https://github.com/ops4j/org.ops4j.pax.jdbc

osgi 邮件相关

    http://mail-archives.apache.org/mod_mbox/servicemix-users/

blueprint相关

http://www.slideshare.net/tonimenzel/ops4j-pax-tools-kickstart-your-osgi-adventure?next_slideshow=1

http://permalink.gmane.org/gmane.comp.java.osgi.devel/4093

http://www.slideshare.net/gnodet/osgi-blueprint-services-1622424

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Deploying_into_the_Container/files/DeployCamel-OsgiConfigProps.html

jndi 异常

    javax.naming.NoInitialContextException

    导入org.eclipse.jetty.jndi包

Servlet相关

   http://felix.apache.org/documentation/subprojects/apache-felix-http-service.html

后台启动

    使用start命令

camel:

http://my.oschina.net/u/574870/blog?disp=2&catalog=0&sort=time&p=2

ssh连接servicemix

http://karaf.apache.org/manual/latest/users-guide/start-stop.html

ssh karaf@localhost -p 8101

猜你喜欢

转载自satuo20.iteye.com/blog/2188770