Jennifer,
> statsMap =
> ((StatisticImpl)Proxy.getInvocationHandler(value)).getStaticAsMap();
Is this a spelling error? "Static" meaning "Statistic(s)"?
Lloyd
On Jul 30, 2009, at 4:44 PM, Jennifer Chou wrote:
> Tomorrow Fri 7/31, I'm planning to complete Part 2 of the
> integration to the external maven module, management-api, for
> monitoring.
> This includes...
> - removing Statistic API from glassfish-api
> - removing gmbal dependency from glassfish-api
> - removing gfprobe-provider-client.jar from glassfish-nucleus package
>
> Attached are diffs, including POM changes.
> Issue: https://glassfish.dev.java.net/issues/show_bug.cgi?id=8733
>
> External modules which still use gfprobe-provider-client.jar will
> need to move to the new management-api.
>
> Please let me know if there are any issues.
>
> Thanks,
> Jennifer
> Index: core/kernel/src/main/java/com/sun/enterprise/v3/admin/
> GetCommand.java
> ===================================================================
> --- core/kernel/src/main/java/com/sun/enterprise/v3/admin/
> GetCommand.java (revision 29968)
> +++ core/kernel/src/main/java/com/sun/enterprise/v3/admin/
> GetCommand.java (working copy)
> @@ -58,8 +58,8 @@
> import java.util.List;
> import java.util.Map;
> import java.util.TreeMap;
> -//import org.glassfish.external.statistics.Statistic;
> -//import org.glassfish.external.statistics.impl.StatisticImpl;
> +import org.glassfish.external.statistics.Statistic;
> +import org.glassfish.external.statistics.impl.StatisticImpl;
>
> /**
> * User: Jerome Dochez
> @@ -198,32 +198,19 @@
> private void insertNameValuePairs(TreeMap map,
> org.glassfish.flashlight.datatree.TreeNode tn1){
> String name = tn1.getCompletePathName();
> Object value = tn1.getValue();
> - if (value instanceof
> org.glassfish.external.statistics.Statistic) {
> + if (value instanceof Statistic) {
> Map<String,Object> statsMap;
> // Most likely we will get the proxy of the StatisticImpl,
> // reconvert that so you can access getStatisticAsMap
> method
> if (Proxy.isProxyClass(value.getClass())) {
> - statsMap =
> ((org
> .glassfish
> .external
> .statistics
> .impl
> .StatisticImpl)Proxy.getInvocationHandler(value)).getStaticAsMap();
> } else {
> - statsMap =
> ((org
> .glassfish
> .external.statistics.impl.StatisticImpl)value).getStaticAsMap();
> + statsMap = ((StatisticImpl)value).getStaticAsMap();
> }
> for (String attrName : statsMap.keySet()) {
> Object attrValue = statsMap.get(attrName);
> map.put(name + "-" + attrName, attrValue);
> }
> - } else if (value instanceof
> org.glassfish.api.statistics.Statistic) { //Remove when external
> modules have moved to management-api
> - Map<String,Object> statsMap;
> - // Most likely we will get the proxy of the
> StatisticImpl,
> - // reconvert that so you can access getStatisticAsMap
> method
> - if (Proxy.isProxyClass(value.getClass())) {
> - statsMap =
> ((org
> .glassfish
> .api
> .statistics
> .impl
> .StatisticImpl)Proxy.getInvocationHandler(value)).getStaticAsMap();
> - } else {
> - statsMap =
> ((org
> .glassfish.api.statistics.impl.StatisticImpl)value).getStaticAsMap();
> - }
> - for (String attrName : statsMap.keySet()) {
> - Object attrValue = statsMap.get(attrName);
> - map.put(name + "-" + attrName, attrValue);
> - }
> } else {
> map.put(name, value);
> }
> Index: packager/glassfish-nucleus/pom.xml
> ===================================================================
> --- packager/glassfish-nucleus/pom.xml (revision 29968)
> +++ packager/glassfish-nucleus/pom.xml (working copy)
> @@ -152,13 +152,7 @@
> <version>3.0-Prelude</version>
> <type>distribution-fragment</type>
> </dependency>
> - <!-- Remove gfprobe-provider-client when all external
> modules are using management-api instead -->
> <dependency>
> - <groupId>org.glassfish.provider</groupId>
> - <artifactId>gfprobe-provider-client</artifactId>
> - <version>3.0.0-b008</version>
> - </dependency>
> - <dependency>
> <groupId>org.glassfish.external</groupId>
> <artifactId>management-api</artifactId>
> </dependency>
> Index: flashlight/framework/src/main/java/org/glassfish/flashlight/
> impl/provider/FlashlightProbeProviderFactory.java
> ===================================================================
> --- flashlight/framework/src/main/java/org/glassfish/flashlight/impl/
> provider/FlashlightProbeProviderFactory.java (revision 29968)
> +++ flashlight/framework/src/main/java/org/glassfish/flashlight/impl/
> provider/FlashlightProbeProviderFactory.java (working copy)
> @@ -42,8 +42,6 @@
> import org.glassfish.flashlight.provider.ProbeProviderFactory;
> import org.jvnet.hk2.annotations.Service;
> import org.jvnet.hk2.annotations.Inject;
> -//REMOVE: Remove old probe.provider package when management-api
> integration complete with external modules
> -import org.glassfish.probe.provider.annotations.*;
> import org.glassfish.external.probe.provider.annotations.*;
>
> import java.lang.annotation.Annotation;
> @@ -87,22 +85,11 @@
> public <T> T getProbeProvider(Class<T> providerClazz)
> throws InstantiationException, IllegalAccessException {
> //TODO: check for null and generate default names
> -
> org.glassfish.external.probe.provider.annotations.ProbeProvider
> provAnn =
> providerClazz
> .getAnnotation
> (org
> .glassfish.external.probe.provider.annotations.ProbeProvider.class);
> - if (provAnn != null) {
> - return getProbeProvider(provAnn.moduleProviderName(),
> provAnn.moduleName(),
> + ProbeProvider provAnn =
> providerClazz.getAnnotation(ProbeProvider.class);
> +
> + return getProbeProvider(provAnn.moduleProviderName(),
> provAnn.moduleName(),
> provAnn.probeProviderName(),
> providerClazz);
> - } else {
> - //REMOVE: Remove old probe.provider package when
> management-api integration complete with external modules
> - org.glassfish.probe.provider.annotations.ProbeProvider
> provAnnOLD =
> providerClazz
> .getAnnotation
> (org.glassfish.probe.provider.annotations.ProbeProvider.class);
> - return
> getProbeProvider(provAnnOLD.moduleProviderName(),
> provAnnOLD.moduleName(),
> - provAnnOLD.probeProviderName(),
> - providerClazz);
> - }
> -
> - //return getProbeProvider(provAnn.moduleProviderName(),
> provAnn.moduleName(),
> - // provAnn.probeProviderName(),
> - // providerClazz);
> }
>
> public <T> T getProbeProvider(String moduleProviderName, String
> moduleName,
> @@ -117,37 +104,19 @@
> // + "\tProbeProviderName= " + probeProviderName +
> "\tProviderClazz= " + providerClazz.toString());
> for (Method m : providerClazz.getDeclaredMethods()) {
> int sz = m.getParameterTypes().length;
> - String probeName = null;
> -
> org.glassfish.external.probe.provider.annotations.Probe pnameAnn =
> -
> m
> .getAnnotation
> (org.glassfish.external.probe.provider.annotations.Probe.class);
> - if (pnameAnn != null) {
> - probeName = (pnameAnn != null)
> + Probe pnameAnn = m.getAnnotation(Probe.class);
> + String probeName = (pnameAnn != null)
> ? pnameAnn.name() : m.getName();
> - } else {
> - //REMOVE: Remove old probe.provider package
> when management-api integration complete with external modules
> - org.glassfish.probe.provider.annotations.Probe
> pnameAnnOLD =
> -
> m.getAnnotation(org.glassfish.probe.provider.annotations.Probe.class);
> - probeName = (pnameAnnOLD != null)
> - ? pnameAnnOLD.name() : m.getName();
> - }
> - //String probeName = (pnameAnn != null)
> - // ? pnameAnn.name() : m.getName();
> String[] probeParamNames = new String[sz];
> int index = 0;
> Annotation[][] anns2 = m.getParameterAnnotations();
> for (Annotation[] ann1 : anns2) {
> for (Annotation ann : ann1) {
> - if (ann instanceof
> org.glassfish.external.probe.provider.annotations.ProbeParam) {
> -
> org.glassfish.external.probe.provider.annotations.ProbeParam pParam
> = (org.glassfish.external.probe.provider.annotations.ProbeParam) ann;
> + if (ann instanceof ProbeParam) {
> + ProbeParam pParam = (ProbeParam) ann;
> probeParamNames[index++] = pParam.value();
> break;
> }
> - //REMOVE: Remove old probe.provider package
> when management-api integration complete with external modules
> - if (ann instanceof
> org.glassfish.probe.provider.annotations.ProbeParam) {
> -
> org.glassfish.probe.provider.annotations.ProbeParam pParam =
> (org.glassfish.probe.provider.annotations.ProbeParam) ann;
> - probeParamNames[index++] =
> pParam.value();
> - break;
> - }
> }
> }
>
> Index: flashlight/agent/pom.xml
> ===================================================================
> --- flashlight/agent/pom.xml (revision 29968)
> +++ flashlight/agent/pom.xml (working copy)
> @@ -49,13 +49,7 @@
> <packaging>hk2-jar</packaging>
> <name>GlassFish Flashlight Agent</name>
> <dependencies>
> - <!-- Remove gfprobe-provider-client when all external
> modules are using management-api instead -->
> <dependency>
> - <groupId>org.glassfish.provider</groupId>
> - <artifactId>gfprobe-provider-client</artifactId>
> - <version>3.0.0-b008</version>
> - </dependency>
> - <dependency>
> <groupId>org.glassfish.external</groupId>
> <artifactId>management-api</artifactId>
> </dependency>
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/CountStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> CountStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> CountStatistic.java (working copy)
> @@ -1,52 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * Specifies standard count measurements.
> - */
> -_at_ManagedData
> -public interface CountStatistic extends Statistic {
> - /**
> - * The count since the last reset.
> - */
> - @ManagedAttribute
> - long getCount();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/StringStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/StringStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/StringStatisticImpl.java (working copy)
> @@ -1,101 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.StringStatistic;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public class StringStatisticImpl extends StatisticImpl
> - implements StringStatistic, InvocationHandler {
> -
> - private String str = null;
> -
> - private StringStatistic ss = (StringStatistic)
> Proxy.newProxyInstance(
> - StringStatistic.class.getClassLoader(),
> - new Class[] { StringStatistic.class },
> - this);
> -
> - public StringStatisticImpl(String str, String name, String unit,
> - String desc, long sampleTime, long
> startTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - this.str = str;
> - }
> -
> - public StringStatisticImpl(String name, String unit, String
> desc) {
> - super(name, unit, desc);
> - }
> -
> - public synchronized StringStatistic getStatistic() {
> - return ss;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("name-current", getCurrent());
> - return m;
> - }
> -
> - public String toString() {
> - return super.toString() + NEWLINE + "Current-value: " +
> getCurrent();
> - }
> -
> - public String getCurrent() {
> - return str;
> - }
> -
> - public void setCurrent(String str) {
> - this.str = str;
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/CountStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/CountStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/CountStatisticImpl.java (working copy)
> @@ -1,118 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.CountStatistic;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public class CountStatisticImpl extends StatisticImpl
> - implements CountStatistic, InvocationHandler {
> -
> - private AtomicLong count = new AtomicLong();
> -
> - private CountStatistic cs = (CountStatistic)
> Proxy.newProxyInstance(
> - CountStatistic.class.getClassLoader(),
> - new Class[] { CountStatistic.class },
> - this);
> -
> - public CountStatisticImpl(long countVal, String name, String
> unit,
> - String desc, long sampleTime, long
> startTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - count.set(countVal);
> - }
> -
> - public CountStatisticImpl(String name, String unit, String
> desc) {
> - super(name, unit, desc);
> - }
> -
> - public CountStatisticImpl(String name, String desc) {
> - super(name, "count", desc);
> - }
> -
> - public synchronized CountStatistic getStatistic() {
> - return cs;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("count", getCount());
> - return m;
> - }
> -
> - public String toString() {
> - return super.toString() + NEWLINE + "Count: " + getCount();
> - }
> -
> - public long getCount() {
> - return count.get();
> - }
> -
> - public void setCount(long countVal) {
> - count.set(countVal);
> - }
> -
> - public void increment() {
> - count.incrementAndGet();
> - }
> -
> - public void increment(long delta) {
> - count.addAndGet(delta);
> - }
> -
> - public void decrement() {
> - count.decrementAndGet();
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/RangeStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/RangeStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/RangeStatisticImpl.java (working copy)
> @@ -1,130 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.RangeStatistic;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public final class RangeStatisticImpl extends StatisticImpl
> - implements RangeStatistic, InvocationHandler {
> -
> - private AtomicLong currentVal = new AtomicLong(Long.MIN_VALUE);
> - private AtomicLong highWaterMark = new
> AtomicLong(Long.MIN_VALUE);
> - private AtomicLong lowWaterMark = new AtomicLong(Long.MIN_VALUE);
> -
> - private RangeStatistic rs = (RangeStatistic)
> Proxy.newProxyInstance(
> - RangeStatistic.class.getClassLoader(),
> - new Class[] { RangeStatistic.class },
> - this);
> -
> - public RangeStatisticImpl(long curVal, long highMark, long
> lowMark,
> - String name, String unit, String desc,
> - long startTime, long sampleTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - currentVal.set(curVal);
> - highWaterMark.set(highMark);
> - lowWaterMark.set(lowMark);
> - }
> -
> - public synchronized RangeStatistic getStatistic() {
> - return rs;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("current", getCurrent());
> - m.put("lowwatermark", getLowWaterMark());
> - m.put("highwatermark", getHighWaterMark());
> - return m;
> - }
> -
> - public long getCurrent() {
> - return currentVal.get();
> - }
> -
> - public void setCurrent(long curVal) {
> - currentVal.set(curVal);
> - }
> -
> - /**
> - * Returns the highest value of this statistic, since
> measurement started.
> - */
> - public long getHighWaterMark() {
> - return highWaterMark.get();
> - }
> -
> - public void setHighWaterMark(long highMark) {
> - highWaterMark.set(highMark);
> - }
> -
> - /**
> - * Returns the lowest value of this statistic, since
> measurement started.
> - */
> - public long getLowWaterMark() {
> - return lowWaterMark.get();
> - }
> -
> - public void setLowWaterMark(long lowMark) {
> - lowWaterMark.set(lowMark);
> - }
> -
> - public final String toString() {
> - return super.toString() + NEWLINE +
> - "Current: " + getCurrent() + NEWLINE +
> - "LowWaterMark: " + getLowWaterMark() + NEWLINE +
> - "HighWaterMark: " + getHighWaterMark();
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/BoundedRangeStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/BoundedRangeStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/BoundedRangeStatisticImpl.java (working copy)
> @@ -1,150 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.BoundedRangeStatistic;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public final class BoundedRangeStatisticImpl extends StatisticImpl
> - implements BoundedRangeStatistic, InvocationHandler {
> -
> - private AtomicLong lowerBound = new AtomicLong(0L);
> - private AtomicLong upperBound = new AtomicLong(0L);
> - private AtomicLong currentVal = new AtomicLong(Long.MIN_VALUE);
> - private AtomicLong highWaterMark = new
> AtomicLong(Long.MIN_VALUE);
> - private AtomicLong lowWaterMark = new AtomicLong(Long.MIN_VALUE);
> -
> - private BoundedRangeStatistic bs = (BoundedRangeStatistic)
> Proxy.newProxyInstance(
> - BoundedRangeStatistic.class.getClassLoader(),
> - new Class[] { BoundedRangeStatistic.class },
> - this);
> -
> - public String toString() {
> - return super.toString() + NEWLINE +
> - "Current: " + getCurrent() + NEWLINE +
> - "LowWaterMark: " + getLowWaterMark() + NEWLINE +
> - "HighWaterMark: " + getHighWaterMark() + NEWLINE +
> - "LowerBound: " + getLowerBound() + NEWLINE +
> - "UpperBound: " + getUpperBound();
> - }
> -
> -
> - public BoundedRangeStatisticImpl(long curVal, long highMark,
> long lowMark,
> - long upper, long lower, String
> name,
> - String unit, String desc, long
> startTime,
> - long sampleTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - currentVal.set(curVal);
> - highWaterMark.set(highMark);
> - lowWaterMark.set(lowMark);
> - upperBound.set(upper);
> - lowerBound.set(lower);
> - }
> -
> - public synchronized BoundedRangeStatistic getStatistic() {
> - return bs;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("current", getCurrent());
> - m.put("lowerbound", getLowerBound());
> - m.put("upperbound", getUpperBound());
> - m.put("lowwatermark", getLowWaterMark());
> - m.put("highwatermark", getHighWaterMark());
> - return m;
> - }
> -
> - public long getCurrent() {
> - return currentVal.get();
> - }
> -
> - public void setCurrent(long curVal) {
> - currentVal.set(curVal);
> - }
> - public long getHighWaterMark() {
> - return highWaterMark.get();
> - }
> -
> - public void setHighWaterMark(long highMark) {
> - highWaterMark.set(highMark);
> - }
> - public long getLowWaterMark() {
> - return lowWaterMark.get();
> - }
> -
> - public void setLowWaterMark(long lowMark) {
> - lowWaterMark.set(lowMark);
> - }
> - public long getLowerBound() {
> - return lowerBound.get();
> - }
> -
> - public void setLowerBound(long lower) {
> - lowerBound.set(lower);
> - }
> - /**
> - * Returns the highest possible value, that this statistic is
> permitted to attain.
> - */
> - public long getUpperBound() {
> - return upperBound.get();
> - }
> -
> - public void setUpperBound(long upper) {
> - upperBound.set(upper);
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/TimeStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/TimeStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/TimeStatisticImpl.java (working copy)
> @@ -1,152 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.TimeStatistic;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public class TimeStatisticImpl extends StatisticImpl
> - implements TimeStatistic, InvocationHandler {
> -
> - private AtomicLong count = new AtomicLong(Long.MIN_VALUE);
> - private final long timeNow = System.currentTimeMillis();
> - private AtomicLong maxTime = new AtomicLong(timeNow);
> - private AtomicLong minTime = new AtomicLong(timeNow);
> - private AtomicLong totTime = new AtomicLong(0L);
> -
> - private TimeStatistic ts = (TimeStatistic)
> Proxy.newProxyInstance(
> - TimeStatistic.class.getClassLoader(),
> - new Class[] { TimeStatistic.class },
> - this);
> -
> - public final String toString() {
> - return super.toString() + NEWLINE +
> - "Count: " + getCount() + NEWLINE +
> - "MinTime: " + getMinTime() + NEWLINE +
> - "MaxTime: " + getMaxTime() + NEWLINE +
> - "TotalTime: " + getTotalTime();
> - }
> -
> - public TimeStatisticImpl(long counter, long maximumTime, long
> minimumTime,
> - long totalTime, String name, String
> unit,
> - String desc, long startTime, long
> sampleTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - count.set(counter);
> - maxTime.set(maximumTime);
> - minTime.set(minimumTime);
> - totTime.set(totalTime);
> - }
> -
> - public synchronized TimeStatistic getStatistic() {
> - return ts;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("count", getCount());
> - m.put("maxtime", getMaxTime());
> - m.put("mintime", getMinTime());
> - m.put("totaltime", getTotalTime());
> - return m;
> - }
> -
> - /**
> - * Returns the number of times an operation was invoked
> - */
> - public long getCount() {
> - return count.get();
> - }
> -
> - public void setCount(long counter) {
> - count.set(counter);
> - }
> -
> - /**
> - * Returns the maximum amount of time that it took for one
> invocation of an
> - * operation, since measurement started.
> - */
> - public long getMaxTime() {
> - return maxTime.get();
> - }
> -
> - public void setMaxTime(long maximumTime) {
> - maxTime.set(maximumTime);
> - }
> -
> - /**
> - * Returns the minimum amount of time that it took for one
> invocation of an
> - * operation, since measurement started.
> - */
> - public long getMinTime() {
> - return minTime.get();
> - }
> -
> - public void setMinTime(long minimumTime) {
> - minTime.set(minimumTime);
> - }
> -
> - /**
> - * Returns the amount of time that it took for all invocations,
> - * since measurement started.
> - */
> - public long getTotalTime() {
> - return totTime.get();
> - }
> -
> - public void setTotalTime(long totalTime) {
> - totTime.set(totalTime);
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/StatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/StatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/StatisticImpl.java (working copy)
> @@ -1,136 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.Statistic;
> -import java.io.Serializable;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.util.concurrent.ConcurrentHashMap;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public abstract class StatisticImpl implements
> Statistic,Serializable {
> -
> - private String statisticDesc = "description";
> - private AtomicLong sampleTime = new
> AtomicLong(System.currentTimeMillis());
> - private String statisticName = "name";
> - private AtomicLong startTime = new
> AtomicLong(System.currentTimeMillis());
> - private String statisticUnit = "unit";
> - public static final String UNIT_COUNT = "count";
> - public static final String UNIT_SECOND = "second";
> - public static final String UNIT_MILLISECOND = "millisecond";
> - public static final String UNIT_MICROSECOND = "microsecond";
> - public static final String UNIT_NANOSECOND = "nanosecond";
> -
> - protected Map<String, Object> statMap = new
> ConcurrentHashMap<String, Object> ();
> -
> - protected static final String NEWLINE =
> System.getProperty( "line.separator" );
> -
> - protected StatisticImpl(String name, String unit, String desc,
> - long start_time, long sample_time) {
> - statisticName = name;
> - statisticUnit = unit;
> - statisticDesc = desc;
> - startTime.set(start_time);
> - sampleTime.set(sample_time);
> - }
> -
> - protected StatisticImpl(String name, String unit, String desc) {
> - statisticName = name;
> - statisticUnit = unit;
> - statisticDesc = desc;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - statMap.put("name", statisticName);
> - statMap.put("unit", statisticUnit);
> - statMap.put("description", statisticDesc);
> - statMap.put("starttime", startTime.get());
> - statMap.put("lastsampletime", sampleTime.get());
> - return statMap;
> - }
> -
> - public String getName() {
> - return this.statisticName;
> - }
> -
> - public synchronized void setName(String name) {
> - this.statisticName = name;
> - }
> -
> - public String getDescription() {
> - return this.statisticDesc;
> - }
> -
> - public synchronized void setDescription(String desc) {
> - this.statisticDesc = desc;
> - }
> -
> - public String getUnit() {
> - return this.statisticUnit;
> - }
> -
> - public synchronized void setUnit(String unit) {
> - this.statisticUnit = unit;
> - }
> -
> - public long getLastSampleTime() {
> - return sampleTime.get();
> - }
> -
> - public void setLastSampleTime(long sample_time) {
> - sampleTime.set(sample_time);
> - }
> -
> - public long getStartTime() {
> - return startTime.get();
> - }
> -
> - public void setStartTime(long start_time) {
> - startTime.set(start_time);
> - }
> -
> - public String toString() {
> - return "Statistic " + getClass().getName() + NEWLINE +
> - "Name: " + getName() + NEWLINE +
> - "Description: " + getDescription() + NEWLINE +
> - "Unit: " + getUnit() + NEWLINE +
> - "LastSampleTime: " + getLastSampleTime() + NEWLINE +
> - "StartTime: " + getStartTime();
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/impl/BoundaryStatisticImpl.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/BoundaryStatisticImpl.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> impl/BoundaryStatisticImpl.java (working copy)
> @@ -1,106 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics.impl;
> -import org.glassfish.api.statistics.BoundaryStatistic;
> -import java.util.concurrent.atomic.AtomicLong;
> -import java.util.Map;
> -import java.lang.reflect.*;
> -
> -/**
> - * @author Sreenivas Munnangi
> - */
> -public final class BoundaryStatisticImpl extends StatisticImpl
> - implements BoundaryStatistic, InvocationHandler {
> -
> - private AtomicLong lowerBound = new AtomicLong(0L);
> - private AtomicLong upperBound = new AtomicLong(0L);
> -
> - private BoundaryStatistic bs = (BoundaryStatistic)
> Proxy.newProxyInstance(
> - BoundaryStatistic.class.getClassLoader(),
> - new Class[] { BoundaryStatistic.class },
> - this);
> -
> - public BoundaryStatisticImpl(long lower, long upper, String name,
> - String unit, String desc, long
> startTime,
> - long sampleTime) {
> - super(name, unit, desc, startTime, sampleTime);
> - upperBound.set(upper);
> - lowerBound.set(lower);
> - }
> -
> - public synchronized BoundaryStatistic getStatistic() {
> - return bs;
> - }
> -
> - public synchronized Map getStaticAsMap() {
> - Map m = super.getStaticAsMap();
> - m.put("lowerbound", getLowerBound());
> - m.put("upperbound", getUpperBound());
> - return m;
> - }
> -
> - public long getLowerBound() {
> - return lowerBound.get();
> - }
> -
> - public void setLowerBound(long lower) {
> - lowerBound.set(lower);
> - }
> -
> - public long getUpperBound() {
> - return upperBound.get();
> - }
> -
> - public void setUpperBound(long upper) {
> - upperBound.set(upper);
> - }
> -
> - // todo: equals implementation
> - public Object invoke(Object proxy, Method m, Object[] args)
> throws Throwable {
> - Object result;
> - try {
> - result = m.invoke(this, args);
> - } catch (InvocationTargetException e) {
> - throw e.getTargetException();
> - } catch (Exception e) {
> - throw new RuntimeException("unexpected invocation
> exception: " +
> - e.getMessage());
> - } finally {
> - }
> - return result;
> - }
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/RangeStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> RangeStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> RangeStatistic.java (working copy)
> @@ -1,64 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * Specifies standard measurements of the lowest and highest values
> an attribute has held as well as its current value.
> - */
> -_at_ManagedData
> -public interface RangeStatistic extends Statistic {
> - /**
> - * The highest value this attribute has held since the
> beginning of the measurement.
> - */
> - @ManagedAttribute
> - long getHighWaterMark();
> -
> - /**
> - * The lowest value this attribute has held since the beginning
> of the measurement.
> - */
> - @ManagedAttribute
> - long getLowWaterMark();
> -
> - /**
> - * The current value of this attribute.
> - */
> - @ManagedAttribute
> - long getCurrent();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/BoundedRangeStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> BoundedRangeStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> BoundedRangeStatistic.java (working copy)
> @@ -1,47 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * The BoundedRangeStatistic model aggregates the attributes of
> RangeStatistic and BoundaryStatistic and provides standard
> measurements of a range that has fixed limits.
> - */
> -_at_ManagedData
> -public interface BoundedRangeStatistic extends BoundaryStatistic,
> RangeStatistic {
> -}
> -
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/TimeStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> TimeStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> TimeStatistic.java (working copy)
> @@ -1,70 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * Specifies standard timing measurements.
> - */
> -_at_ManagedData
> -public interface TimeStatistic extends Statistic {
> - /**
> - * Number of times the operation was invoked since the
> beginning of this measurement.
> - */
> - @ManagedAttribute
> - long getCount();
> -
> - /**
> - * The maximum amount of time taken to complete one invocation
> of this operation since the beginning of this measurement.
> - */
> - @ManagedAttribute
> - long getMaxTime();
> -
> - /**
> - * The minimum amount of time taken to complete one invocation
> of this operation since the beginning of this measurement.
> - */
> - @ManagedAttribute
> - long getMinTime();
> -
> - /**
> - * This is the sum total of time taken to complete every
> invocation of this operation since the beginning of this
> measurement. Dividing totalTime by count will give you the average
> execution time for this operation.
> - */
> - @ManagedAttribute
> - long getTotalTime();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/Statistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> Statistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> Statistic.java (working copy)
> @@ -1,77 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * The Statistic model and its sub-models specify the data models
> which are requried to be used to provide the performance data
> described by the specific attributes in the Stats models.
> - */
> -_at_ManagedData
> -public interface Statistic {
> - /**
> - * The name of this Statistic.
> - */
> - @ManagedAttribute
> - String getName();
> -
> - /**
> - * The unit of measurement for this Statistic.
> - * Valid values for TimeStatistic measurements are "HOUR",
> "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and "NANOSECOND".
> - */
> - @ManagedAttribute
> - String getUnit();
> -
> - /**
> - * A human-readable description of the Statistic.
> - */
> - @ManagedAttribute
> - String getDescription();
> -
> - /**
> - * The time of the first measurement represented as a long,
> whose value is the number of milliseconds since January 1, 1970,
> 00:00:00.
> - */
> - @ManagedAttribute
> - long getStartTime();
> -
> - /**
> - * The time of the last measurement represented as a long,
> whose value is the number of milliseconds since January 1, 1970,
> 00:00:00.
> - */
> - @ManagedAttribute
> - long getLastSampleTime();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/BoundaryStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> BoundaryStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> BoundaryStatistic.java (working copy)
> @@ -1,58 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * Specifies standard measurements of the upper and lower limits of
> the value of an attribute.
> - */
> -_at_ManagedData
> -public interface BoundaryStatistic extends Statistic {
> - /**
> - * The upper limit of the value of this attribute.
> - */
> - @ManagedAttribute
> - long getUpperBound();
> -
> - /**
> - * The lower limit of the value of this attribute.The upper
> limit of the value of this attribute.
> - */
> - @ManagedAttribute
> - long getLowerBound();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/StringStatistic.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> StringStatistic.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> StringStatistic.java (working copy)
> @@ -1,62 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -import org.glassfish.gmbal.ManagedAttribute;
> -import org.glassfish.gmbal.ManagedData;
> -
> -/**
> - * Custom statistic type created for the Sun ONE Application Server.
> - * The goal is to be able to represent changing attribute values
> that are strings
> - * in the form of Statistics. Semantically, it is analogous to a
> {_at_link CountStatistic},
> - * the only difference being in the value that is returned. Unlike
> a CountStatistic
> - * (which always is unidirectional), this Statistic type is not
> having any
> - * specified direction, simply because there is no natural order.
> An example
> - * of the values that an instance of this statistic type can assume
> is: A State
> - * Statistic which can have "CONNECTED, CLOSED, DISCONNECTED" as
> the permissible
> - * values and the current value can be any one of them (and them
> only).
> - * The permissible values are upto a particular implementation.
> - */
> -
> -_at_ManagedData
> -public interface StringStatistic extends Statistic {
> - /**
> - * Returns the String value of the statistic
> - */
> - @ManagedAttribute
> - String getCurrent();
> -}
> Index: common/glassfish-api/src/main/java/org/glassfish/api/
> statistics/Stats.java
> ===================================================================
> --- common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> Stats.java (revision 29968)
> +++ common/glassfish-api/src/main/java/org/glassfish/api/statistics/
> Stats.java (working copy)
> @@ -1,55 +0,0 @@
> -/*
> - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
> - *
> - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
> - *
> - * The contents of this file are subject to the terms of either the
> GNU
> - * General Public License Version 2 only ("GPL") or the Common
> Development
> - * and Distribution License("CDDL") (collectively, the "License").
> You
> - * may not use this file except in compliance with the License. You
> can obtain
> - * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
> - * or glassfish/bootstrap/legal/LICENSE.txt. See the License for
> the specific
> - * language governing permissions and limitations under the License.
> - *
> - * When distributing the software, include this License Header
> Notice in each
> - * file and include the License file at glassfish/bootstrap/legal/
> LICENSE.txt.
> - * Sun designates this particular file as subject to the
> "Classpath" exception
> - * as provided by Sun in the GPL Version 2 section of the License
> file that
> - * accompanied this code. If applicable, add the following below
> the License
> - * Header, with the fields enclosed by brackets [] replaced by your
> own
> - * identifying information: "Portions Copyrighted [year]
> - * [name of copyright owner]"
> - *
> - * Contributor(s):
> - *
> - * If you wish your version of this file to be governed by only the
> CDDL or
> - * only the GPL Version 2, indicate your decision by adding
> "[Contributor]
> - * elects to include this software in this distribution under the
> [CDDL or GPL
> - * Version 2] license." If you don't indicate a single choice of
> license, a
> - * recipient has the option to distribute your version of this file
> under
> - * either the CDDL, the GPL Version 2 or to extend the choice of
> license to
> - * its licensees as provided above. However, if you add GPL
> Version 2 code
> - * and therefore, elected the GPL Version 2 license, then the
> option applies
> - * only if the new code is made subject to such option by the
> copyright
> - * holder.
> - */
> -
> -package org.glassfish.api.statistics;
> -
> -public interface Stats {
> -
> - /**
> - * Get a Statistic by name.
> - */
> - Statistic getStatistic(String statisticName);
> -
> - /**
> - * Returns an array of Strings which are the names of the
> attributes from the specific Stats submodel that this object
> supports. Attributes named in the list must correspond to attributes
> that will return a Statistic object of the appropriate type which
> contains valid performance data. The return value of attributes in
> the Stats submodel that are not included in the statisticNames list
> must be null. For each name in the statisticNames list there must be
> one Statistic with the same name in the statistics list.
> - */
> - String [] getStatisticNames();
> -
> - /**
> - * Returns an array containing all of the Statistic objects
> supported by this Stats object.
> - */
> - Statistic[] getStatistics();
> -}
> Index: common/glassfish-api/osgi.bundle
> ===================================================================
> --- common/glassfish-api/osgi.bundle (revision 29968)
> +++ common/glassfish-api/osgi.bundle (working copy)
> @@ -1,28 +1,26 @@
> --exportcontents: \
> - com.sun.appserv.jdbc; \
> - com.sun.appserv.server; \
> - org.glassfish.api; \
> - org.glassfish.api.admin; \
> - org.glassfish.api.admin.cli; \
> - org.glassfish.api.admin.config; \
> - org.glassfish.api.admingui; \
> - org.glassfish.api.amx; \
> - org.glassfish.api.container; \
> - org.glassfish.api.content; \
> - org.glassfish.api.deployment; \
> - org.glassfish.api.deployment.archive; \
> - org.glassfish.api.event; \
> - org.glassfish.api.invocation; \
> - org.glassfish.api.jdbc; \
> - org.glassfish.api.logging; \
> - org.glassfish.api.interceptor; \
> - org.glassfish.api.managedbean; \
> - org.glassfish.api.monitoring; \
> - org.glassfish.api.naming; \
> - org.glassfish.api.embedded; \
> - org.glassfish.api.embedded.admin; \
> - org.glassfish.api.web; \
> - org.glassfish.api.statistics; \
> - org.glassfish.api.statistics.impl; \
> - org.glassfish.api.branding; version=$
> {project.osgi.version}
> -
> +-exportcontents: \
> + com.sun.appserv.jdbc; \
> + com.sun.appserv.server; \
> + org.glassfish.api; \
> + org.glassfish.api.admin; \
> + org.glassfish.api.admin.cli; \
> + org.glassfish.api.admin.config; \
> + org.glassfish.api.admingui; \
> + org.glassfish.api.amx; \
> + org.glassfish.api.container; \
> + org.glassfish.api.content; \
> + org.glassfish.api.deployment; \
> + org.glassfish.api.deployment.archive; \
> + org.glassfish.api.event; \
> + org.glassfish.api.invocation; \
> + org.glassfish.api.jdbc; \
> + org.glassfish.api.logging; \
> + org.glassfish.api.interceptor; \
> + org.glassfish.api.managedbean; \
> + org.glassfish.api.monitoring; \
> + org.glassfish.api.naming; \
> + org.glassfish.api.embedded; \
> + org.glassfish.api.embedded.admin; \
> + org.glassfish.api.web; \
> + org.glassfish.api.branding; version=$
> {project.osgi.version}
> +
> Index: common/glassfish-api/pom.xml
> ===================================================================
> --- common/glassfish-api/pom.xml (revision 29968)
> +++ common/glassfish-api/pom.xml (working copy)
> @@ -70,10 +70,6 @@
> <artifactId>grizzly-utils</artifactId>
> </dependency>
> <dependency>
> - <groupId>org.glassfish.gmbal</groupId>
> - <artifactId>gmbal</artifactId>
> - </dependency>
> - <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>4.3.1</version>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
Lloyd Chambers
lloyd.chambers_at_sun.com
GlassFish Team