File Coverage

blib/lib/RPC/Simple/CallHandler.pm
Criterion Covered Total %
statement 6 27 22.2
branch 0 6 0.0
condition n/a
subroutine 2 6 33.3
pod 1 3 33.3
total 9 42 21.4


line stmt bran cond sub pod time code
1             package RPC::Simple::CallHandler;
2              
3 1     1   5 use strict;
  1         1  
  1         38  
4 1     1   6 use vars qw($VERSION);
  1         2  
  1         339  
5              
6             ( $VERSION ) = '$Revision: 1.6 $ ' =~ /\$Revision:\s+([^\s]+)/;
7              
8             # Items to export into callers namespace by default. Note: do not export
9             # names by default without a very good reason. Use EXPORT_OK instead.
10             # Do not simply export all your public functions/methods/constants.
11              
12             # Preloaded methods go here.
13              
14             # Autoload methods go after =cut, and are processed by the autosplit program.
15             sub new
16             {
17 0     0 0   my $type = shift ;
18 0           my $self = {} ;
19            
20 0           $self->{controlRef} = shift ;
21 0           $self->{objRef} = shift ;
22 0           $self->{reqId} = shift ;
23 0           my $method = shift ;
24 0           my $args = shift ;
25            
26 0 0         print "Creating call handler\n" if $main::verbose ;
27 0           bless $self,$type ;
28            
29 0     0     $self->{objRef} -> $method (sub {$self->done(@_);} , @$args) ;
  0            
30 0           return $self ;
31             }
32              
33             sub done
34             {
35 0     0 1   my $self = shift ;
36            
37 0 0         print "done called\n" if $main::verbose ;
38 0           $self->{controlRef} -> callbackDone ($self->{reqId}, @_ ) ;
39 0           $self->destroy ;
40             }
41              
42             sub destroy
43             {
44 0     0 0   my $self = shift ;
45 0 0         print "CallHandler destroyed\n" if $main::verbose ;
46 0           delete $self->{controlRef} ;
47 0           delete $self->{objRef} ;
48 0           delete $self->{reqId} ;
49             }
50              
51             1;
52             __END__