blib/lib/JMX/Jmx4Perl/Product/Glassfish.pm

filter: Statementstmt 48.2% 14 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 100% 7 / 7 totaltotal 50.9% 26 / 51 CC 3 SCAR 13.7
CC
3
Cov
42%
version
12.0
name
2.0
vendor
2.0
CRAP 3.9
« blib/lib/JMX/Jmx4Perl/Product/Jetty.pm ↑ Summary blib/lib/JMX/Jmx4Perl/J4psh/Command/Server.pm »
1 #!/usr/bin/perl
2 package JMX::Jmx4Perl::Product::Glassfish;
3  
4 2 ▶use JMX::Jmx4Perl::Product::BaseHandler;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use base "JMX::Jmx4Perl::Product::BaseHandler";
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
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<https://glassfish.dev.java.net/>)
18  
19 =cut
20  
21 sub id {
22 2 ▶ return "glassfish";
Subroutine id: called CC=1 SCAR=0.0
Pod documented
23 }
24  
25 sub name {
26 0 ▶ return "Glassfish";
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
27 }
28  
29 sub version {
30 0 ▶ my $self = shift;
Subroutine version: not called CC=3 SCAR=24.8
Pod documented
31 0 my $version = $self->_version_or_vendor("version",qr/([\d\.]+)/m);
32 0 ▶ return $version if $version;
Branch: 1 branch
BranchTrueFalseTotal
if $version 0 0 0
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 ▶ if ($servers) {
Branch: 1 branch
BranchTrueFalseTotal
if ($servers) 0 0 0
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 ▶ return "Oracle";
Subroutine vendor: not called CC=1 SCAR=6.9
Pod documented
48 }
49  
50 sub autodetect_pattern {
51 0 ▶ return (shift->original_version_sub,qr/GlassFish/i);
Subroutine autodetect_pattern: not called CC=1 SCAR=6.9
Pod documented
52 }
53  
54 sub jsr77 {
55 0 ▶ return 1;
Subroutine jsr77: not called CC=1 SCAR=6.9
Pod documented
56 }
57  
58 sub init_aliases {
59 return
60 {
61 0 ▶ attributes =>
Subroutine init_aliases: not called CC=1 SCAR=6.9
Pod documented
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 <http://www.gnu.org/licenses/>.
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 2 1;
« blib/lib/JMX/Jmx4Perl/Product/Jetty.pm ↑ Summary blib/lib/JMX/Jmx4Perl/J4psh/Command/Server.pm »