You don't need to re-query the service registry each time, you can just
look up the service once and keep a reference (although you will have to
listen if the service unregisters and stop using it if it does). If that
doesn't work, then you can always do something like register call backs
from B to A...which is effectively what Event Admin does as mentioned by
Karl.
-> richard
dishmily wrote:
it is clear that we can register Bundle A to OSGI Service Registry and let
Bundle B request Bundle A through OSGI Service Registry,then Bundle B can
use Functionality of Bundle A.
the problem is: if there are too many Bundles need to use Functionality of
Bundle A, the OSGI Service Registry will be many times requestet. it seems
not a good way. so i would like to let Bundle B just receive information
from Bundle A. something like:
public class BundleB {
...
public void receive(MsgfromBundleA msgtxt){
System.out.println(msgtxt);
}
}
can anyone give me any tips to do this? thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]