In this step the application will be tested using the OSGi console commands.
ss to display as
short status report of the installed bundles.
osgi> ss Framework is launched. id State Bundle 0 ACTIVE system.bundle_3.2.2.R32x_v20070118 1 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601 2 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601 3 ACTIVE org.eclipse.soda.sat.core_1.0.0.qualifier 4 ACTIVE org.eclipse.soda.sat.tutorial.customer_1.0.0 5 RESOLVED org.eclipse.soda.sat.tutorial.vendor.hotdog_1.0.0 6 RESOLVED org.eclipse.soda.sat.tutorial.vendor.popcorn_1.0.0 7 ACTIVE org.eclipse.soda.sat.tutorial.vendor.service_1.0.0
org.eclipse.soda.sat.tutorial.vendor.hotdog and
org.eclipse.soda.sat.tutorial.vendor.popcorn. As a result,
the org.eclipse.soda.sat.tutorial.customer bundle failed to
acquire an imported VendorService.
start 5 to start the
org.eclipse.soda.sat.tutorial.vendor.hotdog bundle. This
will cause it to register a VendorService with the OSGi
framework.
osgi> start 5
[INFO] - The Hotdog Vendor bundle has been activated
[DEBUG] - SAT Core: The bundle org.eclipse.soda.sat.tutorial.customer failed to acquire the
service org.eclipse.soda.sat.tutorial.vendor.service.VendorService matching the
filter "(spiciness<=8)".
[DEBUG] message is logged again. This
is because the registered VendorService did not possess
properties matching those required by the
org.eclipse.soda.sat.tutorial.customer bundle.
bundle 5 to verify the properties registered with the
org.eclipse.soda.sat.tutorial.vendor.hotdog bundle's
VendorService.
osgi> bundle 5
initial@reference:file:../../../../workspace/org.eclipse.soda.sat.tutorial.vendor.hotdog/ [5]
Id=5, Status=ACTIVE
Registered Services
{org.eclipse.soda.sat.tutorial.vendor.service.VendorService}={bundle.version=1.0.0,
spiciness=10, service.registration.timestamp=1178074055076, service.id=22}
No services in use.
No exported packages
Imported packages
org.eclipse.soda.sat.core.framework; version="1.0.0"
org.eclipse.soda.sat.core.util; version="1.0.0"
org.eclipse.soda.sat.tutorial.vendor.service; version="0.0.0"
No fragment bundles
Named class space
org.eclipse.soda.sat.tutorial.vendor.hotdog; bundle-version="1.0.0"[provided]
No required bundles
start 6 to start the
org.eclipse.soda.sat.tutorial.vendor.popcorn bundle. This
will cause it to register a VendorService with the OSGi
framework.
osgi> start 6 [INFO] - The Popcorn Vendor bundle has been activated [INFO] - The Customer bundle has been activated [INFO] - The Customer bought popcorn from Orville Redenbacher
VendorService registered by the
org.eclipse.soda.sat.tutorial.vendor.popcorn bundle did
possess properties matching those required by the
org.eclipse.soda.sat.tutorial.customer bundle.
bundle 6 to verify the properties registered with the
org.eclipse.soda.sat.tutorial.vendor.popcorn bundle's
VendorService.
osgi> bundle 6
initial@reference:file:../../../../workspace/org.eclipse.soda.sat.tutorial.vendor.popcorn/ [6]
Id=6, Status=ACTIVE
Registered Services
{org.eclipse.soda.sat.tutorial.vendor.service.VendorService}={bundle.version=1.0.0,
spiciness=3, service.registration.timestamp=1178075378559, service.id=23}
No services in use.
No exported packages
Imported packages
org.eclipse.soda.sat.core.framework; version="1.0.0"
org.eclipse.soda.sat.core.util; version="1.0.0"
org.eclipse.soda.sat.tutorial.vendor.service; version="0.0.0"
No fragment bundles
Named class space
org.eclipse.soda.sat.tutorial.vendor.popcorn; bundle-version="1.0.0"[provided]
No required bundles
close to terminate the application.
osgi> close
[INFO] - The Customer bundle has been deactivated
[DEBUG] - SAT Core: The bundle 'org.eclipse.soda.sat.tutorial.customer' failed to acquire the
service 'org.eclipse.soda.sat.tutorial.vendor.service.VendorService' matching the
filter "(spiciness<=8)".
[INFO] - The Popcorn Vendor bundle has been deactivated
[INFO] - The Hotdog Vendor bundle has been deactivated
[INFO] - The Customer bundle has been stopped
What just happened?
close command stops all the started bundles and
shuts the OSGi framework down.
Notice that the
[DEBUG] message appeared again! This is because the
bundles are stopped in reverse order to which they were
started, meaning that the stop order was:
org.eclipse.soda.sat.tutorial.vendor.popcorn
org.eclipse.soda.sat.tutorial.vendor.hotdog
org.eclipse.soda.sat.tutorial.customer
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.