File Coverage

blib/lib/JMX/Jmx4Perl/Product/Glassfish.pm
Criterion Covered Total %
statement 13 28 46.4
branch 0 4 0.0
condition n/a
subroutine 5 11 45.4
pod 7 7 100.0
total 25 50 50.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2             package JMX::Jmx4Perl::Product::Glassfish;
3              
4 3     3   16 use JMX::Jmx4Perl::Product::BaseHandler;
  3         6  
  3         71  
5 3     3   15 use strict;
  3         6  
  3         91  
6 3     3   17 use base "JMX::Jmx4Perl::Product::BaseHandler";
  3         8  
  3         248  
7              
8 3     3   14 use Carp qw(croak);
  3         5  
  3         954  
9              
10             =head1 NAME
11              
12             JMX::Jmx4Perl::Product::Glassfish - Handler for Glassfish
13              
14             =head1 DESCRIPTION
15              
16             This handler supports glassfish up to version 3.1
17             (L)
18              
19             =cut
20              
21             sub id {
22 3     3 1 21 return "glassfish";
23             }
24              
25             sub name {
26 0     0 1   return "Glassfish";
27             }
28              
29             sub version {
30 0     0 1   my $self = shift;
31 0           my $version = $self->_version_or_vendor("version",qr/([\d\.]+)/m);
32 0 0         return $version if $version;
33            
34             # Try for Glassfish V3
35 0           my $jmx = $self->{jmx4perl};
36              
37 0           my $servers = $jmx->search("com.sun.appserv:type=Host,*");
38 0 0         if ($servers) {
39 0           $self->{"original_version"} = "GlassFish V3";
40 0           $self->{"version"} = "3";
41 0           return "3";
42             }
43 0           return undef;
44             }
45              
46             sub vendor {
47 0     0 1   return "Oracle";
48             }
49              
50             sub autodetect_pattern {
51 0     0 1   return (shift->original_version_sub,qr/GlassFish/i);
52             }
53              
54             sub jsr77 {
55 0     0 1   return 1;
56             }
57              
58             sub init_aliases {
59             return
60             {
61 0     0 1   attributes =>
62             {
63             },
64             operations =>
65             {
66             THREAD_DUMP => [ "com.sun.appserv:category=monitor,server=server,type=JVMInformation", "getThreadDump"]
67             }
68             # Alias => [ "mbean", "attribute", "path" ]
69             };
70             }
71              
72              
73             =head1 LICENSE
74              
75             This file is part of jmx4perl.
76              
77             Jmx4perl is free software: you can redistribute it and/or modify
78             it under the terms of the GNU General Public License as published by
79             the Free Software Foundation, either version 2 of the License, or
80             (at your option) any later version.
81              
82             jmx4perl is distributed in the hope that it will be useful,
83             but WITHOUT ANY WARRANTY; without even the implied warranty of
84             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
85             GNU General Public License for more details.
86              
87             You should have received a copy of the GNU General Public License
88             along with jmx4perl. If not, see .
89              
90             A commercial license is available as well. Please contact roland@cpan.org for
91             further details.
92              
93             =head1 AUTHOR
94              
95             roland@cpan.org
96              
97             =cut
98              
99             1;