KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > stats > BoundaryStatisticImpl


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  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28
29 /*
30  * $Id: BoundaryStatisticImpl.java,v 1.2 2005/12/25 03:52:10 tcfujii Exp $
31  * $Date: 2005/12/25 03:52:10 $
32  * $Revision: 1.2 $
33  */

34
35 package com.sun.enterprise.admin.monitor.stats;
36 import javax.management.j2ee.statistics.BoundaryStatistic JavaDoc;
37
38 /** An implementation of a BoundaryStatistic. All instances of this class are
39  * immutable. Provides all the necessary accessors for properties.
40  * @author Muralidhar Vempaty
41  * @author Kedar Mhaswade
42  * @since S1AS8.0
43  * @verison 1.0
44  */

45
46 public final class BoundaryStatisticImpl extends StatisticImpl implements BoundaryStatistic JavaDoc {
47     
48     private final long lowerBound;
49     private final long upperBound;
50     
51     /** Constructs the instance of BoundaryStatistic that is immutable.
52      * @param upper The upper limit of this statistic
53      * @param lower The lower limit of this statistic
54      * @param name The name of the statistic
55      * @param unit The unit of measurement for this statistic
56      * @param desc A brief description of the statistic
57      * @param startTime Time in milliseconds at which the measurement was started
58      * @param sampleTime Time at which the last measurement was done.
59      */

60     public BoundaryStatisticImpl(long lower, long upper, String JavaDoc name,
61                                  String JavaDoc unit, String JavaDoc desc, long startTime,
62                                  long sampleTime) {
63         
64         super(name, unit, desc, startTime, sampleTime);
65         upperBound = upper;
66         lowerBound = lower;
67     }
68     
69     /**
70      * Returns the lowest possible value, that this statistic is permitted to attain
71      * @return long the lowest permissible value
72      */

73     public long getLowerBound() {
74         return lowerBound;
75     }
76     
77     /**
78      * Return the highest possible value, that this statistic is permitted to attain
79      * @return long the highest permissible value
80      */

81     public long getUpperBound() {
82         return upperBound;
83     }
84 }
85
Popular Tags