activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [06/14] Use autocrlf consistently for line endings
Date Tue, 29 Apr 2014 18:34:18 GMT
http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/ActiveMQExamples.sln
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/ActiveMQExamples.sln b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/ActiveMQExamples.sln
index ade0d24..f9a94a4 100644
--- a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/ActiveMQExamples.sln
+++ b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/ActiveMQExamples.sln
@@ -1,26 +1,26 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Publisher", "Publisher\Publisher.csproj", "{0FEEC122-F3FD-4148-A461-0A724AE0C691}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Listener", "Listener\Listener.csproj", "{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|x86 = Debug|x86
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Debug|x86.ActiveCfg = Debug|x86
-		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Debug|x86.Build.0 = Debug|x86
-		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Release|x86.ActiveCfg = Release|x86
-		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Release|x86.Build.0 = Release|x86
-		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Debug|x86.ActiveCfg = Debug|x86
-		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Debug|x86.Build.0 = Debug|x86
-		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Release|x86.ActiveCfg = Release|x86
-		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Release|x86.Build.0 = Release|x86
-	EndGlobalSection
-	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = Listener\Listener.csproj
-	EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Publisher", "Publisher\Publisher.csproj", "{0FEEC122-F3FD-4148-A461-0A724AE0C691}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Listener", "Listener\Listener.csproj", "{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Debug|x86.ActiveCfg = Debug|x86
+		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Debug|x86.Build.0 = Debug|x86
+		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Release|x86.ActiveCfg = Release|x86
+		{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}.Release|x86.Build.0 = Release|x86
+		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Debug|x86.ActiveCfg = Debug|x86
+		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Debug|x86.Build.0 = Debug|x86
+		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Release|x86.ActiveCfg = Release|x86
+		{0FEEC122-F3FD-4148-A461-0A724AE0C691}.Release|x86.Build.0 = Release|x86
+	EndGlobalSection
+	GlobalSection(MonoDevelopProperties) = preSolution
+		StartupItem = Listener\Listener.csproj
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Listener/Listener.csproj
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Listener/Listener.csproj b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Listener/Listener.csproj
index 2fe971c..3024599 100644
--- a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Listener/Listener.csproj
+++ b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Listener/Listener.csproj
@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>Listener</RootNamespace>
-    <AssemblyName>Listener</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="Apache.NMS">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\Apache.NMS\mono-2.0\Apache.NMS.dll</HintPath>
-    </Reference>
-    <Reference Include="Ionic.Zlib">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\DotNetZip\mono-2.0\Ionic.Zlib.dll</HintPath>
-    </Reference>
-    <Reference Include="Apache.NMS.ActiveMQ">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\build\mono-2.0\debug\Apache.NMS.ActiveMQ.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Listener.cs" />
-    <Compile Include="AssemblyInfo.cs" />
-    <Compile Include="NMSTracer.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>9.0.21022</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{08413D64-4C72-4F92-9B4A-9BAECCDB6DC3}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>Listener</RootNamespace>
+    <AssemblyName>Listener</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="Apache.NMS">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\Apache.NMS\mono-2.0\Apache.NMS.dll</HintPath>
+    </Reference>
+    <Reference Include="Ionic.Zlib">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\DotNetZip\mono-2.0\Ionic.Zlib.dll</HintPath>
+    </Reference>
+    <Reference Include="Apache.NMS.ActiveMQ">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\build\mono-2.0\debug\Apache.NMS.ActiveMQ.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Listener.cs" />
+    <Compile Include="AssemblyInfo.cs" />
+    <Compile Include="NMSTracer.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Publisher/Publisher.csproj
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Publisher/Publisher.csproj b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Publisher/Publisher.csproj
index 1d4dfd7..c23ceca 100644
--- a/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Publisher/Publisher.csproj
+++ b/assembly/src/release/examples/openwire/csharp/ActiveMQExamples/Publisher/Publisher.csproj
@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{0FEEC122-F3FD-4148-A461-0A724AE0C691}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>Publisher</RootNamespace>
-    <AssemblyName>Publisher</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="Apache.NMS.ActiveMQ">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\build\mono-2.0\debug\Apache.NMS.ActiveMQ.dll</HintPath>
-    </Reference>
-    <Reference Include="Apache.NMS">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\Apache.NMS\mono-2.0\Apache.NMS.dll</HintPath>
-    </Reference>
-    <Reference Include="Ionic.Zlib">
-      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\DotNetZip\mono-2.0\Ionic.Zlib.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Publisher.cs" />
-    <Compile Include="AssemblyInfo.cs" />
-    <Compile Include="NMSTracer.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>9.0.21022</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{0FEEC122-F3FD-4148-A461-0A724AE0C691}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>Publisher</RootNamespace>
+    <AssemblyName>Publisher</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>none</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="Apache.NMS.ActiveMQ">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\build\mono-2.0\debug\Apache.NMS.ActiveMQ.dll</HintPath>
+    </Reference>
+    <Reference Include="Apache.NMS">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\Apache.NMS\mono-2.0\Apache.NMS.dll</HintPath>
+    </Reference>
+    <Reference Include="Ionic.Zlib">
+      <HintPath>..\..\..\..\..\..\..\..\..\..\activemq\NMS.ActiveMQ\lib\DotNetZip\mono-2.0\Ionic.Zlib.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Publisher.cs" />
+    <Compile Include="AssemblyInfo.cs" />
+    <Compile Include="NMSTracer.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 </Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
index b780771..19a81b1 100644
--- a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
+++ b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.java
@@ -1,352 +1,352 @@
-/*
- * � 2001-2009, Progress Software Corporation and/or its subsidiaries or affiliates.  All rights reserved.
- *
- * Licensed 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.
- 
-Sample Application
-
-Writing a Basic JMS Application using:
-    - QueueBrowser
-    - JMS with a Graphical Interface
-    - behavior based on message type
-
-When you run this program, it will read all the parameters out
-of the QueueMonitor.properties file. In this file you can specify
-which queues you want to monitor. Then a Java window will open and
-every time you click the Browse button, The current contents of the queues
-will be displayed in the text window.
-
-Usage:
-  java QueueMonitor
-
-Suggested demonstration:
-  - Start one instance of this application:
-        java QueueMonitor
-  - Run on or more Talk applications (without the receiving queue).
-  - Enter messages on various Talk windows.
-  - Watch the QueueMonitor display the messages.
-
-*/
-import org.apache.activemq.*;
-
-import javax.swing.JTextArea;
-import javax.swing.JFrame;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-
-import javax.swing.text.Highlighter;
-import javax.swing.text.DefaultHighlighter;
-import javax.swing.text.BadLocationException;
-
-import javax.swing.border.CompoundBorder;
-import javax.swing.border.EmptyBorder;
-import javax.swing.border.BevelBorder;
-import javax.swing.border.SoftBevelBorder;
-
-import java.awt.Toolkit;
-import java.awt.Dimension;
-import java.awt.BorderLayout;
-import java.awt.Rectangle;
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-
-import java.io.FileInputStream;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-public class QueueMonitor
-extends JFrame
-{
-    private static final String DEFAULT_PROPERTIES_FILE = "QueueMonitor.properties";
-
-    String propertiesFile = DEFAULT_PROPERTIES_FILE;
-    String broker = "tcp://localhost:61616";
-    String connectID = "QueueMonitor";
-    String username = "QueueMonitor";
-    String password = "QueueMonitor";
-    String browseQueues  = "Q1,Q2,Q3";
-    String textFontName = "Dialog";
-    String textFontStyle = "PLAIN";
-    String textFontSize = "12";
-    String title = "QueueMonitor";
-
-    JTextArea textArea = new JTextArea();
-    JScrollPane scrollPane = new JScrollPane(textArea);
-    JButton browseButton = new JButton("Browse Queues");
-
-    Vector theQueues = new Vector();
-
-    private javax.jms.Connection connect = null;
-    private javax.jms.Session session = null;
-
-/** Constructor for MessageMonitor window. */
-    public QueueMonitor()
-    {
-        loadProperties();
-
-        setTitle(title);
-
-        // Connect to Message Broker
-        try
-        {
-            javax.jms.ConnectionFactory factory;
-            factory = new ActiveMQConnectionFactory(username, password, broker);
-
-            connect = factory.createConnection (username, password);
-            session = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);
-        }
-        catch (javax.jms.JMSException jmse)
-        {
-            System.err.println("Cannot connect to Broker");
-            jmse.printStackTrace();
-            System.exit(1);
-        }
-
-        // Set up Queues:
-        StringTokenizer queues = new StringTokenizer(browseQueues, ",");
-        while (queues.hasMoreTokens())
-        {
-            try{
-                String queueName = queues.nextToken();
-                System.out.println ("Monitoring  " + queueName);
-                theQueues.addElement(session.createQueue(queueName));
-            }
-            catch (javax.jms.JMSException jmse)
-            {
-                jmse.printStackTrace();
-            }
-        }
-
-
-        // After init it is time to start the connection
-        try
-        {
-            connect.start();
-        }
-        catch (javax.jms.JMSException jmse)
-        {
-            System.err.println("Cannot start connection");
-            jmse.printStackTrace();
-            System.exit(1);
-        }
-
-        //Elements visible on the screen
-        textArea.setEditable(false);
-        scrollPane.setBorder(new CompoundBorder(new EmptyBorder(6,6,6,6),
-                                                new SoftBevelBorder(BevelBorder.LOWERED)));
-        getContentPane().add(scrollPane,BorderLayout.CENTER);
-        getContentPane().add(browseButton,BorderLayout.SOUTH);
-
-        browseButton.addActionListener(new OnBrowse());
-
-    }
-
-
-
-    /** Main program entry point. */
-    public static void main(String[] args)
-    {
-        // There should be no arguments to this program.
-        if (args.length > 0) {
-            printUsage();
-            System.exit(1);
-        }
-
-        QueueMonitor queueMonitor = new QueueMonitor();
-
-        queueMonitor.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e)
-            {
-                System.exit(0);
-            }
-        });
-
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        screenSize.height = screenSize.height / 2 ;
-        screenSize.width = screenSize.width / 2 ;
-        queueMonitor.setSize(screenSize);
-        queueMonitor.setVisible(true);
-
-    }
-
-    /** Prints the usage. */
-    private static void printUsage()
-    {
-        StringBuffer use = new StringBuffer();
-        use.append("\nusage: QueueMonitor\n\n");
-        use.append("Properties for this sample can be set in a properties file.\n");
-        String dfltFile = System.getProperty("propertiesFile", DEFAULT_PROPERTIES_FILE);
-        use.append("[Default file: " + dfltFile +"]\n\n");
-        System.out.print(use);
-    }
-
-    /** Load the window and JMS properties from a file. */
-    private void loadProperties()
-    {
-        try
-        {
-            Properties properties = new Properties();
-
-            propertiesFile = System.getProperty("propertiesFile", propertiesFile);
-
-            properties.load(new FileInputStream(propertiesFile));
-
-            // Connection Properties
-            broker = properties.getProperty("broker",broker).trim();
-            connectID = properties.getProperty("connectID",connectID).trim();
-            username = properties.getProperty("username",username).trim();
-            password = properties.getProperty("password",password).trim();
-
-            // Queue Properties
-            browseQueues = properties.getProperty("browseQueues", browseQueues).trim();
-
-            // Text Properties
-            textFontName = properties.getProperty("textFontName", textFontName).trim();
-            textFontStyle = properties.getProperty("textFontStyle", textFontStyle).trim();
-            textFontSize = properties.getProperty("textFontSize", textFontSize).trim();
-
-            // Window Properties
-            title = properties.getProperty("title", title).trim();
-
-        }
-        catch (java.io.FileNotFoundException fnfe)
-        {
-            System.out.println (propertiesFile + " not found: using defaults"); // Use Defaults
-        }
-        catch (java.io.IOException ioe)
-        {
-            ioe.printStackTrace();
-        }
-    }
-
-   /** Class to handle the "Browse" button action. */
-    public class OnBrowse implements ActionListener
-    {
-
-        public void actionPerformed(ActionEvent evt)
-        {
-            // Clear the textArea.
-            textArea.setText("");
-            textArea.paintImmediately(textArea.getBounds());
-
-            if(theQueues.size() == 0){
-                textArea.setText("No Queues to be monitored");
-            }
-            else{
-                for(int i = 0; i<theQueues.size();i++)
-                {
-                    try
-                    {
-                        // Create a browser on the queue and show the messages waiting in it.
-                        javax.jms.Queue q = (javax.jms.Queue) theQueues.elementAt(i);
-                       textArea.append("--------------------------------------------------\n");
-                       textArea.append("Messages on queue " + q.getQueueName() + ":\n");
-  
-                        // Create a queue browser
-                        System.out.print ("Browsing messages in queue " + q.getQueueName() + "\"...");
-                        javax.jms.QueueBrowser browser = session.createBrowser(q);
-                        System.out.println ("[done]");
-                        int cnt = 0;
-                        Enumeration e = browser.getEnumeration();
-                        if(!e.hasMoreElements())
-                        {
-                            textArea.append ("(This queue is empty.)");
-                        }
-                        else
-                        {
-                            while(e.hasMoreElements())
-                            {
-                                System.out.print(" --> getting message " + String.valueOf(++cnt) + "...");
-                                javax.jms.Message message = (javax.jms.Message) e.nextElement();
-                                System.out.println("[" + message + "]");
-                                if (message != null)
-                                {
-                                    String msgText = getContents (message);
-                                    textArea.append(msgText + "\n");
-                                    try
-                                    {
-                                        // Scroll the text area to show the message
-                                        Rectangle area = textArea.modelToView(textArea.getText().length());
-                                        textArea.scrollRectToVisible(area);
-                                        textArea.paintImmediately(textArea.getBounds());
-                                    }
-                                    catch(Exception jle) { jle.printStackTrace();}
-                                }
-                            }
-                        }
-                        // Free any resources in the browser.
-                        browser.close();
-                        textArea.append ("\n");
-                    }
-                    catch (javax.jms.JMSException jmse){
-                        jmse.printStackTrace();
-                    }
-                }
-                try
-                {
-                    // Scroll the text area to show the message
-                    Rectangle area = textArea.modelToView(textArea.getText().length());
-                    textArea.scrollRectToVisible(area);
-                    textArea.paintImmediately(textArea.getBounds());
-                }
-                catch(Exception jle) { jle.printStackTrace();}
-            }
-        }
-    }
-
-    public String getContents (javax.jms.Message message){
-
-
-            String msgBody = null;
-            String msgClass = message.getClass().getName();
-
-            if (message instanceof javax.jms.TextMessage)
-            {
-                msgClass = "javax.jms.TextMessage";
-                try
-                {
-                    msgBody = ((javax.jms.TextMessage)message).getText();
-                }
-                catch (javax.jms.JMSException jmse)
-                {
-                    msgBody = "";
-                }
-            }
-          
-            else if (message instanceof org.apache.activemq.command.ActiveMQMapMessage)
-            {
-		  			    System.out.println ("(Name value pairs in the MapMessage are not displayed.)");
-            }
-            else if (message instanceof javax.jms.BytesMessage)
-          			{
-		  			    System.out.println ("Warning: A bytes message was discarded because it could not be processed as a javax.jms.TextMessage.");
-		  			 }
-            else if (message instanceof javax.jms.ObjectMessage)
-          			{
-		  			    System.out.println ("Warning: An object message was discarded because it could not be processed as a javax.jms.TextMessage.");
-		  			 }
-
-            else if (message instanceof javax.jms.StreamMessage)
-					{
-			   			System.out.println ("Warning: A stream message was discarded because it could not be processed as a javax.jms.TextMessage.");
-					 }
-        return "- " + msgClass + " from " + msgBody ;
-
-    }
+/*
+ * � 2001-2009, Progress Software Corporation and/or its subsidiaries or affiliates.  All rights reserved.
+ *
+ * Licensed 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.
+ 
+Sample Application
+
+Writing a Basic JMS Application using:
+    - QueueBrowser
+    - JMS with a Graphical Interface
+    - behavior based on message type
+
+When you run this program, it will read all the parameters out
+of the QueueMonitor.properties file. In this file you can specify
+which queues you want to monitor. Then a Java window will open and
+every time you click the Browse button, The current contents of the queues
+will be displayed in the text window.
+
+Usage:
+  java QueueMonitor
+
+Suggested demonstration:
+  - Start one instance of this application:
+        java QueueMonitor
+  - Run on or more Talk applications (without the receiving queue).
+  - Enter messages on various Talk windows.
+  - Watch the QueueMonitor display the messages.
+
+*/
+import org.apache.activemq.*;
+
+import javax.swing.JTextArea;
+import javax.swing.JFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JButton;
+
+import javax.swing.text.Highlighter;
+import javax.swing.text.DefaultHighlighter;
+import javax.swing.text.BadLocationException;
+
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.BevelBorder;
+import javax.swing.border.SoftBevelBorder;
+
+import java.awt.Toolkit;
+import java.awt.Dimension;
+import java.awt.BorderLayout;
+import java.awt.Rectangle;
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ActionEvent;
+
+import java.io.FileInputStream;
+
+import java.util.Vector;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+public class QueueMonitor
+extends JFrame
+{
+    private static final String DEFAULT_PROPERTIES_FILE = "QueueMonitor.properties";
+
+    String propertiesFile = DEFAULT_PROPERTIES_FILE;
+    String broker = "tcp://localhost:61616";
+    String connectID = "QueueMonitor";
+    String username = "QueueMonitor";
+    String password = "QueueMonitor";
+    String browseQueues  = "Q1,Q2,Q3";
+    String textFontName = "Dialog";
+    String textFontStyle = "PLAIN";
+    String textFontSize = "12";
+    String title = "QueueMonitor";
+
+    JTextArea textArea = new JTextArea();
+    JScrollPane scrollPane = new JScrollPane(textArea);
+    JButton browseButton = new JButton("Browse Queues");
+
+    Vector theQueues = new Vector();
+
+    private javax.jms.Connection connect = null;
+    private javax.jms.Session session = null;
+
+/** Constructor for MessageMonitor window. */
+    public QueueMonitor()
+    {
+        loadProperties();
+
+        setTitle(title);
+
+        // Connect to Message Broker
+        try
+        {
+            javax.jms.ConnectionFactory factory;
+            factory = new ActiveMQConnectionFactory(username, password, broker);
+
+            connect = factory.createConnection (username, password);
+            session = connect.createSession(false,javax.jms.Session.AUTO_ACKNOWLEDGE);
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            System.err.println("Cannot connect to Broker");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        // Set up Queues:
+        StringTokenizer queues = new StringTokenizer(browseQueues, ",");
+        while (queues.hasMoreTokens())
+        {
+            try{
+                String queueName = queues.nextToken();
+                System.out.println ("Monitoring  " + queueName);
+                theQueues.addElement(session.createQueue(queueName));
+            }
+            catch (javax.jms.JMSException jmse)
+            {
+                jmse.printStackTrace();
+            }
+        }
+
+
+        // After init it is time to start the connection
+        try
+        {
+            connect.start();
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            System.err.println("Cannot start connection");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        //Elements visible on the screen
+        textArea.setEditable(false);
+        scrollPane.setBorder(new CompoundBorder(new EmptyBorder(6,6,6,6),
+                                                new SoftBevelBorder(BevelBorder.LOWERED)));
+        getContentPane().add(scrollPane,BorderLayout.CENTER);
+        getContentPane().add(browseButton,BorderLayout.SOUTH);
+
+        browseButton.addActionListener(new OnBrowse());
+
+    }
+
+
+
+    /** Main program entry point. */
+    public static void main(String[] args)
+    {
+        // There should be no arguments to this program.
+        if (args.length > 0) {
+            printUsage();
+            System.exit(1);
+        }
+
+        QueueMonitor queueMonitor = new QueueMonitor();
+
+        queueMonitor.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e)
+            {
+                System.exit(0);
+            }
+        });
+
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        screenSize.height = screenSize.height / 2 ;
+        screenSize.width = screenSize.width / 2 ;
+        queueMonitor.setSize(screenSize);
+        queueMonitor.setVisible(true);
+
+    }
+
+    /** Prints the usage. */
+    private static void printUsage()
+    {
+        StringBuffer use = new StringBuffer();
+        use.append("\nusage: QueueMonitor\n\n");
+        use.append("Properties for this sample can be set in a properties file.\n");
+        String dfltFile = System.getProperty("propertiesFile", DEFAULT_PROPERTIES_FILE);
+        use.append("[Default file: " + dfltFile +"]\n\n");
+        System.out.print(use);
+    }
+
+    /** Load the window and JMS properties from a file. */
+    private void loadProperties()
+    {
+        try
+        {
+            Properties properties = new Properties();
+
+            propertiesFile = System.getProperty("propertiesFile", propertiesFile);
+
+            properties.load(new FileInputStream(propertiesFile));
+
+            // Connection Properties
+            broker = properties.getProperty("broker",broker).trim();
+            connectID = properties.getProperty("connectID",connectID).trim();
+            username = properties.getProperty("username",username).trim();
+            password = properties.getProperty("password",password).trim();
+
+            // Queue Properties
+            browseQueues = properties.getProperty("browseQueues", browseQueues).trim();
+
+            // Text Properties
+            textFontName = properties.getProperty("textFontName", textFontName).trim();
+            textFontStyle = properties.getProperty("textFontStyle", textFontStyle).trim();
+            textFontSize = properties.getProperty("textFontSize", textFontSize).trim();
+
+            // Window Properties
+            title = properties.getProperty("title", title).trim();
+
+        }
+        catch (java.io.FileNotFoundException fnfe)
+        {
+            System.out.println (propertiesFile + " not found: using defaults"); // Use Defaults
+        }
+        catch (java.io.IOException ioe)
+        {
+            ioe.printStackTrace();
+        }
+    }
+
+   /** Class to handle the "Browse" button action. */
+    public class OnBrowse implements ActionListener
+    {
+
+        public void actionPerformed(ActionEvent evt)
+        {
+            // Clear the textArea.
+            textArea.setText("");
+            textArea.paintImmediately(textArea.getBounds());
+
+            if(theQueues.size() == 0){
+                textArea.setText("No Queues to be monitored");
+            }
+            else{
+                for(int i = 0; i<theQueues.size();i++)
+                {
+                    try
+                    {
+                        // Create a browser on the queue and show the messages waiting in it.
+                        javax.jms.Queue q = (javax.jms.Queue) theQueues.elementAt(i);
+                       textArea.append("--------------------------------------------------\n");
+                       textArea.append("Messages on queue " + q.getQueueName() + ":\n");
+  
+                        // Create a queue browser
+                        System.out.print ("Browsing messages in queue " + q.getQueueName() + "\"...");
+                        javax.jms.QueueBrowser browser = session.createBrowser(q);
+                        System.out.println ("[done]");
+                        int cnt = 0;
+                        Enumeration e = browser.getEnumeration();
+                        if(!e.hasMoreElements())
+                        {
+                            textArea.append ("(This queue is empty.)");
+                        }
+                        else
+                        {
+                            while(e.hasMoreElements())
+                            {
+                                System.out.print(" --> getting message " + String.valueOf(++cnt) + "...");
+                                javax.jms.Message message = (javax.jms.Message) e.nextElement();
+                                System.out.println("[" + message + "]");
+                                if (message != null)
+                                {
+                                    String msgText = getContents (message);
+                                    textArea.append(msgText + "\n");
+                                    try
+                                    {
+                                        // Scroll the text area to show the message
+                                        Rectangle area = textArea.modelToView(textArea.getText().length());
+                                        textArea.scrollRectToVisible(area);
+                                        textArea.paintImmediately(textArea.getBounds());
+                                    }
+                                    catch(Exception jle) { jle.printStackTrace();}
+                                }
+                            }
+                        }
+                        // Free any resources in the browser.
+                        browser.close();
+                        textArea.append ("\n");
+                    }
+                    catch (javax.jms.JMSException jmse){
+                        jmse.printStackTrace();
+                    }
+                }
+                try
+                {
+                    // Scroll the text area to show the message
+                    Rectangle area = textArea.modelToView(textArea.getText().length());
+                    textArea.scrollRectToVisible(area);
+                    textArea.paintImmediately(textArea.getBounds());
+                }
+                catch(Exception jle) { jle.printStackTrace();}
+            }
+        }
+    }
+
+    public String getContents (javax.jms.Message message){
+
+
+            String msgBody = null;
+            String msgClass = message.getClass().getName();
+
+            if (message instanceof javax.jms.TextMessage)
+            {
+                msgClass = "javax.jms.TextMessage";
+                try
+                {
+                    msgBody = ((javax.jms.TextMessage)message).getText();
+                }
+                catch (javax.jms.JMSException jmse)
+                {
+                    msgBody = "";
+                }
+            }
+          
+            else if (message instanceof org.apache.activemq.command.ActiveMQMapMessage)
+            {
+		  			    System.out.println ("(Name value pairs in the MapMessage are not displayed.)");
+            }
+            else if (message instanceof javax.jms.BytesMessage)
+          			{
+		  			    System.out.println ("Warning: A bytes message was discarded because it could not be processed as a javax.jms.TextMessage.");
+		  			 }
+            else if (message instanceof javax.jms.ObjectMessage)
+          			{
+		  			    System.out.println ("Warning: An object message was discarded because it could not be processed as a javax.jms.TextMessage.");
+		  			 }
+
+            else if (message instanceof javax.jms.StreamMessage)
+					{
+			   			System.out.println ("Warning: A stream message was discarded because it could not be processed as a javax.jms.TextMessage.");
+					 }
+        return "- " + msgClass + " from " + msgBody ;
+
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
index 7f296f5..4c714ef 100644
--- a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
+++ b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueMonitor/QueueMonitor.properties
@@ -1,72 +1,72 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-# This is the properties file for the QueueMonitor Class.
-#
-# A QueueMonitor object will load this file when constructed.
-# By default, a QueueMonitor object searches for and load a 
-# file named "QueueMonitor.properties" in the JVM's "current" directory.
-#
-# This behavior may be overriden by assigning an alternate property file
-# name and location to the System property "propertiesFile".
-#
-# Property:         broker
-# Default Value:    localhost   
-# Description:      Specifies the host and port of the Messaging Broker to connect to.
-broker              tcp://localhost:61616
-#
-# Property:         connectID
-# Default Value:    QueueMonitor 
-# Description:      Specifies the program identifier used to connect to the Messaging Broker.
-connectID           QueueMonitor 
-#
-# Property:         userID
-# Default Value:    Administrator 
-# Description:      Specifies the user identifier used to connect to the Messaging Broker.
-username            Administrator 
-#
-# Property:         password
-# Default Value:    Administrator 
-# Description:      Specifies the password used to connect to the Messaging Broker.
-password            Administrator 
-#
-# Property:         browseQueues
-# Default Value:     
-# Description:      A comma-separated list of queue names that QueueMonitor browses.
-#                   NOTE: An empty list will subscribe to no queues.
-browseQueues        Q1,Q2,Q3,Q4
-##
-# Property:         textFontName
-# Default Value:    Dialog
-# Description:      The name of the font used to display recieved messages.
-textFontName        Dialog   
-#
-# Property:         textFontStyle
-# Default Value:    PLAIN
-# Description:      The style of the font used to display received messages.
-textFontStyle       PLAIN   
-#
-# Property:         textFontSize
-# Default Value:    12
-# Description:      The size of the font used to display recieved messages.
-textFontSize        12   
-#
-# Property:         title
-# Default Value:    QueueMonitor
-# Description:      The title of the QueueMonitor Window.
-title               QueueMonitor   
-..
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+# This is the properties file for the QueueMonitor Class.
+#
+# A QueueMonitor object will load this file when constructed.
+# By default, a QueueMonitor object searches for and load a 
+# file named "QueueMonitor.properties" in the JVM's "current" directory.
+#
+# This behavior may be overriden by assigning an alternate property file
+# name and location to the System property "propertiesFile".
+#
+# Property:         broker
+# Default Value:    localhost   
+# Description:      Specifies the host and port of the Messaging Broker to connect to.
+broker              tcp://localhost:61616
+#
+# Property:         connectID
+# Default Value:    QueueMonitor 
+# Description:      Specifies the program identifier used to connect to the Messaging Broker.
+connectID           QueueMonitor 
+#
+# Property:         userID
+# Default Value:    Administrator 
+# Description:      Specifies the user identifier used to connect to the Messaging Broker.
+username            Administrator 
+#
+# Property:         password
+# Default Value:    Administrator 
+# Description:      Specifies the password used to connect to the Messaging Broker.
+password            Administrator 
+#
+# Property:         browseQueues
+# Default Value:     
+# Description:      A comma-separated list of queue names that QueueMonitor browses.
+#                   NOTE: An empty list will subscribe to no queues.
+browseQueues        Q1,Q2,Q3,Q4
+##
+# Property:         textFontName
+# Default Value:    Dialog
+# Description:      The name of the font used to display recieved messages.
+textFontName        Dialog   
+#
+# Property:         textFontStyle
+# Default Value:    PLAIN
+# Description:      The style of the font used to display received messages.
+textFontStyle       PLAIN   
+#
+# Property:         textFontSize
+# Default Value:    12
+# Description:      The size of the font used to display recieved messages.
+textFontSize        12   
+#
+# Property:         title
+# Default Value:    QueueMonitor
+# Description:      The title of the QueueMonitor Window.
+title               QueueMonitor   
+..

http://git-wip-us.apache.org/repos/asf/activemq/blob/3f32507f/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueRoundTrip/QueueRoundTrip.java
----------------------------------------------------------------------
diff --git a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueRoundTrip/QueueRoundTrip.java b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueRoundTrip/QueueRoundTrip.java
index 9732501..7b9d4fc 100644
--- a/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueRoundTrip/QueueRoundTrip.java
+++ b/assembly/src/release/examples/openwire/exploring-jms/QueuePTPSamples/QueueRoundTrip/QueueRoundTrip.java
@@ -1,242 +1,242 @@
-/*
- * � 2001-2009, Progress Software Corporation and/or its subsidiaries or affiliates.  All rights reserved.
- *
- * Licensed 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.
- 
-Sample Application
-
-Queue/PTP
-Send and receive using multiple sessions and a temporary queue
-
-This sample shows the round trip time for a message being sent to the broker
-and received. A temporary queue is used to guarantee that each instance of this
-sample receives its own messages only.
-
-Usage:
-
-    java QueueRoundTrip -b <broker:port> -u <username> -p <password> -n <numTests> -h
-        Optional Parameters:
-        -b  broker:port    Broker name and port of your message server
-                            Default: tcp://localhost:61616
-        -u  username       Default: user (username required)
-        -p  password       Default: password (not checked)
-        -n  numTests       The number of messages to be sent/received
-                           Default: 100
-        -h                 Prints help screen.
- */
-import org.apache.activemq.*;
-
-
-public class QueueRoundTrip
-{
-    private static final String DEFAULT_BROKER_NAME = "tcp://localhost:61616";
-    private static final String DEFAULT_PASSWORD    = "password";
-    private static final String DEFAULT_USER_NAME   = "user";
-    private static final int DEFAULT_NUM_TESTS      = 100;
-
-    private static final int msgSize = 1400;
-    private static byte[] msgBody = new byte[msgSize];
-
-    private javax.jms.ConnectionFactory factory = null;
-    private javax.jms.Connection connection     = null;
-    private javax.jms.Session sendSession       = null;
-    private javax.jms.Session receiveSession    = null;
-    private javax.jms.MessageProducer sender    = null;
-    private javax.jms.MessageConsumer receiver  = null;
-
-    private void QueueRoundTripper(String broker, String username, String password, int numTests){
-
-        try
-        {
-            //Set up two sessions, one for sending and the other for receiving
-            factory = new ActiveMQConnectionFactory(username, password, broker);
-            connection = factory.createConnection(username, password);
-            sendSession = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
-            receiveSession = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
-        }
-        catch (javax.jms.JMSException jmse)
-        {
-            System.err.println ("error: Cannot connect to broker- " + broker + ".\n");
-            jmse.printStackTrace ();
-            System.exit(1);
-        }
-
-        try
-        {
-            //Set up a temporary Queue:
-            javax.jms.TemporaryQueue tempQueue = sendSession.createTemporaryQueue();
-            receiver = receiveSession.createConsumer(tempQueue);
-            sender = sendSession.createProducer(tempQueue);
-            connection.start();
-        }
-        catch (javax.jms.JMSException jmse){
-            System.err.println("error: Connection couldn't be started.\n");
-            jmse.printStackTrace();
-            System.exit(1);
-        }
-
-        //Send messages using Temporary Queue:
-        try {
-            System.out.println("QueueRoundTrip application:");
-            System.out.println("===========================");
-            System.out.println("Sending Messages to Temporary Queue...");
-
-            //create a message to send
-            javax.jms.BytesMessage msg = sendSession.createBytesMessage();
-            msg.writeBytes(msgBody);
-
-            //send and receive the message the specified number of times:
-            long time = System.currentTimeMillis();
-            for (int i = 0; i < numTests; i++){
-                sender.send(msg);
-                msg = (javax.jms.BytesMessage)receiver.receive();
-            }
-            time = System.currentTimeMillis()-time;
-
-            System.out.println("\nTime for " + numTests + " sends and receives:\t\t" +
-                                time + "ms\n" +
-                                "Average Time per message:\t\t\t" + (float)time/(float)numTests + "ms\n");
-            System.out.println("\n\nPress Enter to close this window.");
-            java.io.BufferedReader stdin =
-                new java.io.BufferedReader( new java.io.InputStreamReader( System.in ) );
-            stdin.readLine();
-            System.exit(0);
-        }
-
-        catch (javax.jms.JMSException jmse) {
-            System.err.println("error: message not sent/received.\n");
-            jmse.printStackTrace();
-            System.exit(1);
-        }
-
-        catch (java.io.IOException ioe) {
-            ioe.printStackTrace();
-        }
-
-
-    }
-
-        /** Cleanup resources and then exit. */
-    private void exit()
-    {
-        try
-        {
-            connection.close();
-        }
-        catch (javax.jms.JMSException jmse)
-        {
-            jmse.printStackTrace();
-        }
-
-        System.exit(0);
-    }
-
-    public static void main (String argv[])
-    {
-        // Values to be read from parameters
-        String broker    = DEFAULT_BROKER_NAME;
-        String username  = DEFAULT_USER_NAME;
-        String password  = DEFAULT_PASSWORD;
-        int numTests = DEFAULT_NUM_TESTS;
-
-        // Check parameters
-        if(argv.length > 0){
-            for (int i = 0; i < argv.length; i++) {
-                String arg = argv[i];
-
-                // Options
-                if (!arg.startsWith("-")) {
-                    System.err.println ("error: unexpected argument - "+arg);
-                    printUsage();
-                    System.exit(1);
-                }
-                else {
-                    if (arg.equals("-b")) {
-                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
-                            System.err.println("error: missing broker name:port");
-                            System.exit(1);
-                        }
-                        broker = argv[++i];
-                        continue;
-                    }
-
-                    if (arg.equals("-u")) {
-                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
-                            System.err.println("error: missing user name");
-                            System.exit(1);
-                        }
-                        username = argv[++i];
-                        continue;
-                    }
-
-                    if (arg.equals("-p")) {
-                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
-                            System.err.println("error: missing password");
-                            System.exit(1);
-                        }
-                        password = argv[++i];
-                        continue;
-                    }
-                    if (arg.equals("-n")) {
-                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
-                            System.err.println("error: missing number of test to run.");
-                            System.exit(1);
-                        }
-                        numTests = (new Integer(argv[++i])).intValue();
-                        continue;
-                    }
-
-                    if (arg.equals("-h")) {
-                        printUsage();
-                        System.exit(1);
-                    }
-                }
-            }
-        }
-
-        // create the payload
-        byte charToWrite = (0x30);
-        for (int i = 0; i < msgSize; i++)
-        {
-            msgBody[i] = charToWrite;
-            charToWrite = (byte) ((int) charToWrite + (int) 0x01);
-            if (charToWrite == (0x39))
-            {
-                charToWrite = (0x30);
-            }
-        }
-
-        // Start the JMS client for the test.
-        QueueRoundTrip queueRoundTripper = new QueueRoundTrip();
-        queueRoundTripper.QueueRoundTripper(broker, username, password, numTests);
-
-    }
-
-    private static void printUsage()
-    {
-        StringBuffer use = new StringBuffer();
-
-        use.append("Usage:\n");
-        use.append("java QueueRoundTrip (options)...\n\n");
-        use.append("options:\n");
-        use.append("-b  broker:port    Broker name and port of your message server\n");
-        use.append("                   Default: tcp://localhost:61616\n");
-        use.append("-u  username       Default: user (username required)\n");
-        use.append("-p  password       Default: password (not checked)\n");
-        use.append("-n  numTests       The number of messages to be sent/received\n");
-        use.append("                   Default: 100\n");
-        use.append("-h                 This help screen");
-        System.err.println (use);
-    }
-
-}
+/*
+ * � 2001-2009, Progress Software Corporation and/or its subsidiaries or affiliates.  All rights reserved.
+ *
+ * Licensed 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.
+ 
+Sample Application
+
+Queue/PTP
+Send and receive using multiple sessions and a temporary queue
+
+This sample shows the round trip time for a message being sent to the broker
+and received. A temporary queue is used to guarantee that each instance of this
+sample receives its own messages only.
+
+Usage:
+
+    java QueueRoundTrip -b <broker:port> -u <username> -p <password> -n <numTests> -h
+        Optional Parameters:
+        -b  broker:port    Broker name and port of your message server
+                            Default: tcp://localhost:61616
+        -u  username       Default: user (username required)
+        -p  password       Default: password (not checked)
+        -n  numTests       The number of messages to be sent/received
+                           Default: 100
+        -h                 Prints help screen.
+ */
+import org.apache.activemq.*;
+
+
+public class QueueRoundTrip
+{
+    private static final String DEFAULT_BROKER_NAME = "tcp://localhost:61616";
+    private static final String DEFAULT_PASSWORD    = "password";
+    private static final String DEFAULT_USER_NAME   = "user";
+    private static final int DEFAULT_NUM_TESTS      = 100;
+
+    private static final int msgSize = 1400;
+    private static byte[] msgBody = new byte[msgSize];
+
+    private javax.jms.ConnectionFactory factory = null;
+    private javax.jms.Connection connection     = null;
+    private javax.jms.Session sendSession       = null;
+    private javax.jms.Session receiveSession    = null;
+    private javax.jms.MessageProducer sender    = null;
+    private javax.jms.MessageConsumer receiver  = null;
+
+    private void QueueRoundTripper(String broker, String username, String password, int numTests){
+
+        try
+        {
+            //Set up two sessions, one for sending and the other for receiving
+            factory = new ActiveMQConnectionFactory(username, password, broker);
+            connection = factory.createConnection(username, password);
+            sendSession = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
+            receiveSession = connection.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            System.err.println ("error: Cannot connect to broker- " + broker + ".\n");
+            jmse.printStackTrace ();
+            System.exit(1);
+        }
+
+        try
+        {
+            //Set up a temporary Queue:
+            javax.jms.TemporaryQueue tempQueue = sendSession.createTemporaryQueue();
+            receiver = receiveSession.createConsumer(tempQueue);
+            sender = sendSession.createProducer(tempQueue);
+            connection.start();
+        }
+        catch (javax.jms.JMSException jmse){
+            System.err.println("error: Connection couldn't be started.\n");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        //Send messages using Temporary Queue:
+        try {
+            System.out.println("QueueRoundTrip application:");
+            System.out.println("===========================");
+            System.out.println("Sending Messages to Temporary Queue...");
+
+            //create a message to send
+            javax.jms.BytesMessage msg = sendSession.createBytesMessage();
+            msg.writeBytes(msgBody);
+
+            //send and receive the message the specified number of times:
+            long time = System.currentTimeMillis();
+            for (int i = 0; i < numTests; i++){
+                sender.send(msg);
+                msg = (javax.jms.BytesMessage)receiver.receive();
+            }
+            time = System.currentTimeMillis()-time;
+
+            System.out.println("\nTime for " + numTests + " sends and receives:\t\t" +
+                                time + "ms\n" +
+                                "Average Time per message:\t\t\t" + (float)time/(float)numTests + "ms\n");
+            System.out.println("\n\nPress Enter to close this window.");
+            java.io.BufferedReader stdin =
+                new java.io.BufferedReader( new java.io.InputStreamReader( System.in ) );
+            stdin.readLine();
+            System.exit(0);
+        }
+
+        catch (javax.jms.JMSException jmse) {
+            System.err.println("error: message not sent/received.\n");
+            jmse.printStackTrace();
+            System.exit(1);
+        }
+
+        catch (java.io.IOException ioe) {
+            ioe.printStackTrace();
+        }
+
+
+    }
+
+        /** Cleanup resources and then exit. */
+    private void exit()
+    {
+        try
+        {
+            connection.close();
+        }
+        catch (javax.jms.JMSException jmse)
+        {
+            jmse.printStackTrace();
+        }
+
+        System.exit(0);
+    }
+
+    public static void main (String argv[])
+    {
+        // Values to be read from parameters
+        String broker    = DEFAULT_BROKER_NAME;
+        String username  = DEFAULT_USER_NAME;
+        String password  = DEFAULT_PASSWORD;
+        int numTests = DEFAULT_NUM_TESTS;
+
+        // Check parameters
+        if(argv.length > 0){
+            for (int i = 0; i < argv.length; i++) {
+                String arg = argv[i];
+
+                // Options
+                if (!arg.startsWith("-")) {
+                    System.err.println ("error: unexpected argument - "+arg);
+                    printUsage();
+                    System.exit(1);
+                }
+                else {
+                    if (arg.equals("-b")) {
+                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
+                            System.err.println("error: missing broker name:port");
+                            System.exit(1);
+                        }
+                        broker = argv[++i];
+                        continue;
+                    }
+
+                    if (arg.equals("-u")) {
+                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
+                            System.err.println("error: missing user name");
+                            System.exit(1);
+                        }
+                        username = argv[++i];
+                        continue;
+                    }
+
+                    if (arg.equals("-p")) {
+                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
+                            System.err.println("error: missing password");
+                            System.exit(1);
+                        }
+                        password = argv[++i];
+                        continue;
+                    }
+                    if (arg.equals("-n")) {
+                        if (i == argv.length - 1 || argv[i+1].startsWith("-")) {
+                            System.err.println("error: missing number of test to run.");
+                            System.exit(1);
+                        }
+                        numTests = (new Integer(argv[++i])).intValue();
+                        continue;
+                    }
+
+                    if (arg.equals("-h")) {
+                        printUsage();
+                        System.exit(1);
+                    }
+                }
+            }
+        }
+
+        // create the payload
+        byte charToWrite = (0x30);
+        for (int i = 0; i < msgSize; i++)
+        {
+            msgBody[i] = charToWrite;
+            charToWrite = (byte) ((int) charToWrite + (int) 0x01);
+            if (charToWrite == (0x39))
+            {
+                charToWrite = (0x30);
+            }
+        }
+
+        // Start the JMS client for the test.
+        QueueRoundTrip queueRoundTripper = new QueueRoundTrip();
+        queueRoundTripper.QueueRoundTripper(broker, username, password, numTests);
+
+    }
+
+    private static void printUsage()
+    {
+        StringBuffer use = new StringBuffer();
+
+        use.append("Usage:\n");
+        use.append("java QueueRoundTrip (options)...\n\n");
+        use.append("options:\n");
+        use.append("-b  broker:port    Broker name and port of your message server\n");
+        use.append("                   Default: tcp://localhost:61616\n");
+        use.append("-u  username       Default: user (username required)\n");
+        use.append("-p  password       Default: password (not checked)\n");
+        use.append("-n  numTests       The number of messages to be sent/received\n");
+        use.append("                   Default: 100\n");
+        use.append("-h                 This help screen");
+        System.err.println (use);
+    }
+
+}


Mime
View raw message