Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 20805 invoked from network); 12 Aug 2007 05:28:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Aug 2007 05:28:40 -0000 Received: (qmail 6803 invoked by uid 500); 12 Aug 2007 05:28:38 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 6762 invoked by uid 500); 12 Aug 2007 05:28:38 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 6752 invoked by uid 99); 12 Aug 2007 05:28:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Aug 2007 22:28:38 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Aug 2007 05:28:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 926551A9868; Sat, 11 Aug 2007 22:27:42 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r565003 [13/17] - in /activemq/trunk: activemq-fileserver/src/main/java/org/apache/activemq/util/ activemq-fileserver/src/test/java/org/apache/activemq/util/ activemq-jaas/src/main/java/org/apache/activemq/jaas/ activemq-jaas/src/test/java/... Date: Sun, 12 Aug 2007 05:27:34 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070812052742.926551A9868@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/properties/ReflectionUtil.java Sat Aug 11 22:27:21 2007 @@ -16,20 +16,20 @@ */ package org.apache.activemq.tool.properties; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Iterator; -import java.util.StringTokenizer; -import java.util.Properties; import java.util.List; -import java.util.ArrayList; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Constructor; +import java.util.Properties; +import java.util.StringTokenizer; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; public final class ReflectionUtil { - private static final Log log = LogFactory.getLog(ReflectionUtil.class); + private static final Log LOG = LogFactory.getLog(ReflectionUtil.class); private ReflectionUtil() { } @@ -39,7 +39,7 @@ String debugInfo; Object target = obj; - Class targetClass = obj.getClass(); + Class targetClass = obj.getClass(); // DEBUG: Debugging Info debugInfo = "Invoking: " + targetClass.getName(); @@ -48,8 +48,9 @@ String keySubString = key; int tokenCount = tokenizer.countTokens(); - // For nested settings, get the object first. -1, do not count the last token - for (int j=0; j(); + this.testPropsList = new ArrayList(); + this.reportDir = reportDir; + this.reportName = reportName; } public void openReportWriter() { @@ -141,7 +142,7 @@ } protected File createXmlFile() { - String filename = (getReportName().endsWith(".xml") ? getReportName() : (getReportName() + ".xml")); + String filename = getReportName().endsWith(".xml") ? getReportName() : (getReportName() + ".xml"); String path = (getReportDir() == null) ? "" : getReportDir(); return new File(path + filename); @@ -158,7 +159,7 @@ writeXmlFooter(); xmlFileWriter.close(); - log.info("Created performance report: " + xmlFile.getAbsolutePath()); + LOG.info("Created performance report: " + xmlFile.getAbsolutePath()); } catch (Exception e) { e.printStackTrace(); } @@ -176,15 +177,15 @@ Properties props; // Write test settings - for (Iterator i=testPropsMap.keySet().iterator(); i.hasNext();) { - String key = (String)i.next(); - props = (Properties)testPropsMap.get(key); + for (Iterator i = testPropsMap.keySet().iterator(); i.hasNext();) { + String key = i.next(); + props = testPropsMap.get(key); writeMap(key, props); } int count = 1; - for (Iterator i=testPropsList.iterator(); i.hasNext();) { - props = (Properties)i.next(); + for (Iterator i = testPropsList.iterator(); i.hasNext();) { + props = i.next(); writeMap("settings" + count++, props); } } @@ -235,7 +236,9 @@ xmlFileWriter.println(""); xmlFileWriter.println(""); - String val, clientName, clientVal; + String val; + String clientName; + String clientVal; System.out.println("#########################################"); System.out.println("#### SYSTEM THROUGHPUT SUMMARY ####"); @@ -267,49 +270,49 @@ val = (String)summary.get(ThroughputReportPlugin.KEY_MIN_CLIENT_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Min Client Throughput Per Sample: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MAX_CLIENT_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Max Client Throughput Per Sample: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MIN_CLIENT_TOTAL_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Min Client Total Throughput: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MAX_CLIENT_TOTAL_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Max Client Total Throughput: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MIN_CLIENT_AVE_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Min Average Client Throughput: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MAX_CLIENT_AVE_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Max Average Client Throughput: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MIN_CLIENT_AVE_EMM_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Min Average Client Throughput Excluding Min/Max: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); val = (String)summary.get(ThroughputReportPlugin.KEY_MAX_CLIENT_AVE_EMM_TP); clientName = val.substring(0, val.indexOf("=")); - clientVal = val.substring(val.indexOf("=") + 1); + clientVal = val.substring(val.indexOf("=") + 1); System.out.println("Max Average Client Throughput Excluding Min/Max: clientName=" + clientName + ", value=" + clientVal); xmlFileWriter.println("clientName=" + clientName + ",value=" + clientVal + ""); @@ -374,7 +377,7 @@ protected void writeMap(String name, Map map) { xmlFileWriter.println(""); xmlFileWriter.println(""); - for (Iterator i=map.keySet().iterator(); i.hasNext();) { + for (Iterator i = map.keySet().iterator(); i.hasNext();) { String propKey = (String)i.next(); Object propVal = map.get(propKey); xmlFileWriter.println("" + propVal.toString() + ""); @@ -388,12 +391,14 @@ String xmlElement; xmlElement = "<" + elementName; - String data, key, val; + String data; + String key; + String val; while (tokenizer.hasMoreTokens()) { data = tokenizer.nextToken(); - key = data.substring(0, data.indexOf("=")); - val = data.substring(data.indexOf("=") + 1); - xmlElement += (" " + key + "='" + val + "'"); + key = data.substring(0, data.indexOf("=")); + val = data.substring(data.indexOf("=") + 1); + xmlElement += " " + key + "='" + val + "'"; } xmlElement += " />"; xmlFileWriter.println(xmlElement); Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/CpuReportPlugin.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/CpuReportPlugin.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/CpuReportPlugin.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/CpuReportPlugin.java Sat Aug 11 22:27:21 2007 @@ -16,18 +16,17 @@ */ package org.apache.activemq.tool.reports.plugins; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.activemq.tool.reports.PerformanceStatisticsUtil; - -import java.util.Map; -import java.util.StringTokenizer; -import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +import org.apache.activemq.tool.reports.PerformanceStatisticsUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; public class CpuReportPlugin implements ReportPlugin { - private static final Log log = LogFactory.getLog(CpuReportPlugin.class); public static final String NAME_IGNORE_LIST = "$index$timeUnit$r$b$w$swpd$inact$active$free$buff$cache$si$so$in$"; public static final String NAME_BLOCK_RECV = "bi"; @@ -54,17 +53,21 @@ public static final String KEY_AVE_IDLE_TIME = "AveIdleTime"; public static final String KEY_AVE_WAIT_TIME = "AveWaitingTime"; - protected List blockRecv = new ArrayList(); - protected List blockSent = new ArrayList(); - protected List ctxSwitch = new ArrayList(); - protected List userTime = new ArrayList(); - protected List sysTime = new ArrayList(); - protected List idleTime = new ArrayList(); - protected List waitTime = new ArrayList(); + private static final Log LOG = LogFactory.getLog(CpuReportPlugin.class); + + protected List blockRecv = new ArrayList(); + protected List blockSent = new ArrayList(); + protected List ctxSwitch = new ArrayList(); + protected List userTime = new ArrayList(); + protected List sysTime = new ArrayList(); + protected List idleTime = new ArrayList(); + protected List waitTime = new ArrayList(); public void handleCsvData(String csvData) { StringTokenizer tokenizer = new StringTokenizer(csvData, ","); - String data, key, val; + String data; + String key; + String val; while (tokenizer.hasMoreTokens()) { data = tokenizer.nextToken(); key = data.substring(0, data.indexOf("=")); @@ -74,10 +77,10 @@ } } - public Map getSummary() { + public Map getSummary() { long val; - Map summary = new HashMap(); + Map summary = new HashMap(); if (blockRecv.size() > 0) { val = PerformanceStatisticsUtil.getSum(blockRecv); @@ -146,7 +149,7 @@ } else if (NAME_IGNORE_LIST.indexOf("$" + key + "$") != -1) { // Ignore key } else { - log.warn("Unrecognized CPU data. " + key + "=" + val); + LOG.warn("Unrecognized CPU data. " + key + "=" + val); } } } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ReportPlugin.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ReportPlugin.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ReportPlugin.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ReportPlugin.java Sat Aug 11 22:27:21 2007 @@ -19,6 +19,6 @@ import java.util.Map; public interface ReportPlugin { - public void handleCsvData(String csvData); - public Map getSummary(); + void handleCsvData(String csvData); + Map getSummary(); } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/reports/plugins/ThroughputReportPlugin.java Sat Aug 11 22:27:21 2007 @@ -16,22 +16,22 @@ */ package org.apache.activemq.tool.reports.plugins; -import org.apache.activemq.tool.reports.PerformanceStatisticsUtil; - -import java.util.Map; +import java.util.ArrayList; import java.util.HashMap; -import java.util.StringTokenizer; +import java.util.Iterator; import java.util.List; -import java.util.ArrayList; +import java.util.Map; import java.util.Set; -import java.util.Iterator; +import java.util.StringTokenizer; + +import org.apache.activemq.tool.reports.PerformanceStatisticsUtil; public class ThroughputReportPlugin implements ReportPlugin { - public static final String KEY_SYS_TOTAL_TP = "SystemTotalTP"; - public static final String KEY_SYS_TOTAL_CLIENTS = "SystemTotalClients"; - public static final String KEY_SYS_AVE_TP = "SystemAveTP"; - public static final String KEY_SYS_AVE_EMM_TP = "SystemAveEMMTP"; - public static final String KEY_SYS_AVE_CLIENT_TP = "SystemAveClientTP"; + public static final String KEY_SYS_TOTAL_TP = "SystemTotalTP"; + public static final String KEY_SYS_TOTAL_CLIENTS = "SystemTotalClients"; + public static final String KEY_SYS_AVE_TP = "SystemAveTP"; + public static final String KEY_SYS_AVE_EMM_TP = "SystemAveEMMTP"; + public static final String KEY_SYS_AVE_CLIENT_TP = "SystemAveClientTP"; public static final String KEY_SYS_AVE_CLIENT_EMM_TP = "SystemAveClientEMMTP"; public static final String KEY_MIN_CLIENT_TP = "MinClientTP"; public static final String KEY_MAX_CLIENT_TP = "MaxClientTP"; @@ -46,12 +46,15 @@ public void handleCsvData(String csvData) { StringTokenizer tokenizer = new StringTokenizer(csvData, ","); - String data, key, val, clientName = null; + String data; + String key; + String val; + String clientName = null; Long throughput = null; while (tokenizer.hasMoreTokens()) { data = tokenizer.nextToken(); - key = data.substring(0, data.indexOf("=")); - val = data.substring(data.indexOf("=") + 1); + key = data.substring(0, data.indexOf("=")); + val = data.substring(data.indexOf("=") + 1); if (key.equalsIgnoreCase("clientName")) { clientName = val; @@ -70,35 +73,35 @@ return new HashMap(); } - long minClientTP = Long.MAX_VALUE, // TP = throughput - maxClientTP = Long.MIN_VALUE, - minClientTotalTP = Long.MAX_VALUE, - maxClientTotalTP = Long.MIN_VALUE, - systemTotalTP = 0; - - double minClientAveTP = Double.MAX_VALUE, - maxClientAveTP = Double.MIN_VALUE, - minClientAveEMMTP = Double.MAX_VALUE, // EMM = Excluding Min/Max - maxClientAveEMMTP = Double.MIN_VALUE, - systemAveTP = 0.0, - systemAveEMMTP = 0.0; - - String nameMinClientTP = "", - nameMaxClientTP = "", - nameMinClientTotalTP = "", - nameMaxClientTotalTP = "", - nameMinClientAveTP = "", - nameMaxClientAveTP = "", - nameMinClientAveEMMTP = "", - nameMaxClientAveEMMTP = ""; + long minClientTP = Long.MAX_VALUE; // TP = throughput + long maxClientTP = Long.MIN_VALUE; + long minClientTotalTP = Long.MAX_VALUE; + long maxClientTotalTP = Long.MIN_VALUE; + long systemTotalTP = 0; + + double minClientAveTP = Double.MAX_VALUE; + double maxClientAveTP = Double.MIN_VALUE; + double minClientAveEMMTP = Double.MAX_VALUE; // EMM = Excluding Min/Max + double maxClientAveEMMTP = Double.MIN_VALUE; + double systemAveTP = 0.0; + double systemAveEMMTP = 0.0; + + String nameMinClientTP = ""; + String nameMaxClientTP = ""; + String nameMinClientTotalTP = ""; + String nameMaxClientTotalTP = ""; + String nameMinClientAveTP = ""; + String nameMaxClientAveTP = ""; + String nameMinClientAveEMMTP = ""; + String nameMaxClientAveEMMTP = ""; Set clientNames = clientThroughputs.keySet(); String clientName; - List clientTPList; + List clientTPList; long tempLong; double tempDouble; int clientCount = 0; - for (Iterator i=clientNames.iterator(); i.hasNext();) { + for (Iterator i = clientNames.iterator(); i.hasNext();) { clientName = i.next(); clientTPList = clientThroughputs.get(clientName); clientCount++; @@ -140,7 +143,8 @@ } tempDouble = PerformanceStatisticsUtil.getAveEx(clientTPList); - systemAveEMMTP += tempDouble; // Accumulate ave throughput excluding min/max + systemAveEMMTP += tempDouble; // Accumulate ave throughput + // excluding min/max if (tempDouble < minClientAveEMMTP) { minClientAveEMMTP = tempDouble; nameMinClientAveEMMTP = clientName; Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/AbstractPerformanceSampler.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/AbstractPerformanceSampler.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/AbstractPerformanceSampler.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/AbstractPerformanceSampler.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -16,69 +16,69 @@ */ package org.apache.activemq.tool.sampler; -import org.apache.activemq.tool.reports.PerformanceReportWriter; -import org.apache.activemq.tool.properties.AbstractObjectProperties; - import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.activemq.tool.properties.AbstractObjectProperties; +import org.apache.activemq.tool.reports.PerformanceReportWriter; + public abstract class AbstractPerformanceSampler extends AbstractObjectProperties implements PerformanceSampler { - protected long rampUpTime = 30 * 1000; // 30 secs - protected long rampDownTime = 30 * 1000; // 30 secs - protected long duration = 5 * 60 * 1000; // 5 mins - protected long interval = 1000; // 1 sec - protected PerformanceReportWriter perfReportWriter = null; - protected PerformanceEventListener perfEventListener = null; - protected final AtomicBoolean isRunning = new AtomicBoolean(false); - - protected long sampleIndex = 0; - - public long getRampUpTime() { - return rampUpTime; - } - - public void setRampUpTime(long rampUpTime) { - this.rampUpTime = rampUpTime; - } - - public long getRampDownTime() { - return rampDownTime; - } - - public void setRampDownTime(long rampDownTime) { - this.rampDownTime = rampDownTime; - } - - public long getDuration() { - return duration; - } - - public void setDuration(long duration) { - this.duration = duration; - } - - public long getInterval() { - return interval; - } - - public void setInterval(long interval) { - this.interval = interval; - } - - public PerformanceReportWriter getPerfReportWriter() { - return perfReportWriter; - } - - public void setPerfReportWriter(PerformanceReportWriter perfReportWriter) { - this.perfReportWriter = perfReportWriter; - } - - public PerformanceEventListener getPerfEventListener() { - return perfEventListener; - } - - public void setPerfEventListener(PerformanceEventListener perfEventListener) { - this.perfEventListener = perfEventListener; - } + + protected long rampUpTime = 30 * 1000; // 30 secs + protected long rampDownTime = 30 * 1000; // 30 secs + protected long duration = 5 * 60 * 1000; // 5 mins + protected long interval = 1000; // 1 sec + protected PerformanceReportWriter perfReportWriter; + protected PerformanceEventListener perfEventListener; + protected final AtomicBoolean isRunning = new AtomicBoolean(false); + protected long sampleIndex; + + public long getRampUpTime() { + return rampUpTime; + } + + public void setRampUpTime(long rampUpTime) { + this.rampUpTime = rampUpTime; + } + + public long getRampDownTime() { + return rampDownTime; + } + + public void setRampDownTime(long rampDownTime) { + this.rampDownTime = rampDownTime; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public long getInterval() { + return interval; + } + + public void setInterval(long interval) { + this.interval = interval; + } + + public PerformanceReportWriter getPerfReportWriter() { + return perfReportWriter; + } + + public void setPerfReportWriter(PerformanceReportWriter perfReportWriter) { + this.perfReportWriter = perfReportWriter; + } + + public PerformanceEventListener getPerfEventListener() { + return perfEventListener; + } + + public void setPerfEventListener(PerformanceEventListener perfEventListener) { + this.perfEventListener = perfEventListener; + } public void startSampler() { isRunning.set(true); @@ -90,7 +90,7 @@ try { onRampUpStart(); if (perfEventListener != null) { - perfEventListener.onRampUpStart(this); + perfEventListener.onRampUpStart(this); } try { @@ -101,14 +101,14 @@ onSamplerStart(); if (perfEventListener != null) { - perfEventListener.onSamplerStart(this); + perfEventListener.onSamplerStart(this); } sample(); onSamplerEnd(); if (perfEventListener != null) { - perfEventListener.onSamplerEnd(this); + perfEventListener.onSamplerEnd(this); } try { @@ -119,7 +119,7 @@ onRampDownEnd(); if (perfEventListener != null) { - perfEventListener.onRampDownEnd(this); + perfEventListener.onRampDownEnd(this); } } finally { isRunning.set(false); @@ -127,7 +127,7 @@ isRunning.notifyAll(); } } - } + } protected void sample() { // Compute for the actual duration window of the sampler @@ -147,11 +147,11 @@ public abstract void sampleData(); public boolean isRunning() { - return isRunning.get(); - } + return isRunning.get(); + } - public void waitUntilDone() { - while (isRunning()) { + public void waitUntilDone() { + while (isRunning()) { try { synchronized (isRunning) { isRunning.wait(0); @@ -160,11 +160,18 @@ e.printStackTrace(); } } - } + } // Call back functions to customize behavior of thread. - protected void onRampUpStart() {} - protected void onSamplerStart() {} - protected void onSamplerEnd() {} - protected void onRampDownEnd() {} + protected void onRampUpStart() { + } + + protected void onSamplerStart() { + } + + protected void onSamplerEnd() { + } + + protected void onRampDownEnd() { + } } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/CpuSamplerTask.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/CpuSamplerTask.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/CpuSamplerTask.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/CpuSamplerTask.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -16,15 +16,15 @@ */ package org.apache.activemq.tool.sampler; +import java.io.IOException; + +import org.apache.activemq.tool.reports.AbstractPerfReportWriter; import org.apache.activemq.tool.sampler.plugins.CpuSamplerPlugin; import org.apache.activemq.tool.sampler.plugins.LinuxCpuSamplerPlugin; -import org.apache.activemq.tool.reports.AbstractPerfReportWriter; - -import java.io.IOException; public class CpuSamplerTask extends AbstractPerformanceSampler { - private CpuSamplerPlugin plugin = null; + private CpuSamplerPlugin plugin; public void createPlugin() throws IOException { createPlugin(System.getProperty("os.name")); Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/MeasurableClient.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/MeasurableClient.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/MeasurableClient.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/MeasurableClient.java Sat Aug 11 22:27:21 2007 @@ -17,7 +17,9 @@ package org.apache.activemq.tool.sampler; public interface MeasurableClient { - public void reset(); - public String getClientName(); - public long getThroughput(); + + void reset(); + String getClientName(); + long getThroughput(); + } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceEventListener.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceEventListener.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceEventListener.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceEventListener.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -16,9 +16,12 @@ */ package org.apache.activemq.tool.sampler; -public interface PerformanceEventListener { - public void onRampUpStart(PerformanceSampler sampler); - public void onSamplerStart(PerformanceSampler sampler); - public void onSamplerEnd(PerformanceSampler sampler); - public void onRampDownEnd(PerformanceSampler sampler); +interface PerformanceEventListener { + void onRampUpStart(PerformanceSampler sampler); + + void onSamplerStart(PerformanceSampler sampler); + + void onSamplerEnd(PerformanceSampler sampler); + + void onRampDownEnd(PerformanceSampler sampler); } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceSampler.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceSampler.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceSampler.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/PerformanceSampler.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -19,20 +19,34 @@ import org.apache.activemq.tool.reports.PerformanceReportWriter; public interface PerformanceSampler extends Runnable { - public long getRampUpTime(); - public void setRampUpTime(long rampUpTime); - public long getRampDownTime(); - public void setRampDownTime(long rampDownTime); - public long getDuration(); - public void setDuration(long duration); - public long getInterval(); - public void setInterval(long interval); - public PerformanceReportWriter getPerfReportWriter(); - public void setPerfReportWriter(PerformanceReportWriter writer); - public PerformanceEventListener getPerfEventListener(); - public void setPerfEventListener(PerformanceEventListener listener); - - public void sampleData(); - public boolean isRunning(); - public void waitUntilDone(); + + long getRampUpTime(); + + void setRampUpTime(long rampUpTime); + + long getRampDownTime(); + + void setRampDownTime(long rampDownTime); + + long getDuration(); + + void setDuration(long duration); + + long getInterval(); + + void setInterval(long interval); + + PerformanceReportWriter getPerfReportWriter(); + + void setPerfReportWriter(PerformanceReportWriter writer); + + PerformanceEventListener getPerfEventListener(); + + void setPerfEventListener(PerformanceEventListener listener); + + void sampleData(); + + boolean isRunning(); + + void waitUntilDone(); } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/ThroughputSamplerTask.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/ThroughputSamplerTask.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/ThroughputSamplerTask.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/ThroughputSamplerTask.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -16,16 +16,16 @@ */ package org.apache.activemq.tool.sampler; -import org.apache.activemq.tool.reports.AbstractPerfReportWriter; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.activemq.tool.reports.AbstractPerfReportWriter; + public class ThroughputSamplerTask extends AbstractPerformanceSampler { private final Object mutex = new Object(); - private List clients = new ArrayList(); + private List clients = new ArrayList(); public void registerClient(MeasurableClient client) { synchronized (mutex) { @@ -33,22 +33,21 @@ } } - public void sampleData() { - for (Iterator i = clients.iterator(); i.hasNext();) { - MeasurableClient client = (MeasurableClient) i.next(); + public void sampleData() { + for (Iterator i = clients.iterator(); i.hasNext();) { + MeasurableClient client = i.next(); if (perfReportWriter != null) { - perfReportWriter.writeCsvData(AbstractPerfReportWriter.REPORT_PLUGIN_THROUGHPUT, - "index=" + sampleIndex + ",clientName=" + client.getClientName() + - ",throughput=" + client.getThroughput()); + perfReportWriter.writeCsvData(AbstractPerfReportWriter.REPORT_PLUGIN_THROUGHPUT, "index=" + sampleIndex + ",clientName=" + client.getClientName() + ",throughput=" + + client.getThroughput()); } client.reset(); } - } + } protected void onSamplerStart() { // Reset the throughput of the clients - for (Iterator i = clients.iterator(); i.hasNext();) { - MeasurableClient client = (MeasurableClient) i.next(); + for (Iterator i = clients.iterator(); i.hasNext();) { + MeasurableClient client = i.next(); client.reset(); } } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/CpuSamplerPlugin.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/CpuSamplerPlugin.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/CpuSamplerPlugin.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/CpuSamplerPlugin.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -17,21 +17,24 @@ package org.apache.activemq.tool.sampler.plugins; public interface CpuSamplerPlugin { - public final static String WINDOWS_2000 = "Windows 2000"; - public final static String WINDOWS_NT = "Windows NT"; - public final static String WINDOWS_XP = "Windows XP"; - public final static String WINDOWS_95 = "Windows 95"; - public final static String WINDOWS_CE = "Windows CE"; - public final static String LINUX = "Linux"; - public final static String SOLARIS = "Solaris"; - public final static String AIX = "AIX"; - public final static String FREEBSD = "FreeBSD"; - public final static String MAC_OS = "Mac OS"; - public final static String MAC_OS_X = "Mac OS X"; - public final static String POWERPC = "PowerPC"; - public final static String OS_2 = "OS/2"; + + String WINDOWS_2000 = "Windows 2000"; + String WINDOWS_NT = "Windows NT"; + String WINDOWS_XP = "Windows XP"; + String WINDOWS_95 = "Windows 95"; + String WINDOWS_CE = "Windows CE"; + String LINUX = "Linux"; + String SOLARIS = "Solaris"; + String AIX = "AIX"; + String FREEBSD = "FreeBSD"; + String MAC_OS = "Mac OS"; + String MAC_OS_X = "Mac OS X"; + String POWERPC = "PowerPC"; + String OS_2 = "OS/2"; - public String getCpuUtilizationStats(); - public void start(); - public void stop(); + String getCpuUtilizationStats(); + + void start(); + + void stop(); } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/LinuxCpuSamplerPlugin.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/LinuxCpuSamplerPlugin.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/LinuxCpuSamplerPlugin.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/sampler/plugins/LinuxCpuSamplerPlugin.java Sat Aug 11 22:27:21 2007 @@ -5,9 +5,9 @@ * 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 - * + * + * 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. @@ -16,12 +16,11 @@ */ package org.apache.activemq.tool.sampler.plugins; -import java.util.concurrent.atomic.AtomicBoolean; - import java.io.BufferedReader; -import java.io.InputStreamReader; import java.io.IOException; +import java.io.InputStreamReader; import java.util.StringTokenizer; +import java.util.concurrent.atomic.AtomicBoolean; public class LinuxCpuSamplerPlugin implements CpuSamplerPlugin, Runnable { @@ -87,23 +86,23 @@ return data; } - public String getVmstat() { - return vmstat; - } - - public void setVmstat(String vmstat) { - this.vmstat = vmstat; - } + public String getVmstat() { + return vmstat; + } + + public void setVmstat(String vmstat) { + this.vmstat = vmstat; + } protected String convertToCSV(String header, String data) { - StringTokenizer headerTokens = new StringTokenizer(header, " "); - StringTokenizer dataTokens = new StringTokenizer(data, " "); + StringTokenizer headerTokens = new StringTokenizer(header, " "); + StringTokenizer dataTokens = new StringTokenizer(data, " "); - String csv = ""; - while (headerTokens.hasMoreTokens()) { - csv += (headerTokens.nextToken() + "=" + dataTokens.nextToken() + ","); - } + String csv = ""; + while (headerTokens.hasMoreTokens()) { + csv += headerTokens.nextToken() + "=" + dataTokens.nextToken() + ","; + } - return csv; - } + return csv; + } } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ActiveMQPojoSPI.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ActiveMQPojoSPI.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ActiveMQPojoSPI.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ActiveMQPojoSPI.java Sat Aug 11 22:27:21 2007 @@ -16,10 +16,11 @@ */ package org.apache.activemq.tool.spi; -import org.apache.activemq.ActiveMQConnectionFactory; +import java.util.Properties; import javax.jms.ConnectionFactory; -import java.util.Properties; + +import org.apache.activemq.ActiveMQConnectionFactory; public class ActiveMQPojoSPI implements SPIConnectionFactory { public static final String KEY_BROKER_URL = "brokerUrl"; Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ClassLoaderSPIConnectionFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ClassLoaderSPIConnectionFactory.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ClassLoaderSPIConnectionFactory.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ClassLoaderSPIConnectionFactory.java Sat Aug 11 22:27:21 2007 @@ -16,22 +16,23 @@ */ package org.apache.activemq.tool.spi; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.jms.ConnectionFactory; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.List; -import java.util.ArrayList; import java.io.File; import java.net.URL; import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; +import java.util.StringTokenizer; + +import javax.jms.ConnectionFactory; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; public abstract class ClassLoaderSPIConnectionFactory implements SPIConnectionFactory { - private static final Log log = LogFactory.getLog(ClassLoaderSPIConnectionFactory.class); public static final String KEY_EXT_DIR = "extDir"; + private static final Log LOG = LogFactory.getLog(ClassLoaderSPIConnectionFactory.class); public final ConnectionFactory createConnectionFactory(Properties settings) throws Exception { @@ -46,30 +47,30 @@ String extDir = (String)settings.remove(KEY_EXT_DIR); if (extDir != null) { StringTokenizer tokens = new StringTokenizer(extDir, ";,"); - List urls = new ArrayList(); + List urls = new ArrayList(); while (tokens.hasMoreTokens()) { String dir = tokens.nextToken(); try { File f = new File(dir); if (!f.exists()) { - log.warn("Cannot find extension dir: " + f.getAbsolutePath()); + LOG.warn("Cannot find extension dir: " + f.getAbsolutePath()); } else { - log.info("Adding extension dir: " + f.getAbsolutePath()); + LOG.info("Adding extension dir: " + f.getAbsolutePath()); urls.add(f.toURL()); File[] files = f.listFiles(); - if( files!=null ) { + if (files != null) { for (int j = 0; j < files.length; j++) { - if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar") ) { - log.info("Adding extension dir: " + files[j].getAbsolutePath()); + if (files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar")) { + LOG.info("Adding extension dir: " + files[j].getAbsolutePath()); urls.add(files[j].toURL()); } } } } } catch (Exception e) { - log.warn("Failed to load ext dir: " + dir + ". Reason: " + e); + LOG.warn("Failed to load ext dir: " + dir + ". Reason: " + e); } } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ReflectionSPIConnectionFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ReflectionSPIConnectionFactory.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ReflectionSPIConnectionFactory.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/ReflectionSPIConnectionFactory.java Sat Aug 11 22:27:21 2007 @@ -16,10 +16,11 @@ */ package org.apache.activemq.tool.spi; -import org.apache.activemq.tool.properties.ReflectionUtil; +import java.util.Properties; import javax.jms.ConnectionFactory; -import java.util.Properties; + +import org.apache.activemq.tool.properties.ReflectionUtil; public abstract class ReflectionSPIConnectionFactory extends ClassLoaderSPIConnectionFactory { Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/SPIConnectionFactory.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/SPIConnectionFactory.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/SPIConnectionFactory.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/spi/SPIConnectionFactory.java Sat Aug 11 22:27:21 2007 @@ -16,10 +16,14 @@ */ package org.apache.activemq.tool.spi; -import javax.jms.ConnectionFactory; import java.util.Properties; +import javax.jms.ConnectionFactory; + public interface SPIConnectionFactory { - public ConnectionFactory createConnectionFactory(Properties settings) throws Exception; - public void configureConnectionFactory(ConnectionFactory jmsFactory, Properties settings) throws Exception; + + ConnectionFactory createConnectionFactory(Properties settings) throws Exception; + + void configureConnectionFactory(ConnectionFactory jmsFactory, Properties settings) throws Exception; + } Modified: activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-perf-plugin/src/test/java/org/apache/activemq/tool/ReflectionUtilTest.java Sat Aug 11 22:27:21 2007 @@ -16,13 +16,12 @@ */ package org.apache.activemq.tool; -import junit.framework.TestCase; - -import java.util.Properties; import java.io.File; +import java.util.Properties; -import org.apache.activemq.tool.properties.ReflectionUtil; +import junit.framework.TestCase; import org.apache.activemq.tool.properties.ReflectionConfigurable; +import org.apache.activemq.tool.properties.ReflectionUtil; public class ReflectionUtilTest extends TestCase { public void testConfigurableOption() { @@ -186,8 +185,8 @@ public class TestClass1 { private boolean booleanData; - private int intData; - private long longData; + private int intData; + private long longData; public boolean isBooleanData() { return booleanData; @@ -215,9 +214,9 @@ } public class TestClass2 extends TestClass1 { - private float floatData; - private byte byteData; - private char charData; + private float floatData; + private byte byteData; + private char charData; public float getFloatData() { return floatData; @@ -245,9 +244,9 @@ } public class TestClass3 extends TestClass2 { - private short shortData; - private double doubleData; - private String stringData; + private short shortData; + private double doubleData; + private String stringData; private TestClass3 testData; public short getShortData() { @@ -296,9 +295,9 @@ } public class TestClass5 implements ReflectionConfigurable { - public boolean intercepted = false; + public boolean intercepted; public boolean willIntercept = true; - public TestClass5 nest = null; + public TestClass5 nest; public void configureProperties(Properties props) { // Do nothing @@ -324,8 +323,8 @@ } public class TestClass6 { - public TestClass6 nestNotConfig = null; - public TestClass5 nestConfig = null; + public TestClass6 nestNotConfig; + public TestClass5 nestConfig; public TestClass6 getNestNotConfig() { return nestNotConfig; Modified: activemq/trunk/activemq-tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java (original) +++ activemq/trunk/activemq-tooling/maven-activemq-plugin/src/main/java/org/apache/activemq/maven/BrokerMojo.java Sat Aug 11 22:27:21 2007 @@ -1,3 +1,19 @@ +/** + * 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.activemq.maven; /** @@ -17,50 +33,51 @@ * limitations under the License. */ +import java.util.Properties; + import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerService; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; -import java.util.Properties; - /** * Goal which starts an activemq broker. - * + * * @goal run * @phase process-sources */ public class BrokerMojo extends AbstractMojo { /** - * The maven project. - * - * @parameter expression="${project}" - * @required - * @readonly - */ - protected MavenProject project; + * The maven project. + * + * @parameter expression="${project}" + * @required + * @readonly + */ + protected MavenProject project; /** - * The broker configuration uri - * - * The list of currently supported URI syntaxes is described - * here - * - * @parameter expression="${configUri}" default-value="broker:(tcp://localhost:61616)?useJmx=false&persistent=false" + * The broker configuration uri The list of currently supported URI syntaxes + * is described here + * + * @parameter expression="${configUri}" + * default-value="broker:(tcp://localhost:61616)?useJmx=false&persistent=false" * @required */ private String configUri; /** * Indicates whether to fork the broker, useful for integration tests. - * + * * @parameter expression="${fork}" default-value="false" */ private boolean fork; /** * System properties to add + * * @parameter expression="${systemProperties}" */ private Properties systemProperties; @@ -93,22 +110,25 @@ /** * Wait for a shutdown invocation elsewhere + * * @throws Exception */ protected void waitForShutdown(BrokerService broker) throws Exception { - final boolean[] shutdown = new boolean[] {false}; + final boolean[] shutdown = new boolean[] { + false + }; Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { - synchronized(shutdown) { - shutdown[0]=true; + synchronized (shutdown) { + shutdown[0] = true; shutdown.notify(); } } }); // Wait for any shutdown event - synchronized(shutdown) { - while( !shutdown[0] ) { + synchronized (shutdown) { + while (!shutdown[0]) { try { shutdown.wait(); } catch (InterruptedException e) { Modified: activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacade.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacade.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacade.java (original) +++ activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacade.java Sat Aug 11 22:27:21 2007 @@ -16,12 +16,12 @@ */ package org.apache.activemq.web; +import java.util.Collection; + import org.apache.activemq.broker.jmx.BrokerViewMBean; import org.apache.activemq.broker.jmx.QueueViewMBean; import org.apache.activemq.broker.jmx.TopicViewMBean; import org.apache.activemq.command.ActiveMQDestination; - -import java.util.Collection; /** * A facade for either a local in JVM broker or a remote broker over JMX Modified: activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java?view=diff&rev=565003&r1=565002&r2=565003 ============================================================================== --- activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java (original) +++ activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/BrokerFacadeSupport.java Sat Aug 11 22:27:21 2007 @@ -16,21 +16,22 @@ */ package org.apache.activemq.web; -import org.apache.activemq.broker.jmx.BrokerViewMBean; -import org.apache.activemq.broker.jmx.DurableSubscriptionViewMBean; -import org.apache.activemq.broker.jmx.ManagementContext; -import org.apache.activemq.broker.jmx.TopicViewMBean; -import org.apache.activemq.broker.jmx.QueueViewMBean; -import org.apache.activemq.broker.jmx.DestinationViewMBean; - -import javax.management.MBeanServer; -import javax.management.MBeanServerInvocationHandler; -import javax.management.ObjectName; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.Iterator; +import java.util.List; + +import javax.management.MBeanServer; +import javax.management.MBeanServerInvocationHandler; +import javax.management.ObjectName; + +import org.apache.activemq.broker.jmx.BrokerViewMBean; +import org.apache.activemq.broker.jmx.DestinationViewMBean; +import org.apache.activemq.broker.jmx.DurableSubscriptionViewMBean; +import org.apache.activemq.broker.jmx.ManagementContext; +import org.apache.activemq.broker.jmx.QueueViewMBean; +import org.apache.activemq.broker.jmx.TopicViewMBean; /** * A useful base class for an implementation of {@link BrokerFacade} @@ -40,7 +41,7 @@ public abstract class BrokerFacadeSupport implements BrokerFacade { public abstract ManagementContext getManagementContext(); - public Collection getQueues() throws Exception { + public Collection getQueues() throws Exception { BrokerViewMBean broker = getBrokerAdmin(); if (broker == null) { return Collections.EMPTY_LIST; @@ -49,7 +50,7 @@ return getManagedObjects(queues, QueueViewMBean.class); } - public Collection getTopics() throws Exception { + public Collection getTopics() throws Exception { BrokerViewMBean broker = getBrokerAdmin(); if (broker == null) { return Collections.EMPTY_LIST; @@ -58,7 +59,7 @@ return getManagedObjects(queues, TopicViewMBean.class); } - public Collection getDurableTopicSubscribers() throws Exception { + public Collection getDurableTopicSubscribers() throws Exception { BrokerViewMBean broker = getBrokerAdmin(); if (broker == null) { return Collections.EMPTY_LIST; @@ -75,8 +76,8 @@ return (TopicViewMBean) getDestinationByName(getTopics(), name); } - protected DestinationViewMBean getDestinationByName(Collection collection, String name) { - Iterator iter = collection.iterator(); + protected DestinationViewMBean getDestinationByName(Collection collection, String name) { + Iterator iter = collection.iterator(); while (iter.hasNext()) { DestinationViewMBean destinationViewMBean = (DestinationViewMBean) iter.next(); if (name.equals(destinationViewMBean.getName())) { @@ -86,8 +87,8 @@ return null; } - protected Collection getManagedObjects(ObjectName[] names, Class type) { - List answer = new ArrayList(); + protected Collection getManagedObjects(ObjectName[] names, Class type) { + List answer = new ArrayList(); MBeanServer mbeanServer = getManagementContext().getMBeanServer(); if (mbeanServer != null) { for (int i = 0; i < names.length; i++) {