To ilustrate, i create this 2 test projects:
Bundle 12 registers the service and bundle 5 has a reference to it.
osgi> bundle 12
Code:
osgi.test1_1.0.0 [12]
Id=12, Status=ACTIVE Data Root=/media/files/development/eclipse-workspaces/osgi-workspace/.metadata/.plugins/org.eclipse.pde.core/Jata/org.eclipse.osgi/bundles/12/data
Registered Services
{osgi.test1.Printer}={org.springframework.osgi.bean.name=printer, Bundle-SymbolicName=osgi.test1, Bundle-Version=1.0.0, service.id=29}
{org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean}={org.springframework.context.service.name=osgi.test1, Bundle-SymbolicName=osgi.test1, Bundle-Version=1.0.0, service.id=30}
Services in use:
{org.xml.sax.EntityResolver}={service.id=28}
{org.springframework.beans.factory.xml.NamespaceHandlerResolver}={service.id=27}
Exported packages
osgi.test1; version="1.0.0"[exported]
Imported packages
org.osgi.framework; version="1.5.0"<org.eclipse.osgi_3.5.0.v20090520 [0]>
No fragment bundles
Named class space
osgi.test1; bundle-version="1.0.0"[provided]
No required bundles
osgi> bundle 5
Code:
osgi.test.2_1.0.0 [5]
Id=5, Status=ACTIVE Data Root=/media/files/development/eclipse-workspaces/osgi-workspace/.metadata/.plugins/org.eclipse.pde.core/Jata/org.eclipse.osgi/bundles/5/data
Registered Services
{org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean}={org.springframework.context.service.name=osgi.test.2, Bundle-SymbolicName=osgi.test.2, Bundle-Version=1.0.0, service.id=31}
Services in use:
{org.xml.sax.EntityResolver}={service.id=28}
{org.springframework.beans.factory.xml.NamespaceHandlerResolver}={service.id=27}
{osgi.test1.Printer}={org.springframework.osgi.bean.name=printer, Bundle-SymbolicName=osgi.test1, Bundle-Version=1.0.0, service.id=29}
No exported packages
Imported packages
osgi.test1; version="1.0.0"<osgi.test1_1.0.0 [12]>
No fragment bundles
Named class space
osgi.test.2; bundle-version="1.0.0"[provided]
No required bundles
If i update bundle 12, the service Printer isn't referenced in bundle 5:
osgi> update 12
osgi> bundle 12
Code:
osgi.test1_1.0.0 [12]
Id=12, Status=ACTIVE Data Root=/media/files/development/eclipse-workspaces/osgi-workspace/.metadata/.plugins/org.eclipse.pde.core/Jata/org.eclipse.osgi/bundles/12/data
Registered Services
{osgi.test1.Printer}={org.springframework.osgi.bean.name=printer, Bundle-SymbolicName=osgi.test1, Bundle-Version=1.0.0, service.id=32}
{org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean}={org.springframework.context.service.name=osgi.test1, Bundle-SymbolicName=osgi.test1, Bundle-Version=1.0.0, service.id=33}
Services in use:
{org.xml.sax.EntityResolver}={service.id=28}
{org.springframework.beans.factory.xml.NamespaceHandlerResolver}={service.id=27}
Exported packages
osgi.test1; version="1.0.0"[exported]
Imported packages
org.osgi.framework; version="1.5.0"<org.eclipse.osgi_3.5.0.v20090520 [0]>
No fragment bundles
Named class space
osgi.test1; bundle-version="1.0.0"[provided]
No required bundles
osgi> bundle 5
Code:
osgi.test.2_1.0.0 [5]
Id=5, Status=ACTIVE Data Root=/media/files/development/eclipse-workspaces/osgi-workspace/.metadata/.plugins/org.eclipse.pde.core/Jata/org.eclipse.osgi/bundles/5/data
Registered Services
{org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean}={org.springframework.context.service.name=osgi.test.2, Bundle-SymbolicName=osgi.test.2, Bundle-Version=1.0.0, service.id=31}
Services in use:
{org.xml.sax.EntityResolver}={service.id=28}
{org.springframework.beans.factory.xml.NamespaceHandlerResolver}={service.id=27}
No exported packages
Imported packages
osgi.test1; version="1.0.0"<osgi.test1_1.0.0 [12]>
No fragment bundles
Named class space
osgi.test.2; bundle-version="1.0.0"[provided]
No required bundles
My environment is:
spring-osgi 1.2.0
spring-framework 2.5.6.SEC01
org.eclipse.osgi 3.5.0.v20090520