[libnet-dbus-perl] 59/335: Cache remote object instances, to avoid repeated lookup of introspection data. No longer pass interface name when getting object

Intrigeri intrigeri at moszumanska.debian.org
Sat Mar 21 01:07:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.

commit 149c7081c553028dc88a31b56f1c25d4f1018126
Author: Daniel P. Berrange <dan at berrange.com>
Date:   Sun Aug 14 17:59:06 2005 +0000

    Cache remote object instances, to avoid repeated lookup of introspection data. No longer pass interface name when getting object
---
 lib/Net/DBus/RemoteService.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/Net/DBus/RemoteService.pm b/lib/Net/DBus/RemoteService.pm
index e5ab491..3780467 100644
--- a/lib/Net/DBus/RemoteService.pm
+++ b/lib/Net/DBus/RemoteService.pm
@@ -16,6 +16,7 @@ sub new {
 
     $self->{bus} = shift;
     $self->{service_name} = shift;
+    $self->{objects} = {};
 
     bless $self, $class;
 
@@ -37,11 +38,12 @@ sub get_service_name {
 sub get_object {
     my $self = shift;
     my $object_path = shift;
-    my $interface = shift;
     
-    return Net::DBus::RemoteObject->new($self,
-					$object_path,
-					$interface);
+    unless (defined $self->{objects}->{$object_path}) {
+	$self->{objects}->{$object_path} = Net::DBus::RemoteObject->new($self,
+									$object_path);
+    }
+    return $self->{objects}->{$object_path};
 }
 
 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git



More information about the Pkg-perl-cvs-commits mailing list