[jboss-cvs] jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/model ...

Takuro Okada t2-okada at nri.co.jp
Tue Oct 31 06:27:22 EST 2006


  User: tokada  
  Date: 06/10/31 06:27:22

  Added:       java/src/expansion/org/jboss/profiler/exp/agent/collector/model 
                        Tag: JBossProfiler_Expansion MetricsMap.java
  Log:
  
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +85 -0     jboss-profiler/java/src/expansion/org/jboss/profiler/exp/agent/collector/model/Attic/MetricsMap.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MetricsMap.java
  ===================================================================
  RCS file: MetricsMap.java
  diff -N MetricsMap.java
  --- /dev/null	1 Jan 1970 00:00:00 -0000
  +++ MetricsMap.java	31 Oct 2006 11:27:22 -0000	1.1.2.1
  @@ -0,0 +1,85 @@
  +/*
  + * JBoss, Home of Professional Open Source
  + * Copyright 2006, JBoss Inc., and individual contributors as indicated
  + * by the @authors tag. See the copyright.txt in the distribution for a
  + * full listing of individual contributors.
  + *
  + * This is free software; you can redistribute it and/or modify it
  + * under the terms of the GNU Lesser General Public License as
  + * published by the Free Software Foundation; either version 2.1 of
  + * the License, or (at your option) any later version.
  + *
  + * This software is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  + * Lesser General Public License for more details.
  + *
  + * You should have received a copy of the GNU Lesser General Public
  + * License along with this software; if not, write to the Free
  + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  + */
  +
  +package org.jboss.profiler.exp.agent.collector.model;
  +
  +import java.util.Map;
  +
  +import javolution.util.FastMap;
  +
  +/**
  + * The map object of the entity object(instance of Metric).
  + * 
  + * <p>The following structure are created. </p>
  + * <p>
  + *   <table border="1">
  + *     <tr>
  + *       <td colspan="4">Map</td>
  + *     </tr>
  + *     <tr>
  + *       <td rowspan="3" valign="top">category : String</td>
  + *       <td colspan="3">Map</td>
  + *     </tr>
  + *     <tr>
  + *       <td rowspan="2" valign="top">operation name : String</td>
  + *       <td colspan="3">Map</td>
  + *     </tr>
  + *     <tr>
  + *       <td>MetricName</td>
  + *       <td>Metric</td>
  + *     </tr>
  + *   </table>
  + * </p>
  + * 
  + * @see org.jboss.profiler.production.metrics.MetricName
  + * @author Takuro Okada (Nomura Research Institute, Ltd.)
  + * Copyright 2006 Nomura Research Institute, Ltd. All Rights Reserved.
  + * Copyright(c) Information-technology Promotion Agency, Japan. All rights reserved 2006.
  + * Result of Open Source Software Development Activities of Information-technology Promotion Agency, Japan.
  + */
  +public class MetricsMap extends FastMap<String, Map<String, Map<MetricName, Metric>>> {
  +
  +    public void merge(MetricsMap map) {
  +        
  +        for(Map.Entry<String, Map<String, Map<MetricName, Metric>>> cEntry : map.entrySet()) {
  +            if(this.containsKey(cEntry.getKey())) {
  +                Map<String, Map<MetricName, Metric>> oMap = this.get(cEntry.getKey());
  +                for(Map.Entry<String, Map<MetricName, Metric>> oEntry : cEntry.getValue().entrySet()) {
  +                    if(oMap.containsKey(cEntry.getKey())) {
  +                        Map<MetricName, Metric> mMap = oMap.get(oEntry.getKey());
  +                        for(Map.Entry<MetricName, Metric> mEntry : oEntry.getValue().entrySet()) {
  +                            if(mMap.containsKey(mEntry.getKey())) {
  +                                mMap.get(mEntry.getKey()).merge(mEntry.getValue());
  +                            }else {
  +                                mMap.put(mEntry.getKey(), mEntry.getValue());
  +                            }
  +                        }
  +                    }else {
  +                        oMap.put(oEntry.getKey(), oEntry.getValue());
  +                    }
  +                }
  +            }else {
  +                this.put(cEntry.getKey(), cEntry.getValue());
  +            }
  +        }
  +    }
  +}
  
  
  



More information about the jboss-cvs-commits mailing list