Virgo整合ECF
ECF框架是OSGI-RemoteService的声明实现,其依赖Bundle包括:
org.eclipse.ecf
org.eclipse.ecf.osgi.services.distribution
org.eclipse.ecf.osgi.services.remoteserviceadmin
org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy
org.eclipse.core.runtime
org.eclipse.equinox.app
org.eclipse.ecf.identity
org.eclipse.ecf.discovery
org.eclipse.equinox.concurrent
org.eclipse.equinox.preferences
org.eclipse.core.jobs
org.eclipse.equinox.registry
org.eclipse.osgi.services.remoteserviceadmin
org.eclipse.core.contenttype
org.eclipse.ecf.provider.jmdns
org.eclipse.ecf.sharedobject
org.eclipse.ecf.provider
org.eclipse.ecf.remoteservice
org.eclipse.ecf.provider.remoteservice
ECF框架的很多plugin都设计成了延迟加载模式(Bundle-ActivationPolicy: lazy),因此需要首先修改virgo的配置文件($VTS-HOME/lib/org.eclipse.virgo.kernel.launch.properties).将osgi.compatibility.eagerStart.LazyActivation属性设置成true,来确保virgo支持延迟加载机制。
另外所声明服务的bundle(这里为org.chen.test.service)和发布服务的bundle(这里为org.chen.test)也需要声明成延迟加载模式(Bundle-ActivationPolicy: lazy)
一、通过DS方式发布RemoteService
Plan信息如下:
<?xml version="1.0" encoding="UTF-8"?><plan name="ecf.plan" version="1.0.0" scoped="false" atomic="true" xmlns="http://www.eclipse.org/virgo/schema/plan"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.eclipse.org/virgo/schema/plan http://www.eclipse.org/virgo/schema/plan/eclipse-virgo-plan.xsd"><artifact name="org.eclipse.ecf" type="bundle"></artifact><artifact name="org.eclipse.ecf.osgi.services.distribution" type="bundle"></artifact><artifact name="org.eclipse.ecf.osgi.services.remoteserviceadmin" type="bundle"></artifact><artifact name="org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy" type="bundle"></artifact><artifact name="org.eclipse.core.runtime" type="bundle"/><artifact name="org.eclipse.equinox.app" type="bundle"></artifact><artifact name="org.eclipse.ecf.identity" type="bundle"/><artifact name="org.eclipse.ecf.discovery" type="bundle"/><artifact name="org.eclipse.equinox.concurrent" type="bundle"/><artifact name="org.eclipse.equinox.preferences" type="bundle"/><artifact name="org.eclipse.core.jobs" type="bundle"></artifact><artifact name="org.eclipse.equinox.registry" type="bundle"/><artifact name="org.eclipse.osgi.services.remoteserviceadmin" type="bundle"></artifact><artifact name="org.eclipse.core.contenttype" type="bundle"/><artifact name="org.eclipse.ecf.provider.jmdns" type="bundle"/><artifact name="org.eclipse.ecf.sharedobject" type="bundle"/><artifact name="org.eclipse.ecf.provider" type="bundle"/><artifact name="org.eclipse.ecf.remoteservice" type="bundle"/><artifact name="org.eclipse.ecf.provider.remoteservice" type="bundle"></artifact><artifact name="cn.com.gei.krp.remoteservice" type="bundle"/><artifact name="org.chen.test.service" type="bundle"></artifact><artifact name="org.chen.test" type="bundle"></artifact></plan>