RMI

Remote Method Invocation with transparent proxies
Download

RMI Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Smith Scott
  • Publisher web site:
  • http://search.cpan.org/~sakoht/

RMI Tags


RMI Description

Remote Method Invocation with transparent proxies RMI stands for Remote Method Invocation. RMI is a Perl module that allows one process to have virtual object "stubs" which are proxies for real objects in another process. When methods are invoked on the proxy, the method actually runs in the other process. When results are returned, those values may also be proxies for the real items in the other process. Parameters from the client are also automatically proxied on the server side during method execution.In addition to invoking methods on proxy objects trasparently, an RMI::Client can invoke class methods, regular function calls, and other Perl functionaity on the remote server. Calls like these are typically the first step to obtain a remote object in the first place. This is different than implementations in other languages, which typically require that a server have limited and specific objects it returns, with all further proxying happening through them.The procedure typically goes as follows:1. a server is started which has access to some objects or data which is of value2. a client connects to that server, and asks that it execute code on its behalf3. the results returned may contain objects or other references, which the client recieves as proxies which "seem like" the real thing4. further interaction with the returned proxy objects/refs automatically make calls through the client to the server internallySYNOPSIS #process 1: an example server on host "myserver" use RMI::Server::Tcp; my $s = RMI::Server::Tcp->new(port => 1234); $s->run; #process 2: an example client use RMI::Client::Tcp; my $c = RMI::Client::Tcp->new( host => 'myserver', port => 1234, ); $c->call_use('IO::File'); $r = $c->call_class_method('IO::File','new','/etc/passwd'); $line1 = $r->getline; # works as an object $line2 = < $r >; # works as a file handle @rest = < $r >; # detects scalar/list context correctly $r->isa('IO::File'); # transparent in standard ways $r->can('getline'); ref($r) eq 'RMI::ProxyObject'; # the only sign this isn't a real IO::File... # (see RMI::Client's use_remote() to fix this) Requirements: · Perl


RMI Related Software