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
« Jmx4Perl/Product/Jetty.pm ↑ Summary Jmx4Perl/J4psh/Command/Server.pm »
1 #!/usr/bin/perl
2 package JMX::Jmx4Perl::Product::Glassfish;
3  
4 4 ▶use JMX::Jmx4Perl::Product::BaseHandler;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use base "JMX::Jmx4Perl::Product::BaseHandler";
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶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 4 ▶sub id {
Subroutine id: called CC=1 SCAR=0.0
Pod documented
22 4 return "glassfish";
23 }
24  
25 0 ▶sub name {
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
26 0 return "Glassfish";
27 }
28  
29 0 ▶sub version {
Subroutine version: not called CC=3 SCAR=24.8
Pod documented
30 0 my $self = shift;
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 0 ▶sub vendor {
Subroutine vendor: not called CC=1 SCAR=6.9
Pod documented
47 0 return "Oracle";
48 }
49  
50 0 ▶sub autodetect_pattern {
Subroutine autodetect_pattern: not called CC=1 SCAR=6.9
Pod documented
51 0 return (shift->original_version_sub,qr/GlassFish/i);
52 }
53  
54 0 ▶sub jsr77 {
Subroutine jsr77: not called CC=1 SCAR=6.9
Pod documented
55 0 return 1;
56 }
57  
58 0 ▶sub init_aliases {
Subroutine init_aliases: not called CC=1 SCAR=6.9
Pod documented
59 return
60 {
61 0 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 <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 4 1;
« Jmx4Perl/Product/Jetty.pm ↑ Summary Jmx4Perl/J4psh/Command/Server.pm »