1Net::DBus::RemoteObjectU(s3e)r Contributed Perl DocumentaNteito:n:DBus::RemoteObject(3)
2
3
4
6 Net::DBus::RemoteObject - Access objects provided on the bus
7
9 my $service = $bus->get_service("org.freedesktop.DBus");
10 my $object = $service->get_object("/org/freedesktop/DBus");
11
12 print "Names on the bus {\n";
13 foreach my $name (sort @{$object->ListNames}) {
14 print " ", $name, "\n";
15 }
16 print "}\n";
17
19 This module provides the API for accessing remote objects available on
20 the bus. It uses the autoloader to fake the presence of methods based
21 on the API of the remote object. There is also support for setting
22 callbacks against signals, and accessing properties of the object.
23
25 my $object = Net::DBus::RemoteObject->new($service, $object_path[,
26 $interface]);
27 Creates a new handle to a remote object. The $service parameter is
28 an instance of the Net::DBus::RemoteService method, and
29 $object_path is the identifier of an object exported by this
30 service, for example "/org/freedesktop/DBus". For remote objects
31 which implement more than one interface it is possible to specify
32 an optional name of an interface as the third parameter. This is
33 only really required, however, if two interfaces in the object
34 provide methods with the same name, since introspection data can be
35 used to automatically resolve the correct interface to call cases
36 where method names are unique. Rather than using this constructor
37 directly, it is preferrable to use the "get_object" method on
38 Net::DBus::RemoteService, since this caches handles to remote
39 objects, eliminating unneccessary introspection data lookups.
40
41 my $object = $object->as_interface($interface);
42 Casts the object to a specific interface, returning a new instance
43 of the Net::DBus::RemoteObject specialized to the desired
44 interface. It is only neccessary to cast objects to a specific
45 interface, if two interfaces export methods or signals with the
46 same name, or the remote object does not support introspection.
47
48 my $service = $object->get_service
49 Retrieves a handle for the remote service on which this object is
50 attached. The returned object is an instance of
51 Net::DBus::RemoteService
52
53 my $path = $object->get_object_path
54 Retrieves the unique path identifier for this object within the
55 service.
56
57 my $object = $object->get_child_object($subpath, [$interface])
58 Retrieves a handle to a child of this object, identified by the
59 relative path $subpath. The returned object is an instance of
60 "Net::DBus::RemoteObject". The optional $interface parameter can be
61 used to immediately cast the object to a specific type.
62
63 $object->connect_to_signal($name, $coderef);
64 Connects a callback to a signal emitted by the object. The $name
65 parameter is the name of the signal within the object, and $coderef
66 is a reference to an anonymous subroutine. When the signal $name is
67 emitted by the remote object, the subroutine $coderef will be
68 invoked, and passed the parameters from the signal.
69
71 Daniel Berrange <dan@berrange.com>
72
74 Copright (C) 2004-2005, Daniel Berrange.
75
77 Net::DBus::RemoteService, Net::DBus::Object
78
79
80
81perl v5.12.0 2008-02-21 Net::DBus::RemoteObject(3)