geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r580468 [4/4] - in /geronimo/sandbox/monitoring: ./ mrc-client/ mrc-client/src/ mrc-client/src/main/ mrc-client/src/main/java/ mrc-client/src/main/java/org/ mrc-client/src/main/java/org/apache/ mrc-client/src/main/java/org/apache/geronimo/ ...
Date Fri, 28 Sep 2007 19:34:28 GMT
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java Fri Sep 28 12:34:24 2007
@@ -0,0 +1,151 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.monitor.snapshot;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.geronimo.monitor.snapshot.SnapshotXMLBuilder;
+import org.apache.geronimo.monitor.MasterRemoteControl;
+
+/**
+ * Thread that is in charge of executing every x milliseconds. Upon each
+ * iteration, a snapshot of the server's information is recorded.
+ */
+public class SnapshotThread extends Thread {
+
+    private long SNAPSHOT_DURATION;
+    private MBeanServer mbServer = null;
+    private SnapshotXMLBuilder snapshotXMLBuilder = null;
+    // list of mbean names that we will be taking snapshots of
+    private ArrayList<String> mbeanNames;
+    
+    public SnapshotThread(long snapshot_length, MBeanServer mbServer) {
+        SNAPSHOT_DURATION = snapshot_length;
+        this.mbServer = mbServer;
+        snapshotXMLBuilder = new SnapshotXMLBuilder();
+        snapshotXMLBuilder.checkXMLExists();
+        mbeanNames = new ArrayList<String>();
+    }
+    
+    /**
+     * Gets the elapsed time in milliseconds between each snapshot.
+     * 
+     * @return long
+     */
+    public long getSnapshotDuration() {
+        return SNAPSHOT_DURATION;
+    }
+    
+    /**
+     * Adds the mbean name to list in memory. To update the snapshot-config.xml
+     * coder must use SnapshotConfigXMLBuilder class.
+     * @param mbeanName
+     */
+    public void addMBeanForSnapshot(String mbeanName) {
+        mbeanNames.add(mbeanName);
+    }
+
+    /**
+     * Removes the mbean name to list in memory. To update the snapshot-config.xml
+     * coder must use SnapshotConfigXMLBuilder class.
+     * @param mbeanName
+     */
+    public void removeMBeanForSnapshot(String mbeanName) {
+        mbeanNames.remove(mbeanName);
+    }
+    
+    /**
+     * Sets the elapsed time in milliseconds between each snapshot.
+     * 
+     * @param snapshotDuration
+     */
+    public void setSnapshotDuration(long snapshot_length) {
+        SNAPSHOT_DURATION = snapshot_length;
+    }
+
+    public void run() {
+        // get any saved mbean names from snapshot-config.xml
+        mbeanNames = SnapshotConfigXMLBuilder.getMBeanNames();
+        // in the case where nothing is present, grab a set of default mbeans
+        if(mbeanNames.size() <= 0) {
+            mbeanNames = getDefaultMBeanList();
+        }
+        // pause the thread from running every SNAPSHOT_DURATION seconds
+        while(true && SNAPSHOT_DURATION != Long.MAX_VALUE) {
+            try {
+                // take a snapshot
+                System.out.println("======SNAPSHOT======");
+                // instantiate map <mbean name, stats for mbean>
+                HashMap<String, HashMap> aggregateStats = new HashMap<String, HashMap>();
+                // for each mbean name in the list, get its stats
+                for(int i = 0; i < mbeanNames.size(); i++) {
+                    String mbeanName = mbeanNames.get(i);
+                    HashMap stats = (HashMap)MasterRemoteControl.getStats(mbeanName);
+                    aggregateStats.put(mbeanName, stats);
+                }
+                // store the data
+                snapshotXMLBuilder.openDocument();
+                snapshotXMLBuilder.addNewSnapshot(aggregateStats);
+                snapshotXMLBuilder.saveDocument( snapshotXMLBuilder.getDocument() );
+                
+                for(Iterator itt = aggregateStats.keySet().iterator(); itt.hasNext(); ) {
+                    String mbean = (String)itt.next();
+                    HashMap stats = aggregateStats.get(mbean);
+                    System.out.println(mbean);
+                    for(Iterator it = stats.keySet().iterator(); it.hasNext(); ) {
+                        String key = (String)it.next();
+                        Long value = (Long)stats.get(key);
+                        System.out.println(key + ": " + value);
+                    }
+                    System.out.println();
+                }
+
+                // wait for next snapshot
+                Thread.sleep(SNAPSHOT_DURATION);
+            } catch(Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * @return A list of all default mbeans; namely, all connector or container mbean names
+     * Prereq: in order to be a connector or container mbean the name must contain "Connector"/"Container" 
+     * and "Tomcat"/"Jetty"
+     */
+    private ArrayList<String> getDefaultMBeanList() {
+        Set<ObjectName> mbeans = (new MasterRemoteControl()).getStatisticsProviderMBeanNames();
+        ArrayList<String> retval = new ArrayList<String>();
+        for(Iterator it = mbeans.iterator(); it.hasNext(); ) {
+            String name = ((ObjectName)it.next()).getCanonicalName();
+            if((name.contains("Connector") || name.contains("Container")) &&
+                    (name.contains("Jetty") || name.contains("Tomcat"))) {
+                // this is a connector, so add to the list
+                retval.add(name);
+                // update the snapshot-config.xml to include these
+                SnapshotConfigXMLBuilder.addMBeanName(name);
+            }
+        }
+        return retval;
+    }
+}

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotThread.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java Fri Sep 28 12:34:24 2007
@@ -0,0 +1,687 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.monitor.snapshot;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * In charge of dealing with the XML processing of the snapshot's data.
+ */
+public class SnapshotXMLBuilder {
+    private Document doc = null;
+    private static final String pathToXML = 
+        System.getProperty("org.apache.geronimo.home.dir") + "/var/snapshotData.xml";
+    private static final String SNAPSHOT_DATE = "snapshot_date";
+    private static final String SNAPSHOT_TIME = "snapshot_time";
+    private static final String MBEAN = "mbean";
+    private static final String MBEAN_NAME = "mbeanName";
+    private static String prevSnapshotMonth = "";
+    
+    public SnapshotXMLBuilder() {
+        
+    }
+
+    /**
+     * @return A map: mbeanName --> ArrayList of statistic attributes for that mbean
+     */
+    public static HashMap<String, ArrayList<String>> getAllSnapshotStatAttributes() {
+        HashMap<String, ArrayList<String>> statsMap = new HashMap<String, ArrayList<String>>();
+        File docFile = new File(pathToXML);
+        // there are no snapshots if the xml doc does not exist
+        if(!docFile.exists()) {
+            return new HashMap<String, ArrayList<String>>();
+        } else {
+            // get the factory
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            Document myDoc = null;
+            while(true) {
+                try {
+                    // Using factory get an instance of document builder
+                    DocumentBuilder db = dbf.newDocumentBuilder();
+                    // parse using builder to get DOM representation of the XML file
+                    myDoc = db.parse(pathToXML);
+                    // stop looping after xml doc is parsed
+                    break;
+                } catch(Exception e) {
+                    // Either this file is being read/written to by snapshot thread
+                    // or there is an UNKNOWN error
+                }
+            }
+            // enumerate all attributes
+            NodeList snapshotNodes = myDoc.getElementsByTagName("snapshot");
+            Node snapshotNode = snapshotNodes.item(snapshotNodes.getLength() - 1);
+            NodeList nodeList = snapshotNode.getChildNodes();
+            ArrayList<String> statsAttr = new ArrayList<String>();
+            for(int i = 0; i < nodeList.getLength(); i++) {
+                if ( !nodeList.item(i).getNodeName().equals("#text") ) {
+            	    if( !nodeList.item(i).getNodeName().equals(MBEAN) ) {
+            	        // should be snapshot date and snapshot time
+            	        statsAttr.add(nodeList.item(i).getNodeName());
+            	    } else {
+            	        // go in one more level to get this mbean's statistic attributes
+            	        NodeList attributeNodes = nodeList.item(i).getChildNodes();
+            	        // instantiate variable to store mbean name
+            	        String mbeanName = null;
+            	        // add each attribute to the list if it is not already in it
+            	        for(int j = 0; j < attributeNodes.getLength(); j++) {
+            	            if ( !attributeNodes.item(j).getNodeName().equals("#text") ) {
+            	                if( attributeNodes.item(j).getNodeName().equals(MBEAN_NAME) ) {
+            	                    mbeanName = attributeNodes.item(j).getTextContent();
+            	                } else if( !statsAttr.contains(attributeNodes.item(j).getNodeName()) ) {
+            	                    statsAttr.add(attributeNodes.item(j).getNodeName());
+            	                } else {
+            	                    System.out.println(attributeNodes.item(j).getNodeName());
+            	                }
+            	            }
+            	        }
+            	        // add statsAttr to the returning map: <mbeanName --> statsAttr>
+            	        statsMap.put(mbeanName, statsAttr);
+            	        // clear statsAttr for the next round of attributes
+            	        statsAttr = new ArrayList<String>();
+            	    }
+            	}
+            }
+            // done querying, so return
+            return statsMap;
+        }
+    }
+    
+    /**
+     * Gets the private member document containing the non-archived snapshots.
+     * 
+     * @return Document
+     */
+    public Document getDocument() {
+        return doc;
+    }
+    
+    /**
+     * Sets the private member document containing the non-archived snapshots.
+     * 
+     * @param document
+     */
+    public void setDocument(Document document) {
+        doc = document;
+    }
+    
+    /**
+     * Gets the number of snapshots we have on hand in the current
+     * XML document. Does not include the snapshots that are archived.
+     * 
+     * @return Long
+     */
+    public static Long getSnapshotCount() {
+        File docFile = new File(pathToXML);
+        // there are no snapshots if the xml doc does not exist
+        if(!docFile.exists()) {
+            return new Long(0);
+        } else {
+            // get the factory
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            while(true) {
+                try {
+                    // Using factory get an instance of document builder
+                    DocumentBuilder db = dbf.newDocumentBuilder();
+                    // parse using builder to get DOM representation of the XML file
+                    Document myDoc = db.parse(pathToXML);
+                    // fetch the number of "snapshot" elements in this document
+                    return new Long(myDoc.getElementsByTagName("snapshot").getLength()); 
+                } catch(Exception e) {
+                    // Either this file is being read/written to by snapshot thread
+                    // or there is an UNKNOWN error
+                }
+            }
+        }
+    }
+    
+    /**
+     * Fetches the min amount for each statistic stored from the snapshot thread
+     * and returns it in a HashMap
+     * 
+     * @param numberOfSnapshot
+     * @return HashMap
+     */
+    public HashMap<String, HashMap> fetchMinSnapshotData(Integer numberOfSnapshot) {
+        return fetchMinorMaxSnapshotData(numberOfSnapshot, true);
+    }
+    
+    private HashMap<String, HashMap> fetchMinorMaxSnapshotData(Integer numberOfSnapshot, boolean wantMin) {
+        // instantiate returning HashMap
+        HashMap<String, HashMap> snapshotData = new HashMap<String, HashMap>();
+        // get all snapshots
+        NodeList snapshots = doc.getElementsByTagName("snapshot");
+        int lower = Math.max(0, snapshots.getLength()-numberOfSnapshot);
+        // for each snapshot
+        for(int i = snapshots.getLength()-1; i >= lower; i--) {
+            Node snapshot = snapshots.item(i);
+            NodeList snapshotChildren = snapshot.getChildNodes();
+            
+            // for each mbean inside a snapshot
+            for(int j = 0; j < snapshotChildren.getLength(); j++) {
+                Node child = snapshotChildren.item(j);
+                
+                // only find mins for mbean stats
+                if(child.getNodeName().equals(MBEAN)) {
+                    NodeList mbeanStats = child.getChildNodes();
+                    HashMap mbeanMap = new HashMap();           // holds stats for this mbean for this snapshot
+                    String mbeanName = null;
+                    // save all numerical stats
+                    for(int k = 0; k < mbeanStats.getLength(); k++) {
+                        Node node = mbeanStats.item(k);
+                        String key = (String)node.getNodeName();
+                        if(key.equals(MBEAN_NAME)) {                                   // save the mbean name
+                            mbeanName = node.getTextContent();
+                        } else if(!key.equals(SNAPSHOT_TIME) && !key.equals("#text")) {                         // ignore times
+                            String strValue = (String)node.getTextContent();
+                            try {
+                                long value = Long.parseLong(strValue);
+                                mbeanMap.put(key, (Long)value);
+                            } catch (Exception e) {
+                                // this will happen when strValue cannot be place into a long
+                            }
+                        }
+                    }
+                    // save the information into the snapshotData
+                    if(snapshotData.get(mbeanName) != null) {
+                        // for each stat inside this mbean, relax it with the one on record
+                        HashMap minMap = snapshotData.get(mbeanName);
+                        for(Iterator it = minMap.keySet().iterator(); it.hasNext(); ) {
+                            String key = (String)it.next();
+                            // relax
+                            snapshotData.get(mbeanName).put(
+                                    key,                                        // attribute
+                                    wantMin ?                                   // max/min of the stats
+                                            Math.min((Long)minMap.get(key), (Long)mbeanMap.get(key)) : 
+                                            Math.max((Long)minMap.get(key), (Long)mbeanMap.get(key)));  
+                        }
+                    } else {
+                        snapshotData.put(mbeanName, mbeanMap);
+                    }
+                }
+            }
+        }
+        
+        return snapshotData;
+    }
+    
+    /**
+     * Fetches the max amount for each statistic stored from the snapshot thread
+     * and returns it in a HashMap
+     * 
+     * @param numberOfSnapshot
+     * @return HashMap
+     */
+    public HashMap fetchMaxSnapshotData(Integer numberOfSnapshot) {
+        return fetchMinorMaxSnapshotData(numberOfSnapshot, false);
+    }
+    
+    /**
+     * Fetches the data stored from the snapshot thread and returns
+     * it in a ArrayList with each element being a HashMap of the attribute
+     * mapping to the statistic. All stats will be the average of 
+     *          1 - n, n+1 - 2n, ..., cn+1 - c(n+1)
+     *
+     * Grabs 'numberOfSnapshots' snapshots. Grabs one snapshot per
+     * 'everyNthsnapshot'
+     * 
+     * @param numberOfSnapshot
+     * @param everyNthSnapshot
+     * @return ArrayList
+     */ 
+    public ArrayList fetchData(Integer numberOfSnapshot, Integer everyNthSnapshot) {
+        // instantiate returning ArrayList of HashMaps
+        ArrayList snapshotData = new ArrayList();
+        // ensure that the XML exists
+        checkXMLExists();
+        // get all snapshots
+        NodeList snapshots = doc.getElementsByTagName("snapshot");
+        // compute the lower bound
+        int lowerBound = Math.max(0, (snapshots.getLength() - (everyNthSnapshot * numberOfSnapshot)));
+        // for each snapshot
+        for(int i = snapshots.getLength() - 1; i >= lowerBound; i -= everyNthSnapshot) {
+            // find the average statistic 
+            HashMap avgStats = getAverageStats( snapshots, i, Math.max(0,i-everyNthSnapshot+1) );
+            snapshotData.add(0, avgStats);
+        }
+        return snapshotData;
+    }
+    
+    /**
+     * Given a list of <snapshot> elements and a range, the average for each
+     * numerical statistic will be computed and returned. The last time stamp 
+     * will be returned as the estimated time.
+     * 
+     * @param snapshots
+     * @param upper
+     * @param lower
+     * @return HashMap
+     */
+    private HashMap<String, HashMap> getAverageStats(NodeList snapshots, int upper, int lower) {
+        HashMap<String, HashMap> avgs = new HashMap<String, HashMap>();
+        // keywords
+        final String CURRENT = "Current";               // RangeStatistic
+        final String CURRENT_TIME = "CurrentTime";      // TimeStatistic
+        // summing up the stats
+        for(int i = lower; i <= upper; i++) {
+            Node snapshot = snapshots.item(i);
+            NodeList snapshotChildren = snapshot.getChildNodes();
+            HashMap<String, Object> times = new HashMap<String, Object>();
+            // for each child under <snapshot>
+            for(int k = 0; k < snapshotChildren.getLength(); k++) {
+                String nodeName = snapshotChildren.item(k).getNodeName();
+                // save the last time and date
+                if(i == upper && (nodeName.equals(SNAPSHOT_TIME) || nodeName.equals(SNAPSHOT_DATE))) {
+                    
+                    if(nodeName.equals(SNAPSHOT_TIME)) {
+                        times.put(nodeName, Long.parseLong(snapshotChildren.item(k).getTextContent()));
+                    } else {
+                        times.put(nodeName, snapshotChildren.item(k).getTextContent());
+                    }
+                } else if(nodeName.equals(MBEAN)) {
+                    // save mbean's information for this snapshot
+                    NodeList dataList = snapshotChildren.item(k).getChildNodes();
+                    String mbeanName = null;
+                    HashMap<String, Object> dataMap = new HashMap<String, Object>();
+                    // for each stat within one snapshot, save it
+                    for(int j = 0; j < dataList.getLength(); j++) {
+                        Node node = dataList.item(j);
+                        String key = (String)node.getNodeName();
+                        String strValue = (String)node.getTextContent();
+                        // save the mbeanName
+                        if(key.equals(MBEAN_NAME)) {
+                            mbeanName = strValue;
+                        } else {
+                            try {
+                                long value = Long.parseLong(strValue);
+                                dataMap.put(key, new Long(value));
+                            } catch (Exception e) {
+                                // this will happen when strValue cannot be place into a long
+                            }
+                        }
+                    }
+                    
+                    // finally combine with the returning hashmap of averages
+                    if(avgs.get(mbeanName) != null) {
+                        // sum it up
+                        for(Iterator it = dataMap.keySet().iterator(); it.hasNext(); ) {
+                            String key = (String)it.next();
+                            // ensure that only current values are averaged
+                            if(key.contains(CURRENT) &&
+                                    !key.contains(CURRENT_TIME) && 
+                                    !key.contains(SNAPSHOT_DATE) && 
+                                    !key.contains(SNAPSHOT_TIME)) {
+                                avgs.get(mbeanName).put(key, (Long)avgs.get(mbeanName).get(key) + (Long)dataMap.get(key));
+                            } else {
+                                // keep the latest NON-CURRENT value
+                                avgs.get(mbeanName).put(key, (Long)dataMap.get(key));
+                            }
+                        }
+                    } else {
+                        avgs.put(mbeanName, dataMap);
+                    }
+                }
+            } // end of loop for all of one <snapshot>'s children
+            avgs.put("times", times);            // save the times
+        }
+        // dividing the stats to get the average
+        int divisor = Math.abs(upper - lower) + 1;
+        for(Iterator it = avgs.keySet().iterator(); it.hasNext(); ) {
+            String mbeanName = (String)it.next();
+            HashMap stats = avgs.get(mbeanName);
+            for(Iterator itt = stats.keySet().iterator(); itt.hasNext(); ) {
+                String key = (String)itt.next();
+                // ensure that only current values are averaged
+                if(key.contains(CURRENT) &&
+                        !key.contains(CURRENT_TIME) && 
+                        !key.contains(SNAPSHOT_DATE) && 
+                        !key.contains(SNAPSHOT_TIME)) {
+                    Object value = stats.get(key);
+                    if(value instanceof Long) {
+                        stats.put(key, Math.round((Long)value * 1.0 / divisor));
+                    }
+                }
+            }
+            // save all changes
+            avgs.put(mbeanName, stats);
+        }
+        // done computing
+        return avgs;
+    }
+    
+    /**
+     * Ensures that there is an existing XML file. Creates one if there
+     * isn't one.
+     * 
+     */
+    public void checkXMLExists() {
+        File docFile = new File(pathToXML);
+        // create an XML document if it does not exist
+        if(!docFile.exists()) {
+            setDocument( createDocument() );
+            setUpDocument( getDocument() );
+            saveDocument( getDocument() );
+        }
+    }
+    
+    /**
+     * Prepares the root element for a document.
+     */
+    public void setUpDocument(Document document) {
+        // add <snapshots> tag as the root
+        Element rootElement = document.createElement("snapshots");
+        document.appendChild(rootElement);
+    }
+    
+    /**
+     * Creates an instance of a Document and returns it
+     */
+    public Document createDocument() {
+        // get an instance of factory
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        try {
+            // get an instance of builder
+            DocumentBuilder db = dbf.newDocumentBuilder();
+            // create an instance of DOM
+            return db.newDocument();
+        } catch(ParserConfigurationException pce) {
+            System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
+        }
+        return null;
+    }
+    
+    /**
+     * Write the document object to the file location specified by
+     * the the default path. This is meant to be called by a normal
+     * snapshot recording only, not anything dealing with archiving.
+     */
+    public void saveDocument(Document document) {
+        saveDocument(document, pathToXML);
+    }
+    
+    /**
+     * Write the document object to the file location specified by
+     * the path.
+     */
+    public void saveDocument(Document document, String path) {
+        try {
+            // formatting the doc
+            OutputFormat format = new OutputFormat(document);
+            format.setIndenting(true);
+            // generate a file output
+            XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File(path)), format);
+            serializer.serialize(document);
+        } catch(Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+    /**
+     * Creates a child node until the root element in the document
+     * with information passed in from the HashMap.
+     * 
+     * @param map
+     */
+    public void addNewSnapshot(HashMap<String, HashMap> map) {
+        // get element to store all snapshot data
+        Element snapshotElement = doc.createElement("snapshot");
+        
+        // get the current date
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        String currDate = sdf.format(cal.getTime());
+        
+        // get the current time from 1970
+        String currTime = "";
+        currTime += (new Date()).getTime();
+        
+        // add the current Date as a timestamp for the snapshot
+        Element dateElement = doc.createElement(SNAPSHOT_DATE);
+        dateElement.setTextContent(currDate);
+        snapshotElement.appendChild(dateElement);
+        
+        // add the current time as a timestamp for the snapshot
+        Element timeElement = doc.createElement(SNAPSHOT_TIME);
+        timeElement.setTextContent(currTime);
+        snapshotElement.appendChild(timeElement);
+        
+        // append all <mbean> to <snapshot>
+        for(Iterator it = map.keySet().iterator(); it.hasNext(); ) {
+            String mbean = (String)it.next();
+            Element mbeanElement = doc.createElement(MBEAN);
+            HashMap stats = map.get(mbean);
+            // append all stats to <mbean> element
+            for(Iterator itt = stats.keySet().iterator(); itt.hasNext(); ) {
+                String attrName = (String)itt.next();
+                Object value = (Object)stats.get(attrName);
+                Element dataElement = doc.createElement(attrName.replace(" ", ""));
+                dataElement.setTextContent(value.toString());
+                mbeanElement.appendChild(dataElement);
+            }
+            // finally attach the mbean name for uniqueness
+            Element mbeanNameElement = doc.createElement(MBEAN_NAME);
+            mbeanNameElement.setTextContent(mbean);
+            mbeanElement.appendChild(mbeanNameElement);
+            // add <mbean> to the <snapshot> element
+            snapshotElement.appendChild(mbeanElement);
+        }
+        
+        // add this snapshot element to the document
+        doc.getDocumentElement().appendChild(snapshotElement);
+        
+        String currSnapshotMonth = currDate.substring(0, 7);
+        
+        // calculate the previous snapshot month
+        if( prevSnapshotMonth.equals("") ) {
+            NodeList snapshotDateList = doc.getElementsByTagName(SNAPSHOT_DATE);
+            // get the second to last snapshot
+            if(snapshotDateList.getLength() >= 2) {
+                Node lastDateNode = snapshotDateList.item(snapshotDateList.getLength()-2);
+                String lastMonth = lastDateNode.getTextContent().substring(0, 7);
+                prevSnapshotMonth = lastMonth;
+            } else {
+                // If there is not a snapshot on record, then by default use today's month.
+                prevSnapshotMonth = currSnapshotMonth;
+            }
+        }
+        
+        // archive data if necessary        
+        if( !currSnapshotMonth.equals(prevSnapshotMonth) ) {
+            archiveData(currSnapshotMonth);
+        } else {
+            deleteTemporaryDocuments(System.getProperty("org.apache.geronimo.home.dir") + "/var");
+        }
+        prevSnapshotMonth = currSnapshotMonth;
+    }
+    
+    /**
+     * Archives parts of the snapshot.xml that pertains to 'prevSnapshotMonth'
+     * and anything that is not related to the curr month and the prev month
+     * will be deleted. Therefore, there will only be at most two months of
+     * information kept at one time.
+     */
+    private void archiveData(String currSnapshotMonth) {
+        NodeList snapshots = doc.getElementsByTagName("snapshot");
+        // set up a new document containing the information for the archive doc
+        Document archiveDoc = createDocument();
+        setUpDocument(archiveDoc);
+        // for each snapshot element
+        //      determine if it is supposed to go into the archive or not
+        //      delete all instances where the snapshot is not related to 
+        //              the curr or prev month
+        for(int i = 0 ; i < snapshots.getLength(); i++) {
+            Node snapshot = snapshots.item(i);
+            NodeList snapshotData = snapshot.getChildNodes();
+            boolean foundSnapshotDate = false;  // true when SNAPSHOT_DATE is found
+            // for each piece of snapshot data
+            //          look at the date and perform actions accordingly
+            for(int j = 0; j < snapshotData.getLength() && !foundSnapshotDate; j++) {
+                Node data = snapshotData.item(j);
+                if(data.getNodeName().equals(SNAPSHOT_DATE)) {
+                    if( data.getTextContent().contains(currSnapshotMonth) ) {
+                        // nothing to do here
+                    } else if( data.getTextContent().contains(prevSnapshotMonth) ) {
+                        // add into a document object to be archived
+                        Node n = archiveDoc.importNode(snapshot, true);
+                        archiveDoc.getDocumentElement().appendChild(n);
+                    } else {
+                        // erase this snapshot node from doc
+                        doc.getDocumentElement().removeChild(snapshot);
+                        // when erasing snapshot from doc, the NodeList is 
+                        // actually changed too, so keep looking at this same
+                        // spot in the NodeList to not overlook any snapshots
+                        i--;
+                    }
+                    foundSnapshotDate = true;   // jump out of the inner loop
+                }
+            }
+        }
+        // the regular doc will be saved later
+        // save the archiveDoc
+        String archivePath = 
+            System.getProperty("org.apache.geronimo.home.dir") + "/var/" + prevSnapshotMonth + ".xml";
+        saveDocument(archiveDoc, archivePath);
+        zipDocument(archivePath);
+        deleteDocument(archivePath);
+    }
+    
+    /**
+     * Zips the file specified by filePath and puts it in the same directory.
+     * 
+     * @param filePath
+     */
+    private void zipDocument(String filePath) { 
+        try {
+            byte b[] = new byte[512];
+            ZipOutputStream zout = new ZipOutputStream(new FileOutputStream(filePath + ".zip"));
+            InputStream in = new FileInputStream(filePath);
+            // calculate the name of the file to be placed inside the zip file
+            String fileNameInsideZip = filePath.substring(filePath.lastIndexOf("/")+1);
+            ZipEntry e = new ZipEntry(fileNameInsideZip);
+            zout.putNextEntry(e);
+            int len=0;
+            // write the file to the zip
+            while((len=in.read(b)) > 0) {
+                zout.write(b,0,len);
+            }
+            // close all connections
+            zout.closeEntry();
+            in.close();
+            zout.close();
+        } catch(Exception e) {
+            System.out.println("There was a problem zipping " + filePath);
+            e.printStackTrace();
+        }
+    }
+    
+    /**
+     * Deletes all occurrences of *.xml in this directory. The only
+     * exception is to not delete snapshotData.xml. All other XML docs
+     * are considered to be temporary files that need to be cleaned.
+     * 
+     * @param dir
+     */
+    private void deleteTemporaryDocuments(String dir) {
+        File f = new File(dir);
+        if(f.isDirectory()) {
+            String fileNames[] = f.list();
+            // delete all *.xml files except snapshotData.xml
+            for(int i = 0; i < fileNames.length; i++) {
+                if(fileNames[i].endsWith(".xml") && !fileNames[i].equals("snapshotData.xml")) {
+                    deleteDocument(System.getProperty("org.apache.geronimo.home.dir") + "/var/" + fileNames[i]);
+                }
+            }
+        } else {
+            System.out.println(dir + " is not a directory.");
+        }
+    }
+    
+    /**
+     * Deletes the file specified by filePath.
+     * 
+     * @param filePath
+     */
+    private void deleteDocument(String filePath) {
+        File f = new File(filePath);
+        
+        // Make sure the file or directory exists
+        if (!f.exists()) {
+            System.out.println("Delete: no such file or directory: " + filePath);
+        }
+        // Make sure the file or directory is not write protected
+        if (!f.canWrite()) {
+            System.out.println("Delete: write protected: " + filePath);
+        }
+        // If it is a directory, make sure it is empty
+        if (f.isDirectory()) {
+            System.out.println("Delete: directory not empty: " + filePath);
+        }
+        // attempt to delete the file if it's not our snapshot config file
+        if(!filePath.contains("snapshot-config.xml") && f.delete()) {
+            // delete was successful
+        }
+    }
+
+    /**
+     * Parses the XML document specified by the private member 'pathToXML'
+     * and stores the information in the a Document object
+     */
+    public void openDocument() {
+        // ensure that the XML file is there
+        checkXMLExists();
+        // get the factory
+        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+        // continue to attempt to parse
+        while(true) {
+            try {
+                // Using factory get an instance of document builder
+                DocumentBuilder db = dbf.newDocumentBuilder();
+                // parse using builder to get DOM representation of the XML file
+                doc = db.parse(pathToXML);
+                break;
+            } catch(Exception e) {
+                // Either this file is being read/written to by snapshot thread
+                // or there is an UNKNOWN error
+                System.out.println(e.getMessage());
+            }
+        }
+    }
+}

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotXMLBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/monitoring/mrc-server/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/pom.xml?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/pom.xml (added)
+++ geronimo/sandbox/monitoring/mrc-server/pom.xml Fri Sep 28 12:34:24 2007
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+
+
+    <modelVersion>4.0.0</modelVersion>
+    
+
+
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>mrc</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    
+
+
+    <groupId>org.apache.geronimo.plugins.mrc</groupId>
+    <artifactId>mrc-server</artifactId>
+    <name>Geronimo Stats :: Server</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <type>jar</type>
+        </dependency>
+    </dependencies>
+
+    <description>
+        Geronimo MRC sample created from an archetype.
+    </description>
+    
+
+
+    <modules>
+        <module>mrc-ejb</module>
+        <module>mrc-ear</module>
+    </modules>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-site-plugin</artifactId>
+                <inherited>false</inherited>
+                <configuration>
+                    <outputDirectory>${project.basedir}/docs</outputDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <repositories>
+        <repository>
+            <id>apache-snapshots</id>
+            <name>Apache Snapshots Repository</name>
+            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+        </repository>
+    </repositories>
+
+</project>

Propchange: geronimo/sandbox/monitoring/mrc-server/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/mrc-server/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/mrc-server/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/monitoring/mrc-server/readme.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/readme.txt?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/readme.txt (added)
+++ geronimo/sandbox/monitoring/mrc-server/readme.txt Fri Sep 28 12:34:24 2007
@@ -0,0 +1,12 @@
+HOW TO COMPILE AND DEPLOY
+    1. run `mvn clean install`
+    2. Deploy the JAR file present in the MRC-ejb/target folder along with 
+       MRC.xml present at the home directory into Geronimo.
+       2a. Navigate to <GERONIMO_HOME>/bin/ directory
+       2b. Give it this command
+
+          java -jar ./deployer.jar -u system -p manager deploy <path-to-jar> <path-to-xml>
+
+
+**The snapshot information for the server will reside under the folder
+    <GERONIMO_HOME>/var/

Propchange: geronimo/sandbox/monitoring/mrc-server/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/mrc-server/readme.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/mrc-server/readme.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/mrc-server/readme.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/monitoring/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/pom.xml?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/pom.xml (added)
+++ geronimo/sandbox/monitoring/pom.xml Fri Sep 28 12:34:24 2007
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+     http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    
+
+
+    <modelVersion>4.0.0</modelVersion>
+    
+
+
+    <parent>
+        <groupId>org.apache.geronimo.genesis.config</groupId>
+        <artifactId>project-config</artifactId>
+        <version>1.2</version>
+    </parent>
+    
+
+
+    <groupId>org.apache.geronimo.plugins</groupId>
+    <artifactId>mrc</artifactId>
+    <name>Monitoring and Remote Control</name>
+    <packaging>pom</packaging>
+    <version>1.0-SNAPSHOT</version>
+
+    <description>
+        Geronimo Monitoring and Management
+    </description>
+
+    <properties>
+        <!--
+        NOTE: Project version, to be used instead of ${pom.version} since that
+              value magically changes when using SNAPSHOT versions.
+
+              This value *must* be kept in sync with the value of the <version>
+              element, and it will need to be changed manually before a release,
+              as the maven-release-plugin will not update this value.
+        -->
+        <version>1.0-SNAPSHOT</version>
+        <consoleVersion>1.0-SNAPSHOT</consoleVersion>
+        <geronimoVersion>2.1-SNAPSHOT</geronimoVersion>
+        <geronimoServletSpecVersion>1.1</geronimoServletSpecVersion>
+        <plutoVersion>1.2.0-SNAPSHOT</plutoVersion>
+        <xbeanVersion>3.0.1</xbeanVersion>
+
+        <!-- deployers needed to create the CAR files -->
+        <gbeanDeployer>org.apache.geronimo.configs/geronimo-gbean-deployer/${geronimoVersion}/car</gbeanDeployer>
+        <j2eeDeployer>org.apache.geronimo.configs/j2ee-deployer/${geronimoVersion}/car</j2eeDeployer>
+        <tomcatDeployer>org.apache.geronimo.configs/tomcat6-deployer/${geronimoVersion}/car</tomcatDeployer>
+        <jetty6Deployer>org.apache.geronimo.configs/jetty6-deployer/${geronimoVersion}/car</jetty6Deployer>
+        <jasperDeployer>org.apache.geronimo.configs/jasper-deployer/${geronimoVersion}/car</jasperDeployer>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+
+            <dependency>
+                <groupId>javax.portlet</groupId>
+                <artifactId>portlet-api</artifactId>
+                <version>1.0</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.modules</groupId>
+                <artifactId>geronimo-kernel</artifactId>
+                <version>${geronimoVersion}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.modules</groupId>
+                <artifactId>geronimo-management</artifactId>
+                <version>${geronimoVersion}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.directwebremoting</groupId>
+                <artifactId>dwr</artifactId>
+                <version>2.0.1</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-servlet_2.5_spec</artifactId>
+                <version>${geronimoServletSpecVersion}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.modules</groupId>
+                <artifactId>geronimo-j2ee</artifactId>
+                <version>${geronimoVersion}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.xbean</groupId>
+                <artifactId>xbean-naming</artifactId>
+                <version>${xbeanVersion}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.configs</groupId>
+                <artifactId>geronimo-gbean-deployer</artifactId>
+                <version>${geronimoVersion}</version>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.configs</groupId>
+                <artifactId>dojo-jetty6</artifactId>
+                <version>${geronimoVersion}</version>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.configs</groupId>
+                <artifactId>dojo-tomcat</artifactId>
+                <version>${geronimoVersion}</version>
+                <type>car</type>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>console-core</artifactId>
+                <version>${consoleVersion}</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-connector</artifactId>
+                    </exclusion>
+
+                    <exclusion>
+                        <groupId>javax.portlet</groupId>
+                        <artifactId>portlet-api</artifactId>
+                    </exclusion>
+
+                    <exclusion>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-deploy-jsr88</artifactId>
+                    </exclusion>
+
+                    <exclusion>
+                        <groupId>org.apache.geronimo.specs</groupId>
+                        <artifactId>geronimo-servlet_2.5_spec</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.geronimo.plugins</groupId>
+                    <artifactId>car-maven-plugin</artifactId>
+                    <version>${geronimoVersion}</version>
+                    <extensions>true</extensions>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-enforcer-plugin</artifactId>
+                    <version>1.0-alpha-2</version>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <version>2.0-alpha-4</version>
+                </plugin>
+
+                <!--
+                FIXME: Should not configure war to assume jsp by default
+                -->
+
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-war-plugin</artifactId>
+                    <version>2.0.2</version>
+                    <configuration>
+                        <warSourceDirectory>${pom.basedir}/src/main/webapp</warSourceDirectory>
+                        <archiveClasses>true</archiveClasses>
+                        <archive>
+                            <!-- Do not include META-INF/maven to avoid long file problems on windows -->
+                            <addMavenDescriptor>false</addMavenDescriptor>
+                        </archive>
+
+                        <!--
+                        HACK: Include legal files explicity, otherwise they will end up in the wrong path
+                              or in another jar file in the war.
+
+                        NOTE: targetPath is broken for webResources (as documented)
+                        -->
+                        <webResources>
+                            <resource>
+                                <directory>${project.build.outputDirectory}</directory>
+                                <includes>
+                                    <include>META-INF/LICENSE*</include>
+                                    <include>META-INF/NOTICE*</include>
+                                    <include>META-INF/DISCLAIMER*</include>
+                                </includes>
+                            </resource>
+                        </webResources>
+                    </configuration>
+                </plugin>
+
+                <plugin>
+                    <groupId>org.apache.pluto</groupId>
+                    <artifactId>maven-pluto-plugin</artifactId>
+                    <version>${plutoVersion}</version>
+                </plugin>
+
+            </plugins>
+
+        </pluginManagement>
+
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.geronimo.genesis.plugins</groupId>
+                <artifactId>tools-maven-plugin</artifactId>
+                <!-- Tools includes custom packagings, install as extension to pick them up -->
+                <extensions>true</extensions>
+
+                <executions>
+                    <execution>
+                        <id>install-legal-files</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>copy-legal-files</goal>
+                        </goals>
+                        <configuration>
+                            <!-- Fail the build if no legal files were copied -->
+                            <strict>true</strict>
+                        </configuration>
+                    </execution>
+
+                    <!--   <execution>
+                           <id>verify-legal-files</id>
+                           <phase>verify</phase>
+                           <goals>
+                               <goal>verify-legal-files</goal>
+                           </goals>
+                           <configuration> -->
+                    <!-- Fail the build if no legal files were found -->
+                    <!-- <strict>true</strict>
+                 </configuration>
+             </execution> -->
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.5</source>
+                    <target>1.5</target>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-release-plugin</artifactId>
+                <configuration>
+                    <tagBase>https://svn.apache.org/repos/asf/geronimo/sandbox/portals/tags</tagBase>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <repositories>
+        <!--
+        NOTE: The default repositories are picked up by Genesis, but need to
+              specify where Genesis lives to pick it up  any additional repositories.
+        -->
+
+        <repository>
+            <id>apache-snapshots</id>
+            <name>Apache Snapshots Repository</name>
+            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+            <layout>default</layout>
+            <snapshots>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+                <checksumPolicy>ignore</checksumPolicy>
+            </snapshots>
+            <releases>
+                <enabled>false</enabled>
+            </releases>
+        </repository>
+
+    </repositories>
+
+    <distributionManagement>
+        <!--
+        NOTE: The repository and snapshotRepository are picked up from Genesis.
+        -->
+
+        <site>
+            <id>geronimo-website</id>
+            <url>scp://people.apache.org/www/geronimo.apache.org/maven/portals</url>
+        </site>
+    </distributionManagement>
+
+    <profiles>
+        <profile>
+            <id>default</id>
+
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <modules>
+                <module>mrc-client</module>
+                <module>mrc-server</module>
+            </modules>
+        </profile>
+    </profiles>
+
+</project>

Propchange: geronimo/sandbox/monitoring/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/sandbox/monitoring/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/sandbox/monitoring/readme.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/readme.txt?rev=580468&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/readme.txt (added)
+++ geronimo/sandbox/monitoring/readme.txt Fri Sep 28 12:34:24 2007
@@ -0,0 +1,3 @@
+To build both the client and the server, execute mvn install.
+
+Built packages will be placed in respective directories

Propchange: geronimo/sandbox/monitoring/readme.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/monitoring/readme.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/monitoring/readme.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message