File Coverage

blib/lib/JMX/Jmx4Perl/Product/Unknown.pm
Criterion Covered Total %
statement 17 29 58.6
branch n/a
condition n/a
subroutine 7 12 58.3
pod 7 7 100.0
total 31 48 64.5


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2             package JMX::Jmx4Perl::Product::Unknown;
3              
4 4     4   1874 use JMX::Jmx4Perl::Product::BaseHandler;
  4         14  
  4         144  
5 4     4   30 use JMX::Jmx4Perl;
  4         8  
  4         82  
6 4     4   21 use strict;
  4         11  
  4         89  
7 4     4   45 use base "JMX::Jmx4Perl::Product::BaseHandler";
  4         18  
  4         400  
8              
9 4     4   26 use Carp qw(croak);
  4         6  
  4         1030  
10              
11             =head1 NAME
12              
13             JMX::Jmx4Perl::Product::Unknown - Fallback handler
14              
15             =head1 DESCRIPTION
16              
17             This fallback handler runs always as I in the autodetection chain and
18             provides at least informations about the platform MXMBeans which are available
19             on any Java 5 platform.
20              
21             =cut
22              
23             sub id {
24 4     4 1 32 return "unknown";
25             }
26              
27             sub name {
28 0     0 1 0 return "unknown";
29             }
30              
31             # Highest ordering number
32             sub order {
33 4     4 1 20 return 1000;
34             }
35              
36             sub info {
37 0     0 1   my $self = shift;
38 0           my $verbose = shift;
39              
40 0           my $ret = $self->jvm_info($verbose);
41 0           $ret .= "-" x 80 . "\n";
42 0           $ret .= "The application server's brand could not be auto-detected.\n";
43 0           $ret .= "Known brands are: " . (join ", ",grep { $_ ne "unknown"} @JMX::Jmx4Perl::PRODUCT_HANDLER_ORDERING) . "\n\n";
  0            
44 0           $ret .=
45             "Please submit the output of 'jmx4perl list' and 'jmx4perl attributes' to\n" .
46             "roland\@cpan.de in order to provide a new product handler in the next release\n";
47             }
48              
49             sub autodetect {
50             # Since we are the last one in the chain, we will be the one 'found'
51 0     0 1   return 1;
52             }
53              
54             sub version {
55 0     0 1   return "";
56             }
57              
58             sub jsr77 {
59 0     0 1   return 0;
60             }
61              
62              
63             =head1 LICENSE
64              
65             This file is part of jmx4perl.
66              
67             Jmx4perl is free software: you can redistribute it and/or modify
68             it under the terms of the GNU General Public License as published by
69             the Free Software Foundation, either version 2 of the License, or
70             (at your option) any later version.
71              
72             jmx4perl is distributed in the hope that it will be useful,
73             but WITHOUT ANY WARRANTY; without even the implied warranty of
74             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75             GNU General Public License for more details.
76              
77             You should have received a copy of the GNU General Public License
78             along with jmx4perl. If not, see .
79              
80             A commercial license is available as well. Please contact roland@cpan.org for
81             further details.
82              
83             =head1 AUTHOR
84              
85             roland@cpan.org
86              
87             =cut
88              
89             1;