Hi Karl,
On Mon, 2007-10-22 at 11:08 +0200, Karl Pauls wrote:
> > What exactly happens when bundle A registers services with objects from
> > bundle B and B subsequently stops?
>
> Are you talking about instance of classes that A imports from B?
I'm trying to implement the whiteboard pattern in a transparent manner
for bundle B:
Bundle A defines a Subscriber interface. Bundle B has objects that
implement Subscriber.
Bundle A also defines a Subscribable interface, that looks like
public interface Subscribable {
public void subscribe(Subscriber subscriber);
}
Bundle A implements this interface with something like:
public class SubscribableImpl {
public void subscribe(Subscriber subscriber) {
context.registerService(Subscriber.class.getName(), subscriber);
}
}
The subscribers are then notified of events by looking them up in the
service registry.
Now what happens if bundle B calls something like:
Subscribable subscribable = new SubscribableImpl();
subscribable.subscribe(new Subscriber() {
...});
And what happens when bundle B subsequently stops?
--
--------------------------------------------------
David Lindelöf
Product Developer
Adhoco AG
Technopark
Jagerstrasse 2
8406 Winterthur
tel +41-52-264.5070
mob +41-79-415.6641
fax +41-52-264.5099
e-mail [EMAIL PROTECTED]
url http://www.adhoco.com
weblog http://www.visnet.ch/smartbuildings/
--------------------------------------------------
Fools rush in -- and get the best seats in the house.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]