line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package AMF::Connection::MessageBody; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
795
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub new { |
7
|
0
|
|
|
0
|
0
|
|
my $proto = shift; |
8
|
0
|
|
0
|
|
|
|
my $class = ref($proto) || $proto; |
9
|
0
|
|
|
|
|
|
my ($target,$response,$data) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $self = { |
12
|
|
|
|
|
|
|
'target' => $target, |
13
|
|
|
|
|
|
|
'response' => $response, |
14
|
|
|
|
|
|
|
'data' => $data # we might want to have some kind of mapper between remote objects and local / user registered ones |
15
|
|
|
|
|
|
|
}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
return bless($self, $class); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub setTarget { |
21
|
0
|
|
|
0
|
0
|
|
my ($class, $target) = @_; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$class->{'target'} = $target; |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub getTarget { |
27
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return $class->{'target'}; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub setResponse { |
33
|
0
|
|
|
0
|
0
|
|
my ($class, $response) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
$class->{'response'} = $response; |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub getResponse { |
39
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $class->{'response'}; |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub setData { |
45
|
0
|
|
|
0
|
0
|
|
my ($class, $data) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
$class->{'data'} = $data; |
48
|
|
|
|
|
|
|
}; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub getData { |
51
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return $class->{'data'}; |
54
|
|
|
|
|
|
|
}; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# HTTP::Response-ish methods ... |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_error { |
59
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
60
|
|
|
|
|
|
|
|
61
|
0
|
0
|
|
|
|
|
return ($class->{'target'} =~ m|onStatus|) ? 1 : 0 ; |
62
|
|
|
|
|
|
|
}; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub is_success { |
65
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
return ($class->{'target'} =~ m|onResult|) ? 1 : 0 ; |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub is_debug { |
71
|
0
|
|
|
0
|
0
|
|
my ($class) = @_; |
72
|
|
|
|
|
|
|
|
73
|
0
|
0
|
|
|
|
|
return ($class->{'target'} =~ m|onDebug|) ? 1 : 0 ; |
74
|
|
|
|
|
|
|
}; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
__END__ |