File Coverage

blib/lib/JMX/Jmx4Perl/Product/Tomcat.pm
Criterion Covered Total %
statement 14 24 58.3
branch 0 2 0.0
condition n/a
subroutine 6 12 50.0
pod 7 7 100.0
total 27 45 60.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2             package JMX::Jmx4Perl::Product::Tomcat;
3              
4 4     4   43 use JMX::Jmx4Perl::Product::BaseHandler;
  4         9  
  4         140  
5 4     4   22 use strict;
  4         7  
  4         106  
6 4     4   32 use base "JMX::Jmx4Perl::Product::BaseHandler";
  4         7  
  4         383  
7              
8 4     4   28 use Carp qw(croak);
  4         10  
  4         1111  
9              
10             =head1 NAME
11              
12             JMX::Jmx4Perl::Product::Tomcat - Handler for Apache Tomcat
13              
14             =head1 DESCRIPTION
15              
16             This is the product handler supporting Tomcat, Version 4, 5 and 6. (http://tomcat.apache.org/)
17              
18             =cut
19              
20             sub id {
21 4     4 1 30 return "tomcat";
22             }
23              
24             sub name {
25 0     0 1 0 return "Apache Tomcat";
26             }
27              
28             # Pure Tomcat must be *after* all App-Servers using tomcat as web container
29             sub order {
30 4     4 1 18 return 20;
31             }
32              
33             sub _try_version {
34 0     0     my $self = shift;
35 0           my $ret = $self->try_attribute("version","Catalina:type=Server","serverInfo");
36 0 0         if ($ret) {
37 0           $self->{version} =~ s/^.*?\/?(\d.+)$/$1/;
38             }
39 0           return $ret;
40             }
41              
42             sub autodetect_pattern {
43 0     0 1   return "version";
44             }
45              
46             sub vendor {
47 0     0 1   return "Apache";
48             }
49              
50             sub jsr77 {
51 0     0 1   return 1;
52             }
53              
54             sub init_aliases {
55             return
56             {
57 0     0 1   attributes =>
58             {
59             #SERVER_ADDRESS => [ "jboss.system:type=ServerInfo", "HostAddress"],
60             SERVER_HOSTNAME => [ "Catalina:type=Engine", "defaultHost"],
61             },
62             operations =>
63             {
64             #THREAD_DUMP => [ "jboss.system:type=ServerInfo", "listThreadDump"]
65             }
66             # Alias => [ "mbean", "attribute", "path" ]
67             };
68             }
69              
70             =head1 LICENSE
71              
72             This file is part of jmx4perl.
73              
74             Jmx4perl is free software: you can redistribute it and/or modify
75             it under the terms of the GNU General Public License as published by
76             the Free Software Foundation, either version 2 of the License, or
77             (at your option) any later version.
78              
79             jmx4perl is distributed in the hope that it will be useful,
80             but WITHOUT ANY WARRANTY; without even the implied warranty of
81             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82             GNU General Public License for more details.
83              
84             You should have received a copy of the GNU General Public License
85             along with jmx4perl. If not, see .
86              
87             A commercial license is available as well. Please contact roland@cpan.org for
88             further details.
89              
90             =head1 AUTHOR
91              
92             roland@cpan.org
93              
94             =cut
95              
96             1;