Annotations in Java binding

Tim Moloney t.moloney at verizon.net
Tue Apr 18 09:08:10 PDT 2006


Matthew Johnson wrote:
> On Tue, 18 Apr 2006, Tim Moloney wrote:
>
>> Thiago Macieira wrote:
>>>
>>> Looks like you're calling out to the wrong interface. The XML file 
>>> you posted had interface org.gnome.Rhythmbox.Player.
>>>
>>
>> True, but rhythmbox.RhythmboxPlayer is the name of the Java class 
>> that was generated by running CreateInterface on that XML file.  I 
>> think that part is working correctly since I can run my simple test 
>> application (below) and Rhythmbox will be started if it isn't already 
>> running.
>
> Hmm, my CreateInterface generates org.gnome.Rhythmbox.Player

Okay, that was the disconnect.  I thought the traceback was telling me 
that playPause didn't exist on Rhythmbox.Player, not that 
Rhythmbox.Player didn't exist.

I assumed that I had to rename org.gnome.Rhythmbox.Player since I don't 
have "authority" to create files in that domain.  If I wanted to 
distribute this software, am I "allowed" to create packages in someone 
else's domain.  This is a Java policy/courtesy question, not a technical 
question.  I assume that I may need to change the contents of the 
generated class and if others did the same, there would be incompatible 
packages with the same name.

Sorry for the assumptions, but I am still learning this.

However, I'm still confused about the original problem.  Why was Java 
looking for org.gnome.Rhythmbox.Player when I called a method on an 
instantiated object of that (incorrectly renamed) class?  The object 
knows what methods are in its class regardless of the class name, 
correct?  Why would it need to use reflection to lookup something in its 
own class?  What information is it looking for that wasn't part of the 
generated class?  What am I missing?

Thanks for the help.  :)

Tim Moloney



More information about the dbus mailing list