In this step the Popcorn Vendor bundle is updated to export an
implementation of the VendorService with a service property
that describes its spiciness.
org.eclipse.soda.sat.tutorial.vendor.popcorn project.
package org.eclipse.soda.sat.tutorial.vendor.popcorn.bundle;
import java.util.Dictionary;
import java.util.Hashtable;
import org.eclipse.soda.sat.core.framework.BaseBundleActivator;
import org.eclipse.soda.sat.core.util.LogUtility;
import org.eclipse.soda.sat.tutorial.vendor.popcorn.PopcornVendor;
import org.eclipse.soda.sat.tutorial.vendor.service.VendorService;
public class Activator extends BaseBundleActivator {
protected void activate() {
LogUtility.logInfo("The Popcorn Vendor bundle has been activated"); //$NON-NLS-1$
addExportedVendorService();
}
private void addExportedVendorService() {
VendorService service = new PopcornVendor();
Dictionary properties = new Hashtable(11);
properties.put(VendorService.SPICINESS_PROPERTY, new Integer(3));
addExportedService(VendorService.SERVICE_NAME, service, properties);
}
protected void deactivate() {
LogUtility.logInfo("The Popcorn Vendor bundle has been deactivated"); //$NON-NLS-1$
}
}
addExportedVendorService() method has
been updated to create a Dictionary of properties that is
passed to the addExportedService(String, Object, Dictionary)
method when the VendorService is exported. In this case
the single property key VendorService.SPICINESS_PROPERTY is
registered with the value new Integer(3).
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.