On Monday 31 December 2007 11:14, David Leangen wrote: > Since BundleS knows the specific type, I was wondering how I can pass on > that type to BundleA at runtime so the service is already casted to the > specific type.
I don't know what you are refering to here. If you are trying to assign "Vehicle of unknown type" to Skateboard s = (Skateboard) vehicle; in BundleA, then you BundleA is already definately aware of Skateboard. > // The lifecycle management system from BundleA > Service service = getVehicleService(); > // Registering Skateboard from BundleS > Skateboard skateboard = new Skateboard(); > bundleContext.registerService( ... ) //register Skateboard as Vehicle > // Use the registered service from BundleB > Skateboard skateboard = service.getVehicle( "skateboard" ); BundleB needs to import Skateboard (and Vehicle) since it uses this type directly, and I see no problems. If your bundles only use Java types in code, and doesn't have any loadClass() or Class.forName(), directly or indirectly, in your code, standard ImportPackage is all you need. Cheers -- Niclas Hedhman, Software Developer I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ OSGi Developer Mail List [email protected] http://www2.osgi.org/mailman/listinfo/osgi-dev
