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 ser‐
30 vice, for example "/org/freedesktop/DBus". For remote objects which
31 implement more than one interface it is possible to specify an
32 optional name of an interface as the third parameter. This is only
33 really required, however, if two interfaces in the object provide
34 methods with the same name, since introspection data can be used to
35 automatically resolve the correct interface to call cases where
36 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 inter‐
44 face. It is only neccessary to cast objects to a specific inter‐
45 face, if two interfaces export methods or signals with the same
46 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 Net::DBus::Remote‐
51 Service
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.8.8 2008-02-20 Net::DBus::RemoteObject(3)