Net::DBus::ProxyObject - Online Linux Manual PageSection : 3pm
Updated : 2020-11-09
Source : perl v5.32.0
Note : User Contributed Perl Documentation

NAMENet::DBus::ProxyObject − Implement objects to export to the bus

SYNOPSIS​ # Connecting an object to the bus, under a service ​ package main; ​ ​ use Net::DBus; ​ ​ # Attach to the bus ​ my $bus = Net::DBus−>find; ​ ​ # Create our application's object instance ​ my $object = Demo::HelloWorld−>new() ​ ​ # Acquire a service 'org.demo.Hello' ​ my $service = $bus−>export_service("org.demo.Hello"); ​ ​ # Finally export the object to the bus ​ my $proxy = Demo::HelloWorld::DBus−>new($object); ​ ​ ....rest of program... ​ ​ ​ # Define a new package for the object we're going ​ # to export ​ package Demo::HelloWorld; ​ ​ sub new { ​ my $class = shift; ​ my $service = shift; ​ my $self = {}; ​ ​ $self−>{sighandler} = undef; ​ ​ bless $self, $class; ​ ​ return $self; ​ } ​ ​ sub sighandler { ​ my $self = shift; ​ my $callback = shift; ​ ​ $self−>[sighandler} = $callback; ​ } ​ ​ sub Hello { ​ my $self = shift; ​ my $name = shift; ​ ​ &{$self−>{sighandler}}("Greeting", "Hello $name"); ​ return "Said hello to $name"; ​ } ​ ​ sub Goodbye { ​ my $self = shift; ​ my $name = shift; ​ ​ &{$self−>{sighandler}}("Greeting", "Goodbye $name"); ​ return "Said goodbye to $name"; ​ } ​ ​ ​ # Define a new package for the object we're going ​ # to export ​ package Demo::HelloWorld::DBus; ​ ​ # Specify the main interface provided by our object ​ use Net::DBus::Exporter qw(org.example.demo.Greeter); ​ ​ # We're going to be a DBus object ​ use base qw(Net::DBus::ProxyObject); ​ ​ # Export a 'Greeting' signal taking a stringl string parameter ​ dbus_signal("Greeting", ["string"]); ​ ​ # Export 'Hello' as a method accepting a single string ​ # parameter, and returning a single string value ​ dbus_method("Hello", ["string"], ["string"]); ​ ​ sub new { ​ my $class = shift; ​ my $service = shift; ​ my $impl = shfit; ​ my $self = $class−>SUPER::new($service, "/org/demo/HelloWorld", $impl); ​ ​ bless $self, $class; ​ ​ $self−>sighandler(sub { ​ my $signame = shift; ​ my $arg = shift; ​ $self−>emit_signal($signame, $arg); ​ }); ​ ​ return $self; ​ } ​ ​ # Export 'Goodbye' as a method accepting a single string ​ # parameter, and returning a single string, but put it ​ # in the 'org.exaple.demo.Farewell' interface ​ ​ dbus_method("Goodbye", ["string"], ["string"], "org.example.demo.Farewell");

DESCRIPTIONThis the base for creating a proxy between a bus object and an application's object. It allows the application's object model to remain separate from the RPC object model. The proxy object will forward method calls from the bus, to the implementation object. The proxy object can also register callbacks against the application object, which it can use to then emit signals on the bus.

METHODSmy $object = Net::DBus::ProxyObject−>new($service, $path, $impl) This creates a new DBus object with an path of $path registered within the service $service. The $path parameter should be a string complying with the usual DBus requirements for object paths, while the $service parameter should be an instance of Net::DBus::Service. The latter is typically obtained by calling the export_service method on the Net::DBus object. The $impl parameter is the application object which will implement the methods being exported to the bus. my $object = Net::DBus::ProxyObject−>new($parentobj, $subpath, $impl) This creates a new DBus child object with an path of $subpath relative to its parent $parentobj. The $subpath parameter should be a string complying with the usual DBus requirements for object paths, while the $parentobj parameter should be an instance of Net::DBus::BaseObject or a subclass. The $impl parameter is the application object which will implement the methods being exported to the bus.

AUTHORDaniel P. Berrange

COPYRIGHTCopyright (C) 2005−2011 Daniel P. Berrange

SEE ALSONet::DBus, Net::DBus::Service, Net::DBus::BaseObject, Net::DBus::ProxyObject, Net::DBus::Exporter, Net::DBus::RemoteObject
0
Johanes Gumabo
Data Size   :   12,321 byte
man-Net::DBus::ProxyObject.3pmBuild   :   2024-12-29, 07:25   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 256,172
Visitor ID   :     :  
Visitor IP   :   3.137.176.238   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.29
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|252|Net::DBus::ProxyObject.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Net::DBus::ProxyObject.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|252|Net::DBus::ProxyObject.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Net::DBus::ProxyObject.3pm|43|'br══─}─══ |'br══─}─══ )