Annotations in Java binding

Matthew Johnson dbus at matthew.ath.cx
Tue Apr 18 06:37:56 PDT 2006


On Tue, 18 Apr 2006, Tim Moloney wrote:

> Thiago Macieira wrote:
>> Tim Moloney wrote:
>> 
>>> "rhythmbox.RhythmboxPlayer" doesn't exist
>>> 
>> 
>> 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

Matt

>
> Tim Moloney
>
>
> package rhythmbox;
>
> import org.freedesktop.dbus.DBusConnection;
>
> public class RhythmboxInterface {
>
> public static void main(String[] args) {
>   try {
>     DBusConnection conn = 
> DBusConnection.getConnection(DBusConnection.SESSION);
>     RhythmboxPlayer rp = 
> (RhythmboxPlayer)conn.getRemoteObject("org.gnome.Rhythmbox",
>         "/org/gnome/Rhythmbox/Player", RhythmboxPlayer.class);
>     rp.playPause(true);
>     conn.disconnect();
>   }
>   catch (DBusException e) {
>     System.out.println("Error connecting to session bus");
>     //  TODO Other exceptions?
>   }
> }
>
> }
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
>
>

-- 
Matthew Johnson
http://www.matthew.ath.cx/


More information about the dbus mailing list