KickJava   Java API By Example, From Geeks To Geeks.

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


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/StringStatisticImpl.java,v 1.4 2006/03/09 20:30:29 llc Exp $
26  * $Revision: 1.4 $
27  * $Date: 2006/03/09 20:30:29 $
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
37 import com.sun.appserv.management.util.jmx.OpenMBeanUtil;
38
39 import com.sun.appserv.management.j2ee.statistics.StatisticImpl;
40
41 /**
42     
43  */

44 public final class StringStatisticImpl
45     extends StatisticImpl implements StringStatistic, Serializable JavaDoc
46 {
47     static final long serialVersionUID = 2090185734375468511L;
48     
49     private final String JavaDoc mCurrent;
50     
51         public
52     StringStatisticImpl( final CompositeData JavaDoc compositeData )
53     {
54         this( OpenMBeanUtil.compositeDataToMap( compositeData ) );
55     }
56     
57         public
58     StringStatisticImpl( final Map JavaDoc<String JavaDoc,?> m )
59     {
60         this( new MapStatisticImpl( m ) );
61     }
62     
63         public
64     StringStatisticImpl( final StringStatistic s )
65     {
66         super( s );
67         
68         mCurrent = s.getCurrent();
69     }
70     
71         public
72     StringStatisticImpl( final MapStatistic m )
73     {
74         super( m );
75         
76         mCurrent = m.getString( "Current" );
77     }
78     
79         public
80     StringStatisticImpl(
81         final String JavaDoc name,
82         final String JavaDoc description,
83         final String JavaDoc unit,
84         final long startTime,
85         final long lastSampleTime,
86         final String JavaDoc current )
87     {
88         super( name, description, unit, startTime, lastSampleTime );
89         mCurrent = current;
90     }
91
92
93         public String JavaDoc
94     getCurrent()
95     {
96         return( mCurrent );
97     }
98 }
99
100
101
102
103
104
Popular Tags