KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > appserv > management > j2ee > statistics > BoundedRangeStatisticImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23  
24 /*
25  * $Header: /cvs/glassfish/admin-core/mbeanapi/src/java/com/sun/appserv/management/j2ee/statistics/BoundedRangeStatisticImpl.java,v 1.4 2006/03/09 20:30:28 llc Exp $
26  * $Revision: 1.4 $
27  * $Date: 2006/03/09 20:30:28 $
28  */

29
30 package com.sun.appserv.management.j2ee.statistics;
31
32 import java.util.Map JavaDoc;
33 import java.io.Serializable JavaDoc;
34
35 import javax.management.openmbean.CompositeData JavaDoc;
36 import javax.management.j2ee.statistics.BoundedRangeStatistic JavaDoc;
37
38 import com.sun.appserv.management.util.jmx.OpenMBeanUtil;
39
40 /**
41     Serializable implementation of a BoundedRangeStatistic
42  */

43 public class BoundedRangeStatisticImpl extends RangeStatisticImpl
44     implements BoundedRangeStatistic JavaDoc, Serializable JavaDoc
45 {
46     static final long serialVersionUID = 4803476800834526575L;
47     
48     private long LowerBound;
49     private long UpperBound;
50     
51     
52         public
53     BoundedRangeStatisticImpl(
54         final String JavaDoc name,
55         final String JavaDoc description,
56         final String JavaDoc unit,
57         final long startTime,
58         final long lastSampleTime,
59         final long low,
60         final long current,
61         final long high,
62         final long lowerBound,
63         final long upperBound )
64     {
65         super( name, description, unit, startTime, lastSampleTime, low, current, high );
66         
67         if ( lowerBound > upperBound )
68         {
69             throw new IllegalArgumentException JavaDoc();
70         }
71         
72         LowerBound = lowerBound;
73         UpperBound = UpperBound;
74     }
75     
76         public
77     BoundedRangeStatisticImpl( final CompositeData JavaDoc compositeData )
78     {
79         this( OpenMBeanUtil.compositeDataToMap( compositeData ) );
80     }
81     
82         public
83     BoundedRangeStatisticImpl( final Map JavaDoc<String JavaDoc,?> m )
84     {
85         this( new MapStatisticImpl( m ) );
86     }
87     
88         public
89     BoundedRangeStatisticImpl( final MapStatistic s )
90     {
91         super( s );
92         
93         LowerBound = s.getlong( "LowerBound" );
94         UpperBound = s.getlong( "UpperBound" );
95     }
96     
97         public
98     BoundedRangeStatisticImpl( final BoundedRangeStatistic JavaDoc s )
99     {
100         super( s );
101         
102         LowerBound = s.getLowerBound();
103         UpperBound = s.getUpperBound();
104     }
105     
106         public long
107     getLowerBound()
108     {
109         return( LowerBound );
110     }
111     
112         public long
113     getUpperBound()
114     {
115         return( UpperBound );
116     }
117 }
118
119
120
121
122
123
Popular Tags