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

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

Return a reference to a remote object. This method will resolve the well known name (if given) to a unique bus name when you call it. This means that if a well known name is released by one process and acquired by another calls to objects gained from this method will continue to operate on the original process.

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.

Parameters:
busname The bus name to connect to. Usually a well known bus 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.$
Returns:
A reference to a remote object.
Exceptions:
ClassCastException If type is not a sub-type of DBusInterface
DBusException If busname or objectpath are incorrectly formatted.

Definition at line 321 of file DBusConnection.java.

   {
      if (null == busname) throw new DBusException(_("Invalid bus name: null"));
      
      if ((!busname.matches(BUSNAME_REGEX) && !busname.matches(CONNID_REGEX))
            || busname.length() > MAX_NAME_LENGTH) 
         throw new DBusException(_("Invalid bus name: ")+busname);
      
      String unique = _dbus.GetNameOwner(busname);

      return dynamicProxy(unique, objectpath);
   }


Generated by  Doxygen 1.6.0   Back to index