activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r565003 [8/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/o...
Date Sun, 12 Aug 2007 05:27:34 GMT
Modified: activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/OpenWireGenerator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/OpenWireGenerator.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/OpenWireGenerator.java (original)
+++ activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/OpenWireGenerator.java Sat Aug 11 22:27:21 2007
@@ -33,17 +33,17 @@
     protected int openwireVersion;
     protected String filePostFix = ".java";
     protected JamService jam;
-    
 
-	public boolean isValidProperty(JProperty it) {
+    public boolean isValidProperty(JProperty it) {
         JMethod getter = it.getGetter();
-        return getter != null && it.getSetter() != null && getter.isStatic() == false && getter.getAnnotation("openwire:property") != null;
+        return getter != null && it.getSetter() != null && !getter.isStatic() && getter.getAnnotation("openwire:property") != null;
     }
 
     public boolean isCachedProperty(JProperty it) {
         JMethod getter = it.getGetter();
-        if (!isValidProperty(it))
+        if (!isValidProperty(it)) {
             return false;
+        }
         JAnnotationValue value = getter.getAnnotation("openwire:property").getValue("cache");
         return value != null && value.asBoolean();
     }
@@ -110,34 +110,30 @@
         String name = type.getSimpleName();
         if (name.equals("String")) {
             return "string";
-        }
-        else if (name.equals("Throwable") || name.equals("Exception")) {
+        } else if (name.equals("Throwable") || name.equals("Exception")) {
             return "BrokerError";
-        }
-        else if (name.equals("ByteSequence")) {
+        } else if (name.equals("ByteSequence")) {
             return "byte[]";
-        }
-        else if (name.equals("boolean")) {
+        } else if (name.equals("boolean")) {
             return "bool";
-        }
-        else {
+        } else {
             return name;
         }
     }
 
     public String getOpenWireOpCode(JClass element) {
-    	if (element != null) {
-			JAnnotation annotation = element.getAnnotation("openwire:marshaller");
-			return stringValue(annotation, "code", "0");
-		}
-		return "0";
+        if (element != null) {
+            JAnnotation annotation = element.getAnnotation("openwire:marshaller");
+            return stringValue(annotation, "code", "0");
+        }
+        return "0";
     }
-    
+
     protected String stringValue(JAnnotation annotation, String name) {
-		return stringValue(annotation, name, null);
-	}
-	
-	protected String stringValue(JAnnotation annotation, String name, String defaultValue) {
+        return stringValue(annotation, name, null);
+    }
+
+    protected String stringValue(JAnnotation annotation, String name, String defaultValue) {
         if (annotation != null) {
             JAnnotationValue value = annotation.getValue(name);
             if (value != null) {
@@ -145,23 +141,23 @@
             }
         }
         return defaultValue;
-	}
+    }
 
-	public void setJam(JamService jam) {
-		this.jam = jam;
-	}
-	
-	public String decapitalize(String text) {
-		if (text == null) {
-			return null;
-		}
-		return text.substring(0, 1).toLowerCase() + text.substring(1);
-	}
-
-	public String capitalize(String text) {
-		if (text == null) {
-			return null;
-		}
-		return text.substring(0, 1).toUpperCase() + text.substring(1);
-	}
+    public void setJam(JamService jam) {
+        this.jam = jam;
+    }
+
+    public String decapitalize(String text) {
+        if (text == null) {
+            return null;
+        }
+        return text.substring(0, 1).toLowerCase() + text.substring(1);
+    }
+
+    public String capitalize(String text) {
+        if (text == null) {
+            return null;
+        }
+        return text.substring(0, 1).toUpperCase() + text.substring(1);
+    }
 }

Modified: activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/SingleSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/SingleSourceGenerator.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/SingleSourceGenerator.java (original)
+++ activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/SingleSourceGenerator.java Sat Aug 11 22:27:21 2007
@@ -32,12 +32,11 @@
 import org.codehaus.jam.JamClassIterator;
 
 /**
- * 
  * @version $Revision: 386442 $
  */
 public abstract class SingleSourceGenerator extends OpenWireGenerator {
-	
-    protected Set manuallyMaintainedClasses = new HashSet();
+
+    protected Set<String> manuallyMaintainedClasses = new HashSet<String>();
     protected File destFile;
 
     protected JClass jclass;
@@ -45,36 +44,36 @@
     protected String simpleName;
     protected String className;
     protected String baseClass;
-	protected List sortedClasses;
+    protected List<JClass> sortedClasses;
 
     public SingleSourceGenerator() {
         initialiseManuallyMaintainedClasses();
     }
 
     public Object run() {
-    	
+
         if (destFile == null) {
             throw new IllegalArgumentException("No destFile defined!");
-        }        
+        }
         destFile.getParentFile().mkdirs();
 
         PrintWriter out = null;
         try {
-        	out =  new PrintWriter(new FileWriter(destFile));
-        	
-        	ArrayList classes = new ArrayList();        	
-   	     	JamClassIterator iter = getClasses();
+            out = new PrintWriter(new FileWriter(destFile));
+
+            ArrayList<JClass> classes = new ArrayList<JClass>();
+            JamClassIterator iter = getClasses();
             while (iter.hasNext()) {
-				jclass = iter.nextClass();				
+                jclass = iter.nextClass();
                 if (isValidClass(jclass)) {
-                	classes.add(jclass);
+                    classes.add(jclass);
                 }
             }
-   	        sortedClasses = sort(classes);
-   	        
-        	generateSetup(out);
-   	        for (Iterator iterator = sortedClasses.iterator(); iterator.hasNext();) {
-				jclass = (JClass) iterator.next();				
+            sortedClasses = sort(classes);
+
+            generateSetup(out);
+            for (Iterator<JClass> iterator = sortedClasses.iterator(); iterator.hasNext();) {
+                jclass = iterator.next();
                 simpleName = jclass.getSimpleName();
                 superclass = jclass.getSuperclass();
                 className = getClassName(jclass);
@@ -82,9 +81,9 @@
 
                 System.out.println(getClass().getName() + " processing class: " + simpleName);
                 generateFile(out);
-            }        
+            }
             generateTearDown(out);
-        	
+
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {
@@ -92,8 +91,9 @@
                 out.close();
             }
         }
-        
-        // Use the FixCRLF Ant Task to make sure the file has consistent newlines
+
+        // Use the FixCRLF Ant Task to make sure the file has consistent
+        // newlines
         // so that SVN does not complain on checkin.
         Project project = new Project();
         project.init();
@@ -104,22 +104,22 @@
         fixCRLF.execute();
         return null;
     }
-    
-    protected List sort(List classes) {
-		return classes;
-	}
 
-	protected void generateTearDown(PrintWriter out) {
-	}
+    protected List<JClass> sort(List<JClass> classes) {
+        return classes;
+    }
+
+    protected void generateTearDown(PrintWriter out) {
+    }
 
     protected void generateSetup(PrintWriter out) {
-	}
+    }
 
-	/**
+    /**
      * Returns all the valid properties available on the current class
      */
-    public List getProperties() {
-        List answer = new ArrayList();
+    public List<JProperty> getProperties() {
+        List<JProperty> answer = new ArrayList<JProperty>();
         JProperty[] properties = jclass.getDeclaredProperties();
         for (int i = 0; i < properties.length; i++) {
             JProperty property = properties[i];
@@ -131,14 +131,13 @@
     }
 
     protected boolean isValidClass(JClass jclass) {
-        if (jclass==null || jclass.getAnnotation("openwire:marshaller") == null) {
+        if (jclass == null || jclass.getAnnotation("openwire:marshaller") == null) {
             return false;
         }
         return true;
-        //return !manuallyMaintainedClasses.contains(jclass.getSimpleName());
+        // return !manuallyMaintainedClasses.contains(jclass.getSimpleName());
     }
 
-
     protected abstract void generateFile(PrintWriter out) throws Exception;
 
     protected String getBaseClassName(JClass jclass) {
@@ -155,7 +154,7 @@
     protected String getClassName(JClass jclass) {
         return jclass.getSimpleName();
     }
-    
+
     public boolean isAbstractClass() {
         return jclass != null && jclass.isAbstract();
     }
@@ -163,75 +162,76 @@
     public String getAbstractClassText() {
         return isAbstractClass() ? "abstract " : "";
     }
-    
+
     public boolean isMarshallerAware() {
         return isMarshallAware(jclass);
     }
 
     protected void initialiseManuallyMaintainedClasses() {
-        String[] names = { "ActiveMQDestination", "ActiveMQTempDestination", "ActiveMQQueue", "ActiveMQTopic", "ActiveMQTempQueue", "ActiveMQTempTopic",
-                "BaseCommand", "ActiveMQMessage", "ActiveMQTextMessage", "ActiveMQMapMessage", "ActiveMQBytesMessage", "ActiveMQStreamMessage",
-                "ActiveMQStreamMessage", "DataStructureSupport", "WireFormatInfo", "ActiveMQObjectMessage" };
+        String[] names = {
+            "ActiveMQDestination", "ActiveMQTempDestination", "ActiveMQQueue", "ActiveMQTopic", "ActiveMQTempQueue", "ActiveMQTempTopic", "BaseCommand", "ActiveMQMessage", "ActiveMQTextMessage",
+            "ActiveMQMapMessage", "ActiveMQBytesMessage", "ActiveMQStreamMessage", "ActiveMQStreamMessage", "DataStructureSupport", "WireFormatInfo", "ActiveMQObjectMessage"
+        };
 
         for (int i = 0; i < names.length; i++) {
             manuallyMaintainedClasses.add(names[i]);
         }
     }
 
-	public String getBaseClass() {
-		return baseClass;
-	}
-
-	public void setBaseClass(String baseClass) {
-		this.baseClass = baseClass;
-	}
-
-	public String getClassName() {
-		return className;
-	}
-
-	public void setClassName(String className) {
-		this.className = className;
-	}
-
-	public File getDestFile() {
-		return destFile;
-	}
-
-	public void setDestFile(File destFile) {
-		this.destFile = destFile;
-	}
-
-	public JClass getJclass() {
-		return jclass;
-	}
-
-	public void setJclass(JClass jclass) {
-		this.jclass = jclass;
-	}
-
-	public Set getManuallyMaintainedClasses() {
-		return manuallyMaintainedClasses;
-	}
-
-	public void setManuallyMaintainedClasses(Set manuallyMaintainedClasses) {
-		this.manuallyMaintainedClasses = manuallyMaintainedClasses;
-	}
-
-	public String getSimpleName() {
-		return simpleName;
-	}
-
-	public void setSimpleName(String simpleName) {
-		this.simpleName = simpleName;
-	}
-
-	public JClass getSuperclass() {
-		return superclass;
-	}
-
-	public void setSuperclass(JClass superclass) {
-		this.superclass = superclass;
-	}
+    public String getBaseClass() {
+        return baseClass;
+    }
+
+    public void setBaseClass(String baseClass) {
+        this.baseClass = baseClass;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+
+    public File getDestFile() {
+        return destFile;
+    }
+
+    public void setDestFile(File destFile) {
+        this.destFile = destFile;
+    }
+
+    public JClass getJclass() {
+        return jclass;
+    }
+
+    public void setJclass(JClass jclass) {
+        this.jclass = jclass;
+    }
+
+    public Set<String> getManuallyMaintainedClasses() {
+        return manuallyMaintainedClasses;
+    }
+
+    public void setManuallyMaintainedClasses(Set<String> manuallyMaintainedClasses) {
+        this.manuallyMaintainedClasses = manuallyMaintainedClasses;
+    }
+
+    public String getSimpleName() {
+        return simpleName;
+    }
+
+    public void setSimpleName(String simpleName) {
+        this.simpleName = simpleName;
+    }
+
+    public JClass getSuperclass() {
+        return superclass;
+    }
+
+    public void setSuperclass(JClass superclass) {
+        this.superclass = superclass;
+    }
 
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/axis/ActiveMQVendorAdapter.java Sat Aug 11 22:27:21 2007
@@ -16,57 +16,55 @@
  */
 package org.apache.activemq.axis;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.axis.components.jms.BeanVendorAdapter;
-import org.apache.axis.transport.jms.JMSURLHelper;
+import java.util.HashMap;
 
 import javax.jms.ConnectionFactory;
 import javax.jms.QueueConnectionFactory;
 import javax.jms.TopicConnectionFactory;
-import java.util.HashMap;
+
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.axis.components.jms.BeanVendorAdapter;
+import org.apache.axis.transport.jms.JMSURLHelper;
 
 /**
- * An adapter for using ActiveMQ inside <a href="http://ws.apache.org/axis/">Apache Axis</a>
- *
+ * An adapter for using ActiveMQ inside <a
+ * href="http://ws.apache.org/axis/">Apache Axis</a>
+ * 
  * @version $Revision$
  */
 public class ActiveMQVendorAdapter extends BeanVendorAdapter {
 
-    protected final static String QCF_CLASS = ActiveMQConnectionFactory.class.getName();
-    protected final static String TCF_CLASS = QCF_CLASS;
-
-
     /**
      * The URL to connect to the broker
      */
-    public final static String BROKER_URL = "brokerURL";
+    public static final String BROKER_URL = "brokerURL";
 
     /**
      * Specifies the default user name
      */
-    public final static String DEFAULT_USERNAME = "defaultUser";
+    public static final String DEFAULT_USERNAME = "defaultUser";
 
     /**
      * Specifies the default password
      */
-    public final static String DEFAULT_PASSWORD = "defaultPassword";
+    public static final String DEFAULT_PASSWORD = "defaultPassword";
+
+    protected static final String QCF_CLASS = ActiveMQConnectionFactory.class.getName();
+    protected static final String TCF_CLASS = QCF_CLASS;
 
 
-    public QueueConnectionFactory getQueueConnectionFactory(HashMap properties)
-            throws Exception {
-        properties = (HashMap) properties.clone();
+    public QueueConnectionFactory getQueueConnectionFactory(HashMap properties) throws Exception {
+        properties = (HashMap)properties.clone();
         properties.put(CONNECTION_FACTORY_CLASS, QCF_CLASS);
         return super.getQueueConnectionFactory(properties);
     }
 
-    public TopicConnectionFactory getTopicConnectionFactory(HashMap properties)
-            throws Exception {
-        properties = (HashMap) properties.clone();
+    public TopicConnectionFactory getTopicConnectionFactory(HashMap properties) throws Exception {
+        properties = (HashMap)properties.clone();
         properties.put(CONNECTION_FACTORY_CLASS, TCF_CLASS);
         return super.getTopicConnectionFactory(properties);
     }
 
-
     public void addVendorConnectionFactoryProperties(JMSURLHelper jmsUrl, HashMap properties) {
         if (jmsUrl.getPropertyValue(BROKER_URL) != null) {
             properties.put(BROKER_URL, jmsUrl.getPropertyValue(BROKER_URL));
@@ -84,15 +82,14 @@
         String brokerURL = null;
 
         if (connectionFactory instanceof ActiveMQConnectionFactory) {
-            ActiveMQConnectionFactory amqConnectionFactory =
-                    (ActiveMQConnectionFactory) connectionFactory;
+            ActiveMQConnectionFactory amqConnectionFactory = (ActiveMQConnectionFactory)connectionFactory;
 
             // get existing queue connection factory properties
             brokerURL = amqConnectionFactory.getBrokerURL();
         }
 
         // compare broker url
-        String propertyBrokerURL = (String) properties.get(BROKER_URL);
+        String propertyBrokerURL = (String)properties.get(BROKER_URL);
         if (!brokerURL.equals(propertyBrokerURL)) {
             return false;
         }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/BenchmarkSupport.java Sat Aug 11 22:27:21 2007
@@ -16,23 +16,22 @@
  */
 package org.apache.activemq.benchmark;
 
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.util.IdGenerator;
-
 import javax.jms.Connection;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Session;
 
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.util.IdGenerator;
 
 /**
  * Abstract base class for some simple benchmark tools
- *
+ * 
  * @author James Strachan
  * @version $Revision$
  */
@@ -41,15 +40,14 @@
     protected int connectionCount = 1;
     protected int batch = 1000;
     protected Destination destination;
-    private boolean topic = true;
-    private boolean durable = false;
+    protected String[] subjects;
 
+    private boolean topic = true;
+    private boolean durable;
     private ActiveMQConnectionFactory factory;
     private String url;
-    protected String[] subjects;
-    private long time = System.currentTimeMillis();
     private int counter;
-    private List resources = new ArrayList();
+    private List<Object> resources = new ArrayList<Object>();
     private NumberFormat formatter = NumberFormat.getInstance();
     private AtomicInteger connectionCounter = new AtomicInteger(0);
     private IdGenerator idGenerator = new IdGenerator();
@@ -99,7 +97,9 @@
 
     public void setSubject(String subject) {
         connectionCount = 1;
-        subjects = new String[]{subject};
+        subjects = new String[] {
+            subject
+        };
     }
 
     public boolean isDurable() {
@@ -144,16 +144,11 @@
     protected synchronized void count(int count) {
         counter += count;
         /*
-        if (counter > batch) {
-            counter = 0;
-            long current = System.currentTimeMillis();
-            double end = current - time;
-            end /= 1000;
-            time = current;
-
-            System.out.println("Processed " + batch + " messages in " + end + " (secs)");
-        }
-        */
+         * if (counter > batch) { counter = 0; long current =
+         * System.currentTimeMillis(); double end = current - time; end /= 1000;
+         * time = current; System.out.println("Processed " + batch + " messages
+         * in " + end + " (secs)"); }
+         */
     }
 
     protected synchronized int resetCount() {
@@ -162,7 +157,6 @@
         return answer;
     }
 
-
     protected void timerLoop() {
         int times = 0;
         int total = 0;
@@ -172,8 +166,7 @@
         while (true) {
             try {
                 Thread.sleep(1000);
-            }
-            catch (InterruptedException e) {
+            } catch (InterruptedException e) {
                 e.printStackTrace();
             }
             int processed = resetCount();
@@ -186,18 +179,11 @@
                 average = total / times;
             }
 
-            long oldtime = time;
-            time = System.currentTimeMillis();
-
-            double diff = time - oldtime;
-
             System.out.println(getClass().getName() + " Processed: " + processed + " messages this second. Average: " + average);
 
             if ((times % dumpVmStatsFrequency) == 0 && times != 0) {
-                System.out.println("Used memory: " + asMemoryString(runtime.totalMemory() - runtime.freeMemory())
-                        + " Free memory: " + asMemoryString(runtime.freeMemory())
-                        + " Total memory: " + asMemoryString(runtime.totalMemory())
-                        + " Max memory: " + asMemoryString(runtime.maxMemory()));
+                System.out.println("Used memory: " + asMemoryString(runtime.totalMemory() - runtime.freeMemory()) + " Free memory: " + asMemoryString(runtime.freeMemory()) + " Total memory: "
+                                   + asMemoryString(runtime.totalMemory()) + " Max memory: " + asMemoryString(runtime.maxMemory()));
             }
 
         }
@@ -214,8 +200,7 @@
     protected Destination createDestination(Session session, String subject) throws JMSException {
         if (topic) {
             return session.createTopic(subject);
-        }
-        else {
+        } else {
             return session.createQueue(subject);
         }
     }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Consumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Consumer.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Consumer.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Consumer.java Sat Aug 11 22:27:21 2007
@@ -31,6 +31,9 @@
  */
 public class Consumer extends BenchmarkSupport implements MessageListener {
 
+    public Consumer() {
+    }
+
     public static void main(String[] args) {
         Consumer tool = new Consumer();
         if (args.length > 0) {
@@ -51,16 +54,12 @@
 
         try {
             tool.run();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
     }
 
-    public Consumer() {
-    }
-
     public void run() throws JMSException {
         start();
         subscribe();
@@ -81,9 +80,8 @@
 
         MessageConsumer consumer = null;
         if (isDurable() && isTopic()) {
-            consumer = session.createDurableSubscriber((Topic) destination, getClass().getName());
-        }
-        else {
+            consumer = session.createDurableSubscriber((Topic)destination, getClass().getName());
+        } else {
             consumer = session.createConsumer(destination);
         }
         consumer.setMessageListener(this);
@@ -92,17 +90,16 @@
 
     public void onMessage(Message message) {
         try {
-            TextMessage textMessage = (TextMessage) message;
+            TextMessage textMessage = (TextMessage)message;
 
             // lets force the content to be deserialized
-            String text = textMessage.getText();
+            textMessage.getText();
             count(1);
-            
+
             // lets count the messages
 
-            //message.acknowledge();
-        }
-        catch (JMSException e) {
+            // message.acknowledge();
+        } catch (JMSException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/Producer.java Sat Aug 11 22:27:21 2007
@@ -16,16 +16,17 @@
  */
 package org.apache.activemq.benchmark;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
 
 /**
  * @author James Strachan
@@ -37,6 +38,9 @@
     int loopSize = 1000;
     private int messageSize = 1000;
 
+    public Producer() {
+    }
+
     public static void main(String[] args) {
         Producer tool = new Producer();
         if (args.length > 0) {
@@ -59,23 +63,19 @@
         }
         try {
             tool.run();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
     }
 
-    public Producer() {
-    }
-
     public void run() throws Exception {
         start();
         publish();
     }
 
     // Properties
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     public int getMessageSize() {
         return messageSize;
     }
@@ -93,7 +93,7 @@
     }
 
     // Implementation methods
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
 
     protected void publish() throws Exception {
         final String text = getMessage();
@@ -106,8 +106,7 @@
                 public void run() {
                     try {
                         publish(text, subject);
-                    }
-                    catch (JMSException e) {
+                    } catch (JMSException e) {
                         System.out.println("Caught: " + e);
                         e.printStackTrace();
                     }
@@ -135,8 +134,7 @@
         MessageProducer publisher = session.createProducer(destination);
         if (isDurable()) {
             publisher.setDeliveryMode(DeliveryMode.PERSISTENT);
-        }
-        else {
+        } else {
             publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         }
 
@@ -147,8 +145,7 @@
             while (true) {
                 publishLoop(session, publisher, text);
             }
-        }
-        else {
+        } else {
             for (int i = 0; i < loops; i++) {
                 publishLoop(session, publisher, text);
             }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/ProducerConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/ProducerConsumer.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/ProducerConsumer.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/benchmark/ProducerConsumer.java Sat Aug 11 22:27:21 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq.benchmark;
 
-
 /**
  * @author James Strachan
  * @version $Revision$
@@ -24,6 +23,9 @@
 public class ProducerConsumer extends Producer {
 
     private Consumer consumer = new Consumer();
+    
+    public ProducerConsumer() {
+    }
 
     public static void main(String[] args) {
         ProducerConsumer tool = new ProducerConsumer();
@@ -44,14 +46,10 @@
         }
         try {
             tool.run();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
-    }
-
-    public ProducerConsumer() {
     }
 
     public void run() throws Exception {

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/JAXPXPathEvaluator.java Sat Aug 11 22:27:21 2007
@@ -26,34 +26,35 @@
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import org.xml.sax.InputSource;
+
 import org.apache.activemq.command.Message;
 import org.apache.activemq.util.ByteArrayInputStream;
-import org.xml.sax.InputSource;
 
 public class JAXPXPathEvaluator implements XPathExpression.XPathEvaluator {
-    
-    private static final XPathFactory factory = XPathFactory.newInstance();
+
+    private static final XPathFactory FACTORY = XPathFactory.newInstance();
     private javax.xml.xpath.XPathExpression expression;
-    
+
     public JAXPXPathEvaluator(String xpathExpression) {
         try {
-            XPath xpath = factory.newXPath();
-            expression = xpath.compile(xpathExpression);            
+            XPath xpath = FACTORY.newXPath();
+            expression = xpath.compile(xpathExpression);
         } catch (XPathExpressionException e) {
-            throw new RuntimeException("Invalid XPath expression: "+xpathExpression);
+            throw new RuntimeException("Invalid XPath expression: " + xpathExpression);
         }
     }
-    
+
     public boolean evaluate(Message message) throws JMSException {
-        if( message instanceof TextMessage ) {
+        if (message instanceof TextMessage) {
             String text = ((TextMessage)message).getText();
-            return evaluate(text);                
-        } else if ( message instanceof BytesMessage ) {
-            BytesMessage bm = (BytesMessage) message;
-            byte data[] = new byte[(int) bm.getBodyLength()];
+            return evaluate(text);
+        } else if (message instanceof BytesMessage) {
+            BytesMessage bm = (BytesMessage)message;
+            byte data[] = new byte[(int)bm.getBodyLength()];
             bm.readBytes(data);
             return evaluate(data);
-        }            
+        }
         return false;
     }
 

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/XMLBeansXPathEvaluator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/XMLBeansXPathEvaluator.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/XMLBeansXPathEvaluator.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/filter/XMLBeansXPathEvaluator.java Sat Aug 11 22:27:21 2007
@@ -30,32 +30,32 @@
     private final String xpath;
 
     public XMLBeansXPathEvaluator(String xpath) {
-        this.xpath = xpath;        
+        this.xpath = xpath;
     }
-    
+
     public boolean evaluate(Message message) throws JMSException {
-        if( message instanceof TextMessage ) {
+        if (message instanceof TextMessage) {
             String text = ((TextMessage)message).getText();
             try {
                 XmlObject object = XmlObject.Factory.parse(text);
                 XmlObject[] objects = object.selectPath(xpath);
-                return object!=null && objects.length>0;                       
+                return object != null && objects.length > 0;
             } catch (Throwable e) {
                 return false;
             }
-            
-        } else if ( message instanceof BytesMessage ) {
-            BytesMessage bm = (BytesMessage) message;
-            byte data[] = new byte[(int) bm.getBodyLength()];
+
+        } else if (message instanceof BytesMessage) {
+            BytesMessage bm = (BytesMessage)message;
+            byte data[] = new byte[(int)bm.getBodyLength()];
             bm.readBytes(data);
             try {
                 XmlObject object = XmlObject.Factory.parse(new ByteArrayInputStream(data));
                 XmlObject[] objects = object.selectPath(xpath);
-                return object!=null && objects.length>0;                       
+                return object != null && objects.length > 0;
             } catch (Throwable e) {
                 return false;
             }
-        }            
+        }
         return false;
     }
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java Sat Aug 11 22:27:21 2007
@@ -17,12 +17,15 @@
 package org.apache.activemq.tool;
 
 import java.io.IOException;
-import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
@@ -35,49 +38,41 @@
 import javax.jms.Session;
 
 import junit.framework.TestCase;
-
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.command.ActiveMQQueue;
 
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
 /**
  * @version $Revision$
  */
 public class AcidTestTool extends TestCase {
 
-    private Random random = new Random();
-    private byte data[];
-    private int workerCount = 10;
 
     // Worker configuration.
     protected int recordSize = 1024;
     protected int batchSize = 5;
     protected int workerThinkTime = 500;
-    AtomicBoolean ignoreJMSErrors = new AtomicBoolean(false);
-
     protected Destination target;
+
+    private Random random = new Random();
+    private byte data[];
+    private int workerCount = 10;
+    private AtomicBoolean ignoreJMSErrors = new AtomicBoolean(false);
     private ActiveMQConnectionFactory factory;
     private Connection connection;
-    
-    AtomicInteger publishedBatches = new AtomicInteger(0);
-    AtomicInteger consumedBatches = new AtomicInteger(0);
-    
-    List<Throwable> errors = Collections.synchronizedList(new ArrayList<Throwable>());
+    private AtomicInteger publishedBatches = new AtomicInteger(0);
+    private AtomicInteger consumedBatches = new AtomicInteger(0);
+    private List<Throwable> errors = Collections.synchronizedList(new ArrayList<Throwable>());
 
     private interface Worker extends Runnable {
-        public boolean waitForExit(long i) throws InterruptedException;
+        boolean waitForExit(long i) throws InterruptedException;
     }
-    
+
     private final class ProducerWorker implements Worker {
 
-        Session session;
+        private Session session;
         private MessageProducer producer;
         private BytesMessage message;
-        CountDownLatch doneLatch = new CountDownLatch(1);
+        private CountDownLatch doneLatch = new CountDownLatch(1);
 
         ProducerWorker(Session session, String workerId) throws JMSException {
             this.session = session;
@@ -90,36 +85,38 @@
 
         public void run() {
             try {
-                for( int batchId=0; true; batchId++ ) {
-//				    System.out.println("Sending batch: "+workerId+" "+batchId);
-                    for( int msgId=0; msgId < batchSize; msgId++ ) {
-    	                // Sleep some random amount of time less than workerThinkTime
-    	                try {
-    	                    Thread.sleep(random.nextInt(workerThinkTime));
-    	                } catch (InterruptedException e1) {
-    	                    return;
-    	                }			
-    	                
-					    message.setIntProperty("batch-id",batchId);
-					    message.setIntProperty("msg-id",msgId);
-	
-					    
-					    producer.send(message);    		                
-                    } 
+                for (int batchId = 0; true; batchId++) {
+                    // System.out.println("Sending batch: "+workerId+"
+                    // "+batchId);
+                    for (int msgId = 0; msgId < batchSize; msgId++) {
+                        // Sleep some random amount of time less than
+                        // workerThinkTime
+                        try {
+                            Thread.sleep(random.nextInt(workerThinkTime));
+                        } catch (InterruptedException e1) {
+                            return;
+                        }
+
+                        message.setIntProperty("batch-id", batchId);
+                        message.setIntProperty("msg-id", msgId);
+
+                        producer.send(message);
+                    }
                     session.commit();
-                    publishedBatches.incrementAndGet();	                    
-//				    System.out.println("Commited send batch: "+workerId+" "+batchId);
+                    publishedBatches.incrementAndGet();
+                    // System.out.println("Commited send batch: "+workerId+"
+                    // "+batchId);
+                }
+            } catch (JMSException e) {
+                if (!ignoreJMSErrors.get()) {
+                    e.printStackTrace();
+                    errors.add(e);
                 }
-			} catch (JMSException e) {
-			    if( !ignoreJMSErrors.get() ) {
-				    e.printStackTrace();
-				    errors.add(e);
-			    }
-				return;
-			} catch (Throwable e) {
-			    e.printStackTrace();
-			    errors.add(e);
-				return;
+                return;
+            } catch (Throwable e) {
+                e.printStackTrace();
+                errors.add(e);
+                return;
             } finally {
                 System.out.println("Producer exiting.");
                 doneLatch.countDown();
@@ -130,64 +127,67 @@
             return doneLatch.await(i, TimeUnit.MILLISECONDS);
         }
     }
-    
+
     private final class ConsumerWorker implements Worker {
 
-        Session session;
+        private Session session;
         private MessageConsumer consumer;
         private final long timeout;
-        CountDownLatch doneLatch = new CountDownLatch(1);
-        
+        private CountDownLatch doneLatch = new CountDownLatch(1);
+
         ConsumerWorker(Session session, String workerId, long timeout) throws JMSException {
             this.session = session;
             this.timeout = timeout;
-            consumer = session.createConsumer(target,"workerId='"+workerId+"'");
+            consumer = session.createConsumer(target, "workerId='" + workerId + "'");
         }
 
         public void run() {
-            
+
             try {
-                int batchId=0;
-                while( true ) {
-                    for( int msgId=0; msgId < batchSize; msgId++ ) {
-
-                        // Sleep some random amount of time less than workerThinkTime
-    	                try {
-    	                    Thread.sleep(random.nextInt(workerThinkTime));
-    	                } catch (InterruptedException e1) {
-    	                    return;
-    	                }			
-                        
-	                    Message message = consumer.receive(timeout);	                    
-	                    if( msgId > 0 ) {
-	                        assertNotNull(message);	                        
-	                        assertEquals(message.getIntProperty("batch-id"), batchId);
-	                        assertEquals(message.getIntProperty("msg-id"), msgId);
-	                    } else {
-	                        if( message==null ) {
-	                            System.out.println("At end of batch an don't have a next batch to process.  done.");
-		                        return;
-	                        }
-	                        assertEquals(msgId, message.getIntProperty("msg-id") );
-	                        batchId = message.getIntProperty("batch-id");
-//	    				    System.out.println("Receiving batch: "+workerId+" "+batchId);
-	                    }	     
-	                    
-                    } 
+                int batchId = 0;
+                while (true) {
+                    for (int msgId = 0; msgId < batchSize; msgId++) {
+
+                        // Sleep some random amount of time less than
+                        // workerThinkTime
+                        try {
+                            Thread.sleep(random.nextInt(workerThinkTime));
+                        } catch (InterruptedException e1) {
+                            return;
+                        }
+
+                        Message message = consumer.receive(timeout);
+                        if (msgId > 0) {
+                            assertNotNull(message);
+                            assertEquals(message.getIntProperty("batch-id"), batchId);
+                            assertEquals(message.getIntProperty("msg-id"), msgId);
+                        } else {
+                            if (message == null) {
+                                System.out.println("At end of batch an don't have a next batch to process.  done.");
+                                return;
+                            }
+                            assertEquals(msgId, message.getIntProperty("msg-id"));
+                            batchId = message.getIntProperty("batch-id");
+                            // System.out.println("Receiving batch: "+workerId+"
+                            // "+batchId);
+                        }
+
+                    }
                     session.commit();
                     consumedBatches.incrementAndGet();
-//				    System.out.println("Commited receive batch: "+workerId+" "+batchId);
+                    // System.out.println("Commited receive batch: "+workerId+"
+                    // "+batchId);
+                }
+            } catch (JMSException e) {
+                if (!ignoreJMSErrors.get()) {
+                    e.printStackTrace();
+                    errors.add(e);
                 }
-			} catch (JMSException e) {
-			    if( !ignoreJMSErrors.get() ) {
-				    e.printStackTrace();
-				    errors.add(e);
-			    }
-				return;
-			} catch (Throwable e) {
-			    e.printStackTrace();
-			    errors.add(e);
-				return;
+                return;
+            } catch (Throwable e) {
+                e.printStackTrace();
+                errors.add(e);
+                return;
             } finally {
                 System.out.println("Consumer exiting.");
                 doneLatch.countDown();
@@ -198,7 +198,7 @@
             return doneLatch.await(i, TimeUnit.MILLISECONDS);
         }
     }
-    
+
     /**
      * @see junit.framework.TestCase#setUp()
      */
@@ -208,85 +208,89 @@
     }
 
     protected void tearDown() throws Exception {
-        if( connection!=null ) {
-            try { connection.close(); } catch (Throwable ignore) {}
+        if (connection != null) {
+            try {
+                connection.close();
+            } catch (Throwable ignore) {
+            }
             connection = null;
         }
     }
-    
+
     /**
      * @throws InterruptedException
      * @throws JMSException
      * @throws JMSException
-     * 
      */
     private void reconnect() throws InterruptedException, JMSException {
-        if( connection!=null ) {
-            try { connection.close(); } catch (Throwable ignore) {}
+        if (connection != null) {
+            try {
+                connection.close();
+            } catch (Throwable ignore) {
+            }
             connection = null;
         }
-        
-        long reconnectDelay=1000;
-        
-        while( connection == null) {
-            if( reconnectDelay > 1000*10 ) {
-                reconnectDelay = 1000*10;
+
+        long reconnectDelay = 1000;
+
+        while (connection == null) {
+            if (reconnectDelay > 1000 * 10) {
+                reconnectDelay = 1000 * 10;
+            }
+            try {
+                connection = factory.createConnection();
+                connection.start();
+            } catch (JMSException e) {
+                Thread.sleep(reconnectDelay);
+                reconnectDelay *= 2;
             }
-	        try {
-	            connection = factory.createConnection();
-	            connection.start();
-	        } catch (JMSException e) {
-	            Thread.sleep(reconnectDelay);
-	            reconnectDelay*=2;
-	        }
         }
     }
 
     /**
-     * @throws Throwable 
+     * @throws Throwable
      * @throws IOException
-     * 
      */
     public void testAcidTransactions() throws Throwable {
 
-        System.out.println("Client threads write records using: Record Size: " + recordSize + ", Batch Size: "
-                + batchSize + ", Worker Think Time: " + workerThinkTime);
+        System.out.println("Client threads write records using: Record Size: " + recordSize + ", Batch Size: " + batchSize + ", Worker Think Time: " + workerThinkTime);
 
         // Create the record and fill it with some values.
         data = new byte[recordSize];
         for (int i = 0; i < data.length; i++) {
-            data[i] = (byte) i;
+            data[i] = (byte)i;
         }
 
         System.out.println("==============================================");
         System.out.println("===> Start the server now.");
         System.out.println("==============================================");
         reconnect();
-        
+
         System.out.println("Starting " + workerCount + " Workers...");
         ArrayList<Worker> workers = new ArrayList<Worker>();
-        for( int i=0; i< workerCount; i++ ){        
-            String workerId = "worker-"+i;
-            
-            Worker w = new ConsumerWorker(connection.createSession(true,Session.SESSION_TRANSACTED), workerId, 1000*5);
+        for (int i = 0; i < workerCount; i++) {
+            String workerId = "worker-" + i;
+
+            Worker w = new ConsumerWorker(connection.createSession(true, Session.SESSION_TRANSACTED), workerId, 1000 * 5);
             workers.add(w);
-            new Thread(w,"Consumer:"+workerId).start();
+            new Thread(w, "Consumer:" + workerId).start();
 
-            w = new ProducerWorker(connection.createSession(true,Session.SESSION_TRANSACTED), workerId);
+            w = new ProducerWorker(connection.createSession(true, Session.SESSION_TRANSACTED), workerId);
             workers.add(w);
-            new Thread(w,"Producer:"+workerId).start();
-        }        
+            new Thread(w, "Producer:" + workerId).start();
+        }
 
-        System.out.println("Waiting for "+(workerCount*10)+" batches to be delivered.");
+        System.out.println("Waiting for " + (workerCount * 10) + " batches to be delivered.");
 
         //
-        // Wait for about 5 batches of messages per worker to be consumed before restart. 
+        // Wait for about 5 batches of messages per worker to be consumed before
+        // restart.
         // 
-        while( publishedBatches.get() <  workerCount*5) {
-            System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());
+        while (publishedBatches.get() < workerCount * 5) {
+            System.out.println("Stats: Produced Batches: " + this.publishedBatches.get() + ", Consumed Batches: " + this.consumedBatches.get());
             Thread.sleep(1000);
         }
-        
+
         System.out.println("==============================================");
         System.out.println("===> Server is under load now.  Kill it!");
         System.out.println("==============================================");
@@ -296,52 +300,55 @@
         System.out.println("Waiting for all workers to exit due to server shutdown.");
         for (Iterator<Worker> iter = workers.iterator(); iter.hasNext();) {
             Worker worker = iter.next();
-            while( !worker.waitForExit(1000) ) {
+            while (!worker.waitForExit(1000)) {
                 System.out.println("==============================================");
                 System.out.println("===> Server is under load now.  Kill it!");
-                System.out.println("==============================================");                
-                System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());            
+                System.out.println("==============================================");
+                System.out.println("Stats: Produced Batches: " + this.publishedBatches.get() + ", Consumed Batches: " + this.consumedBatches.get());
             }
         }
         workers.clear();
-        
-        // No errors should have occured so far.
-        if( errors.size()>0 )
+
+        // No errors should have occurred so far.
+        if (errors.size() > 0) {
             throw errors.get(0);
-        
+        }
+
         System.out.println("==============================================");
         System.out.println("===> Start the server now.");
         System.out.println("==============================================");
         reconnect();
 
         System.out.println("Restarted.");
-        
-        // Validate the all transactions were commited as a uow.  Looking for partial commits.
-        for( int i=0; i< workerCount; i++ ){
-            String workerId = "worker-"+i;
-            Worker w = new ConsumerWorker(connection.createSession(true,Session.SESSION_TRANSACTED), workerId, 5*1000);
+
+        // Validate the all transactions were commited as a uow. Looking for
+        // partial commits.
+        for (int i = 0; i < workerCount; i++) {
+            String workerId = "worker-" + i;
+            Worker w = new ConsumerWorker(connection.createSession(true, Session.SESSION_TRANSACTED), workerId, 5 * 1000);
             workers.add(w);
-            new Thread(w, "Consumer:"+workerId).start();
+            new Thread(w, "Consumer:" + workerId).start();
         }
 
         System.out.println("Waiting for restarted consumers to finish consuming all messages..");
         for (Iterator<Worker> iter = workers.iterator(); iter.hasNext();) {
             Worker worker = iter.next();
-            while( !worker.waitForExit(1000*5) ) {
+            while (!worker.waitForExit(1000 * 5)) {
                 System.out.println("Waiting for restarted consumers to finish consuming all messages..");
-                System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());            
+                System.out.println("Stats: Produced Batches: " + this.publishedBatches.get() + ", Consumed Batches: " + this.consumedBatches.get());
             }
         }
         workers.clear();
 
         System.out.println("Workers finished..");
-        System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());                    
-        
-        if( errors.size()>0 )
+        System.out.println("Stats: Produced Batches: " + this.publishedBatches.get() + ", Consumed Batches: " + this.consumedBatches.get());
+
+        if (errors.size() > 0) {
             throw errors.get(0);
-        
+        }
+
     }
-    
+
     public static void main(String[] args) {
         try {
             AcidTestTool tool = new AcidTestTool();
@@ -349,7 +356,7 @@
             tool.testAcidTransactions();
             tool.tearDown();
         } catch (Throwable e) {
-            System.out.println("Test Failed: "+e.getMessage());
+            System.out.println("Test Failed: " + e.getMessage());
             e.printStackTrace();
         }
     }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ConsumerTool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ConsumerTool.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ConsumerTool.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ConsumerTool.java Sat Aug 11 22:27:21 2007
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.tool;
 
+import java.io.IOException;
+
 import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -24,22 +26,20 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
-import java.io.IOException;
 
 /**
  * A simple tool for consuming messages
- *
+ * 
  * @version $Revision$
  */
 public class ConsumerTool extends ToolSupport implements MessageListener {
 
-    protected int count = 0;
+    protected int count;
     protected int dumpCount = 10;
     protected boolean verbose = true;
-    protected int maxiumMessages = 0;
+    protected int maxiumMessages;
     private boolean pauseBeforeShutdown;
 
-
     public static void main(String[] args) {
         ConsumerTool tool = new ConsumerTool();
         if (args.length > 0) {
@@ -70,9 +70,8 @@
             Session session = createSession(connection);
             MessageConsumer consumer = null;
             if (durable && topic) {
-                consumer = session.createDurableSubscriber((Topic) destination, consumerName);
-            }
-            else {
+                consumer = session.createDurableSubscriber((Topic)destination, consumerName);
+            } else {
                 consumer = session.createConsumer(destination);
             }
             if (maxiumMessages <= 0) {
@@ -83,8 +82,7 @@
             if (maxiumMessages > 0) {
                 consumeMessagesAndClose(connection, session, consumer);
             }
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
@@ -93,33 +91,29 @@
     public void onMessage(Message message) {
         try {
             if (message instanceof TextMessage) {
-                TextMessage txtMsg = (TextMessage) message;
+                TextMessage txtMsg = (TextMessage)message;
                 if (verbose) {
-                	
-                	String msg = txtMsg.getText();
-                	if( msg.length() > 50 )
-                		msg = msg.substring(0, 50)+"...";
-                	
+
+                    String msg = txtMsg.getText();
+                    if (msg.length() > 50) {
+                        msg = msg.substring(0, 50) + "...";
+                    }
+
                     System.out.println("Received: " + msg);
                 }
-            }
-            else {
+            } else {
                 if (verbose) {
                     System.out.println("Received: " + message);
                 }
             }
             /*
-            if (++count % dumpCount == 0) {
-                dumpStats(connection);
-            }
-            */
-        }
-        catch (JMSException e) {
+             * if (++count % dumpCount == 0) { dumpStats(connection); }
+             */
+        } catch (JMSException e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
     }
-
 
     protected void consumeMessagesAndClose(Connection connection, Session session, MessageConsumer consumer) throws JMSException, IOException {
         System.out.println("We are about to wait until we consume: " + maxiumMessages + " message(s) then we will shutdown");

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ProducerTool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ProducerTool.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ProducerTool.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ProducerTool.java Sat Aug 11 22:27:21 2007
@@ -27,13 +27,13 @@
 
 /**
  * A simple tool for publishing messages
- *
+ * 
  * @version $Revision$
  */
 public class ProducerTool extends ToolSupport {
 
     protected int messageCount = 10;
-    protected long sleepTime = 0L;
+    protected long sleepTime;
     protected boolean verbose = true;
     protected int messageSize = 255;
 
@@ -66,20 +66,19 @@
     public void run() {
         try {
             System.out.println("Connecting to URL: " + url);
-            System.out.println("Publishing a Message with size "+messageSize+" to " + (topic ? "topic" : "queue") + ": " + subject);
+            System.out.println("Publishing a Message with size " + messageSize + " to " + (topic ? "topic" : "queue") + ": " + subject);
             System.out.println("Using " + (durable ? "durable" : "non-durable") + " publishing");
 
             Connection connection = createConnection();
             Session session = createSession(connection);
             MessageProducer producer = createProducer(session);
-            //connection.start();
+            // connection.start();
 
             sendLoop(session, producer);
 
             System.out.println("Done.");
             close(connection, session);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             System.out.println("Caught: " + e);
             e.printStackTrace();
         }
@@ -89,24 +88,23 @@
         MessageProducer producer = session.createProducer(destination);
         if (durable) {
             producer.setDeliveryMode(DeliveryMode.PERSISTENT);
-        }
-        else {
+        } else {
             producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         }
         return producer;
     }
 
     protected void sendLoop(Session session, MessageProducer producer) throws Exception {
-    	
+
         for (int i = 0; i < messageCount; i++) {
-        
-        	
-        	TextMessage message = session.createTextMessage(createMessageText(i));
+
+            TextMessage message = session.createTextMessage(createMessageText(i));
 
             if (verbose) {
-            	String msg = message.getText();
-            	if( msg.length() > 50 )
-            		msg = msg.substring(0, 50)+"...";
+                String msg = message.getText();
+                if (msg.length() > 50) {
+                    msg = msg.substring(0, 50) + "...";
+                }
                 System.out.println("Sending message: " + msg);
             }
 
@@ -116,18 +114,19 @@
         producer.send(session.createMessage());
     }
 
-	/**
-	 * @param i
-	 * @return
-	 */
-	private String createMessageText(int index) {
-		StringBuffer buffer = new StringBuffer(messageSize);
-		buffer.append("Message: " + index + " sent at: " + new Date());
-		if( buffer.length() > messageSize ) {
-			return buffer.substring(0, messageSize);
-		}
-    	for( int i=buffer.length(); i < messageSize; i++)
-    		buffer.append(' ');
-    	return buffer.toString();
-	}
+    /**
+     * @param i
+     * @return
+     */
+    private String createMessageText(int index) {
+        StringBuffer buffer = new StringBuffer(messageSize);
+        buffer.append("Message: " + index + " sent at: " + new Date());
+        if (buffer.length() > messageSize) {
+            return buffer.substring(0, messageSize);
+        }
+        for (int i = buffer.length(); i < messageSize; i++) {
+            buffer.append(' ');
+        }
+        return buffer.toString();
+    }
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ToolSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ToolSupport.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ToolSupport.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/ToolSupport.java Sat Aug 11 22:27:21 2007
@@ -16,36 +16,34 @@
  */
 package org.apache.activemq.tool;
 
-import org.apache.activemq.ActiveMQConnection;
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.util.IndentPrinter;
-
 import javax.jms.Connection;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Session;
 
+import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.util.IndentPrinter;
+
 /**
  * Abstract base class useful for implementation inheritence
- *
+ * 
  * @version $Revision$
  */
 public class ToolSupport {
 
-
     protected Destination destination;
     protected String subject = "TOOL.DEFAULT";
     protected boolean topic = true;
     protected String user = ActiveMQConnection.DEFAULT_USER;
     protected String pwd = ActiveMQConnection.DEFAULT_PASSWORD;
     protected String url = ActiveMQConnection.DEFAULT_BROKER_URL;
-    protected boolean transacted = false;
-    protected boolean durable = false;
+    protected boolean transacted;
+    protected boolean durable;
     protected String clientID = getClass().getName();
     protected int ackMode = Session.AUTO_ACKNOWLEDGE;
     protected String consumerName = "James";
 
-
     protected Session createSession(Connection connection) throws Exception {
         if (durable) {
             connection.setClientID(clientID);
@@ -53,8 +51,7 @@
         Session session = connection.createSession(transacted, ackMode);
         if (topic) {
             destination = session.createTopic(subject);
-        }
-        else {
+        } else {
             destination = session.createQueue(subject);
         }
         return session;
@@ -78,7 +75,7 @@
     }
 
     protected void dumpStats(Connection connection) {
-        ActiveMQConnection c = (ActiveMQConnection) connection;
+        ActiveMQConnection c = (ActiveMQConnection)connection;
         c.getConnectionStats().dump(new IndentPrinter());
     }
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/WebServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/WebServer.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/WebServer.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/WebServer.java Sat Aug 11 22:27:21 2007
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 package org.apache.activemq.tool;
+
 import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.bio.SocketConnector;
@@ -23,31 +24,37 @@
 /**
  * @version $Revision$
  */
-public class WebServer {
+public final class WebServer {
+
     public static final int PORT = 8080;
-    //public static final String WEBAPP_DIR = "target/activemq";
+    // public static final String WEBAPP_DIR = "target/activemq";
     public static final String WEBAPP_DIR = "src/webapp";
     public static final String WEBAPP_CTX = "/";
 
+    private WebServer() {
+    }
+
     public static void main(String[] args) throws Exception {
         Server server = new Server();
         Connector context = new SocketConnector();
         context.setServer(server);
         context.setPort(PORT);
-        
+
         String webappDir = WEBAPP_DIR;
-        if( args.length > 0 ) {
-        	webappDir = args[0];
+        if (args.length > 0) {
+            webappDir = args[0];
         }
-        
+
         WebAppContext webapp = new WebAppContext();
         webapp.setServer(server);
         webapp.setContextPath(WEBAPP_CTX);
         webapp.setResourceBase(webappDir);
-       
+
         server.setHandler(webapp);
-        
-        server.setConnectors(new Connector[]{context});
+
+        server.setConnectors(new Connector[] {
+            context
+        });
         server.start();
 
     }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/BlockingQueueTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/BlockingQueueTransport.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/BlockingQueueTransport.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/BlockingQueueTransport.java Sat Aug 11 22:27:21 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.transport.http;
 
+import java.io.IOException;
 import java.util.Queue;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.TimeUnit;
@@ -23,8 +24,6 @@
 import org.apache.activemq.transport.TransportSupport;
 import org.apache.activemq.util.ServiceStopper;
 
-import java.io.IOException;
-
 /**
  * A server side HTTP based TransportChannel which processes incoming packets
  * and adds outgoing packets onto a {@link Queue} so that they can be dispatched
@@ -35,21 +34,22 @@
 public class BlockingQueueTransport extends TransportSupport {
     public static final long MAX_TIMEOUT = 30000L;
 
-    private BlockingQueue queue;
+    private BlockingQueue<Object> queue;
 
-    public BlockingQueueTransport(BlockingQueue channel) {
+    public BlockingQueueTransport(BlockingQueue<Object> channel) {
         this.queue = channel;
     }
 
-    public BlockingQueue getQueue() {
+    public BlockingQueue<Object> getQueue() {
         return queue;
     }
 
     public void oneway(Object command) throws IOException {
         try {
             boolean success = queue.offer(command, MAX_TIMEOUT, TimeUnit.MILLISECONDS);
-            if (!success)
+            if (!success) {
                 throw new IOException("Fail to add to BlockingQueue. Add timed out after " + MAX_TIMEOUT + "ms: size=" + queue.size());
+            }
         } catch (InterruptedException e) {
             throw new IOException("Fail to add to BlockingQueue. Interrupted while waiting for space: size=" + queue.size());
         }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpClientTransport.java Sat Aug 11 22:27:21 2007
@@ -37,24 +37,24 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * A HTTP {@link org.apache.activemq.transport.TransportChannel} which uses the <a
- * href="http://jakarta.apache.org/commons/httpclient/">commons-httpclient</a>
+ * A HTTP {@link org.apache.activemq.transport.TransportChannel} which uses the
+ * <a href="http://jakarta.apache.org/commons/httpclient/">commons-httpclient</a>
  * library
  * 
  * @version $Revision$
  */
 public class HttpClientTransport extends HttpTransportSupport {
-    private static final Log log = LogFactory.getLog(HttpClientTransport.class);
-    public static final int MAX_CLIENT_TIMEOUT = 30000;
 
-    private static final IdGenerator clientIdGenerator = new IdGenerator();
+    public static final int MAX_CLIENT_TIMEOUT = 30000;
+    private static final Log LOG = LogFactory.getLog(HttpClientTransport.class);
+    private static final IdGenerator CLIENT_ID_GENERATOR = new IdGenerator();
 
     private HttpClient sendHttpClient;
     private HttpClient receiveHttpClient;
-    
-    private final String clientID = clientIdGenerator.generateId();
+
+    private final String clientID = CLIENT_ID_GENERATOR.generateId();
     private boolean trace;
-    
+
     public HttpClientTransport(TextWireFormat wireFormat, URI remoteUrl) {
         super(wireFormat, remoteUrl);
     }
@@ -64,27 +64,27 @@
     }
 
     public void oneway(Object command) throws IOException {
-    	
-    	if( isStopped() ) {
-    		throw new IOException("stopped.");
-    	}
-    	
+
+        if (isStopped()) {
+            throw new IOException("stopped.");
+        }
+
         PostMethod httpMethod = new PostMethod(getRemoteUrl().toString());
         configureMethod(httpMethod);
         String data = getTextWireFormat().marshalText(command);
         byte[] bytes = data.getBytes("UTF-8");
         httpMethod.setRequestBody(new ByteArrayInputStream(bytes));
-        
+
         try {
-        	
+
             HttpClient client = getSendHttpClient();
             client.setTimeout(MAX_CLIENT_TIMEOUT);
             int answer = client.executeMethod(httpMethod);
             if (answer != HttpStatus.SC_OK) {
                 throw new IOException("Failed to post command: " + command + " as response was: " + answer);
             }
-                        
-//            checkSession(httpMethod);
+
+            // checkSession(httpMethod);
         } catch (IOException e) {
             throw IOExceptionSupport.create("Could not post command: " + command + " due to: " + e, e);
         } finally {
@@ -98,12 +98,12 @@
     }
 
     public void run() {
-    	
-        log.trace("HTTP GET consumer thread starting: " + this);
+
+        LOG.trace("HTTP GET consumer thread starting: " + this);
         HttpClient httpClient = getReceiveHttpClient();
         URI remoteUrl = getRemoteUrl();
-                
-        while ( !isStopped() && !isStopping() ) {
+
+        while (!isStopped() && !isStopping()) {
 
             GetMethod httpMethod = new GetMethod(remoteUrl.toString());
             configureMethod(httpMethod);
@@ -112,33 +112,30 @@
                 int answer = httpClient.executeMethod(httpMethod);
                 if (answer != HttpStatus.SC_OK) {
                     if (answer == HttpStatus.SC_REQUEST_TIMEOUT) {
-                        log.debug("GET timed out");
+                        LOG.debug("GET timed out");
                         try {
-							Thread.sleep(1000);
-						} catch (InterruptedException e) {
-							onException(new InterruptedIOException());
-							break;
-						}
-                    }
-                    else {
-						onException(new IOException("Failed to perform GET on: " + remoteUrl + " as response was: " + answer));
-						break;
+                            Thread.sleep(1000);
+                        } catch (InterruptedException e) {
+                            onException(new InterruptedIOException());
+                            break;
+                        }
+                    } else {
+                        onException(new IOException("Failed to perform GET on: " + remoteUrl + " as response was: " + answer));
+                        break;
                     }
-                }
-                else {
-//                    checkSession(httpMethod);
-                	DataInputStream stream = new DataInputStream(httpMethod.getResponseBodyAsStream());                    
-                	Object command = (Object) getTextWireFormat().unmarshal(stream);                    
+                } else {
+                    // checkSession(httpMethod);
+                    DataInputStream stream = new DataInputStream(httpMethod.getResponseBodyAsStream());
+                    Object command = (Object)getTextWireFormat().unmarshal(stream);
                     if (command == null) {
-                        log.warn("Received null command from url: " + remoteUrl);
+                        LOG.warn("Received null command from url: " + remoteUrl);
                     } else {
                         doConsume(command);
                     }
                 }
-            }
-            catch (IOException e) {
-				onException(IOExceptionSupport.create("Failed to perform GET on: " + remoteUrl+" Reason: "+e.getMessage(),e));
-				break;
+            } catch (IOException e) {
+                onException(IOExceptionSupport.create("Failed to perform GET on: " + remoteUrl + " Reason: " + e.getMessage(), e));
+                break;
             } finally {
                 httpMethod.getResponseBody();
                 httpMethod.releaseConnection();
@@ -173,22 +170,22 @@
     // Implementation methods
     // -------------------------------------------------------------------------
     protected void doStart() throws Exception {
-    	
-        log.trace("HTTP GET consumer thread starting: " + this);
+
+        LOG.trace("HTTP GET consumer thread starting: " + this);
         HttpClient httpClient = getReceiveHttpClient();
         URI remoteUrl = getRemoteUrl();
-                
+
         HeadMethod httpMethod = new HeadMethod(remoteUrl.toString());
         configureMethod(httpMethod);
 
         int answer = httpClient.executeMethod(httpMethod);
         if (answer != HttpStatus.SC_OK) {
-			throw new IOException("Failed to perform GET on: " + remoteUrl + " as response was: " + answer);
+            throw new IOException("Failed to perform GET on: " + remoteUrl + " as response was: " + answer);
         }
-    	
-    	super.doStart();
+
+        super.doStart();
     }
-    
+
     protected void doStop(ServiceStopper stopper) throws Exception {
     }
 
@@ -204,24 +201,24 @@
         method.setRequestHeader("clientID", clientID);
     }
 
-	public boolean isTrace() {
-		return trace;
-	}
-
-	public void setTrace(boolean trace) {
-		this.trace = trace;
-	}
-
-//    protected void checkSession(HttpMethod client) {
-//        Header header = client.getRequestHeader("Set-Cookie");
-//        if (header != null) {
-//            String set_cookie = header.getValue();
-//
-//            if (set_cookie != null && set_cookie.startsWith("JSESSIONID=")) {
-//                String[] bits = set_cookie.split("[=;]");
-//                sessionID = bits[1];
-//            }
-//        }
-//    }
+    public boolean isTrace() {
+        return trace;
+    }
+
+    public void setTrace(boolean trace) {
+        this.trace = trace;
+    }
+
+    // protected void checkSession(HttpMethod client) {
+    // Header header = client.getRequestHeader("Set-Cookie");
+    // if (header != null) {
+    // String set_cookie = header.getValue();
+    //
+    // if (set_cookie != null && set_cookie.startsWith("JSESSIONID=")) {
+    // String[] bits = set_cookie.split("[=;]");
+    // sessionID = bits[1];
+    // }
+    // }
+    // }
 
 }

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpEmbeddedTunnelServlet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpEmbeddedTunnelServlet.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpEmbeddedTunnelServlet.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpEmbeddedTunnelServlet.java Sat Aug 11 22:27:21 2007
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq.transport.http;
 
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.transport.TransportAcceptListener;
+import java.net.URI;
 
 import javax.servlet.ServletException;
 
-import java.net.URI;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.transport.TransportAcceptListener;
 
 /**
  * This servlet embeds an ActiveMQ broker inside a servlet engine which is ideal
@@ -31,7 +31,7 @@
  */
 public class HttpEmbeddedTunnelServlet extends HttpTunnelServlet {
     private static final long serialVersionUID = -3705734740251302361L;
-    
+
     protected BrokerService broker;
     protected HttpTransportServer transportConnector;
 
@@ -52,8 +52,7 @@
                 }
             }
             broker.start();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new ServletException("Failed to start embedded broker: " + e, e);
         }
         // now lets register the listener

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpSpringEmbeddedTunnelServlet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpSpringEmbeddedTunnelServlet.java?view=diff&rev=565003&r1=565002&r2=565003
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpSpringEmbeddedTunnelServlet.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpSpringEmbeddedTunnelServlet.java Sat Aug 11 22:27:21 2007
@@ -20,25 +20,24 @@
 import org.apache.activemq.xbean.BrokerFactoryBean;
 import org.springframework.core.io.ClassPathResource;
 
-
 /**
- * This servlet embeds an ActiveMQ broker inside a servlet engine which is
- * ideal for deploying ActiveMQ inside a WAR and using this servlet as a HTTP tunnel.
- *
+ * This servlet embeds an ActiveMQ broker inside a servlet engine which is ideal
+ * for deploying ActiveMQ inside a WAR and using this servlet as a HTTP tunnel.
+ * 
  * @version $Revision$
  */
 public class HttpSpringEmbeddedTunnelServlet extends HttpEmbeddedTunnelServlet {
 
-	private static final long serialVersionUID = -6568661997192814908L;
+    private static final long serialVersionUID = -6568661997192814908L;
 
-	/**
+    /**
      * Factory method to create a new broker
      */
     protected BrokerService createBroker() throws Exception {
-    	
+
         String configFile = getServletContext().getInitParameter("org.activemq.config.file");
         if (configFile == null) {
-        	configFile="activemq.xml";
+            configFile = "activemq.xml";
         }
 
         BrokerFactoryBean factory = new BrokerFactoryBean(new ClassPathResource(configFile));



Mime
View raw message