/usr/lib/perl5/Net/DBus/Annotation.pm is in libnet-dbus-perl 1.0.0-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | # -*- perl -*-
#
# Copyright (C) 2006-2011 Daniel P. Berrange
#
# This program is free software; You can redistribute it and/or modify
# it under the same terms as Perl itself. Either:
#
# a) the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any
# later version,
#
# or
#
# b) the "Artistic License"
#
# The file "COPYING" distributed along with this file provides full
# details of the terms and conditions of the two licenses.
=pod
=head1 NAME
Net::DBus::Annotation - annotations for changing behaviour of APIs
=head1 SYNOPSIS
use Net::DBus::Annotation qw(:call);
my $object = $service->get_object("/org/example/systemMonitor");
# Block until processes are listed
my $processes = $object->list_processes("someuser");
# Just throw away list of processes, pretty pointless
# in this example, but useful if the method doesn't have
# a return value
$object->list_processes(dbus_call_noreply, "someuser");
# List processes & get on with other work until
# the list is returned.
my $asyncreply = $object->list_processes(dbus_call_async, "someuser");
... some time later...
my $processes = $asyncreply->get_data;
=head1 DESCRIPTION
This module provides a number of annotations which will be useful
when dealing with the DBus APIs. There are annotations for switching
remote calls between sync, async and no-reply mode. More annotations
may be added over time.
=head1 METHODS
=over 4
=cut
package Net::DBus::Annotation;
use strict;
use warnings;
our $CALL_SYNC = "sync";
our $CALL_ASYNC = "async";
our $CALL_NOREPLY = "noreply";
bless \$CALL_SYNC, __PACKAGE__;
bless \$CALL_ASYNC, __PACKAGE__;
bless \$CALL_NOREPLY, __PACKAGE__;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(dbus_call_sync dbus_call_async dbus_call_noreply);
our %EXPORT_TAGS = (call => [qw(dbus_call_sync dbus_call_async dbus_call_noreply)]);
=item dbus_call_sync
Requests that a method call be performed synchronously, waiting
for the reply or error return to be received before continuing.
=cut
sub dbus_call_sync() {
return \$CALL_SYNC;
}
=item dbus_call_async
Requests that a method call be performed a-synchronously, returning
a pending call object, which will collect the reply when it eventually
arrives.
=cut
sub dbus_call_async() {
return \$CALL_ASYNC;
}
=item dbus_call_noreply
Requests that a method call be performed a-synchronously, discarding
any possible reply or error message.
=cut
sub dbus_call_noreply() {
return \$CALL_NOREPLY;
}
1;
=pod
=back
=head1 AUTHOR
Daniel Berrange <dan@berrange.com>
=head1 COPYRIGHT
Copright (C) 2006-2011, Daniel Berrange.
=head1 SEE ALSO
L<Net::DBus>, L<Net::DBus::RemoteObject>
=cut
|