1Net::DBus::RemoteServicUes(e3r)Contributed Perl DocumentNaetti:o:nDBus::RemoteService(3)
2
3
4
6 Net::DBus::RemoteService - Access services provided on the bus
7
9 my $bus = Net::DBus->find;
10 my $service = $bus->get_service("org.freedesktop.DBus");
11
12 my $object = $service->get_object("/org/freedesktop/DBus");
13 foreach (@{$object->ListNames}) {
14 print "$_\n";
15 }
16
18 This object provides a handle to a remote service on the bus. From this
19 handle it is possible to access objects associated with the service. If
20 a service is not running, an attempt will be made to activate it the
21 first time a method is called against one of its objects.
22
24 my $service = Net::DBus::RemoteService->new($bus, $owner,
25 $service_name);
26 Creates a new handle for a remote service. The $bus parameter is an
27 instance of Net::DBus, $owner is the name of the client providing
28 the service, while $service_name is the well known name of the
29 service on the bus. Service names consist of two or more tokens,
30 separated by periods, while the tokens comprise the letters a-z,
31 A-Z, 0-9 and _, for example "org.freedesktop.DBus". There is
32 generally no need to call this constructor, instead the
33 "get_service" method on Net::DBus should be used. This caches
34 handles to remote services, eliminating repeated retrieval of
35 introspection data.
36
37 my $bus = $service->get_bus;
38 Retrieves a handle for the bus to which this service is attached.
39 The returned object will be an instance of Net::DBus.
40
41 my $service_name = $service->get_service_name
42 Retrieves the name of the remote service as known to the bus.
43
44 my $owner_name = $service->get_owner_name;
45 Retrieves the name of the client owning the service at the time it
46 was connected to.
47
48 my $object = $service->get_object($object_path[, $interface]);
49 Retrieves a handle to the remote object provided by the service
50 with the name of $object_path. If the optional $interface parameter
51 is provided, the object will immediately be cast to the designated
52 interface. NB, it is only neccessary to cast an object to a
53 specific interface if there are multiple interfaces on the object
54 providing methods with the same name, or the remote object does
55 support introspection. The returned object will be an instance of
56 Net::DBus::RemoteObject.
57
59 Daniel Berrange <dan@berrange.com>
60
62 Copright (C) 2004-2005, Daniel Berrange.
63
65 Net::DBus::RemoteObject, Net::DBus::Service, Net::DBus
66
67
68
69perl v5.12.0 2008-02-21 Net::DBus::RemoteService(3)