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

public<I extends DBusInterface> I org::freedesktop::dbus::DBusConnection::getPeerRemoteObject ( String  busname,
String  objectpath,
Class< I >  type,
boolean  autostart 
) throws DBusException [inline, package]

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.

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.$
type The interface they are exporting it on. This type must have the same full class name and exposed method signatures as the interface the remote object is exporting.
autostart Disable/Enable auto-starting of services in response to calls on this object. Default is enabled; when calling a method with auto-start enabled, if the destination is a well-known name and is not owned the bus will attempt to start a process to take the name. When disabled an error is returned immediately.
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 or type is not in a package.

Definition at line 387 of file DBusConnection.java.

References getRemoteObject().

   {
      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 getRemoteObject(unique, objectpath, type, autostart);
   }


Generated by  Doxygen 1.6.0   Back to index