Logo Search packages:      
Sourcecode: dbus-java version File versions  Download package

DBusInterface org::freedesktop::dbus::DBusConnection::getRemoteObject ( String  busname,
String  objectpath 
) throws DBusException [inline]

Return a reference to a remote object. This method will always refer to the well known name (if given) rather than resolving it to a unique bus name. In particular this means that if a process providing the well known name disappears and is taken over by another process proxy objects gained by this method will make calls on the new proccess.

This method will use bus introspection to determine the interfaces on a remote object and so may block and may fail. The resulting proxy object will, however, be castable to any interface it implements. It will also autostart the process if applicable. Also note that the resulting proxy may fail to execute the correct method with overloaded methods and that complex types may fail in interesting ways. Basically, if something odd happens, try specifying the interface explicitly.

busname The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
objectpath The path on which the process is exporting the object.
A reference to a remote object.
ClassCastException If type is not a sub-type of DBusInterface
DBusException If busname or objectpath are incorrectly formatted.

Definition at line 354 of file DBusConnection.java.

Referenced by getPeerRemoteObject(), getRemoteObject(), and org::freedesktop::dbus::test::test::main().

      if (null == busname) throw new DBusException(_("Invalid bus name: null"));
      if (null == objectpath) throw new DBusException(_("Invalid object path: null"));
      if ((!busname.matches(BUSNAME_REGEX) && !busname.matches(CONNID_REGEX))
         || busname.length() > MAX_NAME_LENGTH)
         throw new DBusException(_("Invalid bus name: ")+busname);
      if (!objectpath.matches(OBJECT_REGEX) || objectpath.length() > MAX_NAME_LENGTH) 
         throw new DBusException(_("Invalid object path: ")+objectpath);
      return dynamicProxy(busname, objectpath);

Generated by  Doxygen 1.6.0   Back to index