Im sorry if this is not clear at all, but il try to answer these questions
and that might help.
As for the null object, it was a object that had not be set yet, or existed
but not yet created. That was a silly mistake from my side, probably copy
paste error, but the IDE didnt see anything wrong with the code.

*1) What am I trying to achieve;*
First of all im just trying out OSGi, so basically, im trying to achieve an
understanding of the why and how.
But in this current question im trying to achieve a DS component that
activate and deactivate, with the possibility to bind and unbind.
I did solve some problems I didn't understand yesterday, and that is why I
sent the mail.
In the end im trying to make a Java gui which will be a container for GUIs
that comes with the services. And it should deliver messages to the service
frame and should get messages from the service frame.
Basically its a control station for other services to register and they
should be able to communicate. This is probably best done with the
whiteboard pattern, if I have understood correctly?

*2) What did I try to do;*

1) I tried to activate a bundle which had a simple sysout, and the objecet
was accidentely null. This was a mistake because of a copy paste probably.
But this stopped the code.
2) I also started over from scratch to try to get the service to bind. Then
I figuered out that I had to have the implementation resolved to for
anything to happen. Now im just curious why.
3)I also tried to put the bind and unbind methods in another class, a class
that would be created from the class with the activate method. But this
seems to cause some problems.


*3) What did I *expect* to see as the result of doing (2);*

1) I expected at least some message back from the framework on the null
mistake, a nullpointer excetion.
2) As this attempt. I registered the interface but forgot the
implementation. Its logical that the setMethod(Reference) didn't go off.
But still im used to some kind of error message or warning.
3)As for the setting the bind and unbind in another class, I expected the
bind and unbind methods to trigger, I also tried to put the bind methods
inside the class with the activate method, and then it worked.

*4) What did I *actually* see as a result of doing (2);*

1) I didn't get any exceptions at all, it just started my bundle like
everything was ok. Except it was like it never ran the activate method.
I know its silly but alot of time was used to understand why the activate
method didn't start, at least that what I thought it didn't, but since this
sysout of the object that was unfortunately null, it was the first line, it
stopped without any exceptions.
2) Also here nothing happened, but again im used to some kind of error
message or warning, but this was actually silly.
3) This one is a little more confusing, nothing happens here. I create the
new class, but the bind(@Reference) wont trigger in this class. Its
probably some kind of settings mistake but I havent figured it out yet.

*5) Why do I believe that what actually happened is wrong?*
I don't think I said it was wrong but as I have mentioned a couple of
times, im used to getting some kind of error or warning. Unresolved
warning, nullpointer exception or something to work out from.
But the framework didn't give me anything which was frustrating to work
with. And the mail to that thread was basically to mention that I as a
newbie, felt that it was some warnings missing when I figured out what the
mistakes were.

Hopes this helps understanding my questions and inquiries.


-- 
Mvh
Snorre Lothar von Gohren Edwin
+47 411 611 94

Reply via email to