diff options
Diffstat (limited to 'qpid/java/client/example')
-rw-r--r-- | qpid/java/client/example/bin/README.txt | 11 | ||||
-rw-r--r-- | qpid/java/client/example/bin/set_classpath.bat | 49 | ||||
-rwxr-xr-x | qpid/java/client/example/bin/set_classpath.sh | 82 | ||||
-rw-r--r-- | qpid/java/client/example/source-jar.xml | 35 | ||||
-rw-r--r-- | qpid/java/client/example/src/main/java/README.txt | 264 |
5 files changed, 4 insertions, 437 deletions
diff --git a/qpid/java/client/example/bin/README.txt b/qpid/java/client/example/bin/README.txt deleted file mode 100644 index 9a1ce91d41..0000000000 --- a/qpid/java/client/example/bin/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -= Qpid Java Examples = - -For more information read ../README.txt. - -== The Verify All Script == - -The verify_all script will run Java examples against itself and against the C++ -and Python examples. The success of the script is determined by comparing its -output against what is expected. - -This script uses the verify script found in qpid/cpp/examples. diff --git a/qpid/java/client/example/bin/set_classpath.bat b/qpid/java/client/example/bin/set_classpath.bat deleted file mode 100644 index 862e8e467a..0000000000 --- a/qpid/java/client/example/bin/set_classpath.bat +++ /dev/null @@ -1,49 +0,0 @@ -@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-
-@REM Helper script to set classpath for running Qpid example classes
-@REM NB: You must add the Qpid client and common jars to your CLASSPATH
-@REM before running this script
-
-@echo off
-
-if "%QPID_HOME%" == "" GOTO ERROR_QPID_HOME
-
-set QPIDLIB=%QPID_HOME%\lib
-
-if "%CLASSPATH%" == "" GOTO ERROR_CLASSPATH
-
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\geronimo-jms_1.1_spec-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-collections-3.1.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-configuration-1.2.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-cli-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-lang-2.1.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-api-1.0.4.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\log4j-1.2.12.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-core-1.1.7.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-filter-ssl-1.1.7.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-java5-1.0.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\slf4j-simple-1.0.jar
-
-GOTO END
-
-:ERROR_CLASSPATH
-Echo Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ....
-:ERROR_QPID_HOME
-Echo Please set QPID_HOME variable. Exiting ....
-:END
diff --git a/qpid/java/client/example/bin/set_classpath.sh b/qpid/java/client/example/bin/set_classpath.sh deleted file mode 100755 index a4f1b93625..0000000000 --- a/qpid/java/client/example/bin/set_classpath.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -xv -# -# 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. -# - -# Helper script to set classpath for running Qpid example classes -# NB: You must add the Qpid client and common jars to your CLASSPATH -# before running this script - - -cygwin=false -if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then - cygwin=true -fi - -#Should have set the QPID_HOME var after install to the working dir e.g. home/qpid/qpid-1.0-incubating-M2-SNAPSHOT -if [ "$QPID_HOME" = "" ] ; then - echo "ERROR: Please set QPID_HOME variable. Exiting ...." - exit 1 -else - QPIDLIB=$QPID_HOME/lib -fi - -if $cygwin; then - QPIDLIB=$(cygpath -w $QPIDLIB) -fi - -if [ "$CLASSPATH" = "" ] ; then - echo "ERROR: Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ...." - exit 2 -fi - -#Converts paths for cygwin if req -#Some nasty concatenation to get round cygpath line limits -if $cygwin; then - SEP=";" - CLASSPATH=`cygpath -w $CLASSPATH` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/geronimo-jms_1.1_spec-1.0.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-collections-3.1.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-configuration-1.2.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-cli-1.0.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-lang-2.1.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-api-1.0.4.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-1.0.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/log4j-1.2.12.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-core-1.1.7.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-filter-ssl-1.1.7.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-java5-1.0.0.jar` - CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/slf4j-simple-1.0.jar` - export CLASSPATH -else - CLASSPATH=$CLASSPATH:$QPIDLIB/backport-util-concurrent-2.2.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/geronimo-jms_1.1_spec-1.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-collections-3.1.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-configuration-1.2.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-cli-1.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-lang-2.1.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-api-1.0.4.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-1.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/log4j-1.2.12.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/mina-core-1.0.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/mina-filter-ssl-1.0.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/mina-java5-1.0.0.jar - CLASSPATH=$CLASSPATH:$QPIDLIB/slf4j-simple-1.0.jar - export CLASSPATH -fi - diff --git a/qpid/java/client/example/source-jar.xml b/qpid/java/client/example/source-jar.xml deleted file mode 100644 index 60451448b8..0000000000 --- a/qpid/java/client/example/source-jar.xml +++ /dev/null @@ -1,35 +0,0 @@ -<!--
- 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 an assembly descriptor that produces a jar file that contains all the
- dependencies, fully expanded into a single jar, required to run the tests of
- a maven project.
- -->
-<assembly>
- <id>source</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/java</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/qpid/java/client/example/src/main/java/README.txt b/qpid/java/client/example/src/main/java/README.txt index 7b371f17b5..757054e492 100644 --- a/qpid/java/client/example/src/main/java/README.txt +++ b/qpid/java/client/example/src/main/java/README.txt @@ -23,267 +23,11 @@ Note: you must have write privileges to this directory in order to run the examples. -Running the Direct Examples +Running the Examples =========================== To run these programs, do the following: - 1. Make sure that a qpidd broker is running: - - $ ps -eaf | grep qpidd - - If a broker is running, you should see the qpidd process in the - output of the above command. - - 2. In the java directory, use runSample.sh to run the Consumer - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.direct.Consumer - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer - Consumer: Creating a non-transacted, auto-acknowledged session - Consumer: Creating a MessageConsumer - Consumer: Starting connection so MessageConsumer can receive messages - - 3. In a separate window, use runSample.sh to run the Producer - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.direct.Producer - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Producer: Creating a non-transacted, auto-acknowledged session - Producer: Creating a Message Producer - Producer: Creating a TestMessage to send to the destination - Producer: Sending message: 1 - Producer: Sending message: 2 - Producer: Sending message: 3 - Producer: Sending message: 4 - Producer: Sending message: 5 - Producer: Sending message: 6 - Producer: Sending message: 7 - Producer: Sending message: 8 - Producer: Sending message: 9 - Producer: Sending message: 10 - Producer: Closing connection - Producer: Closing JNDI context - - 4. Now go back to the window where the Consumer program is - running. You should see the following output: - - Consumer: Received message: Message 1 - Consumer: Received message: Message 2 - Consumer: Received message: Message 3 - Consumer: Received message: Message 4 - Consumer: Received message: Message 5 - Consumer: Received message: Message 6 - Consumer: Received message: Message 7 - Consumer: Received message: Message 8 - Consumer: Received message: Message 9 - Consumer: Received message: Message 10 - Consumer: Received final message That's all, folks! - Consumer: Closing connection - Consumer: Closing JNDI context - - - -Running the Fanout Examples -=========================== - -To run these programs, do the following: - - 1. Make sure that a qpidd broker is running: - - $ ps -eaf | grep qpidd - - If a broker is running, you should see the qpidd process in the - output of the above command. - - 2. In the java directory, use runSample.sh to run the Consumer or - Listener program, specifying a unique queue name, which must be - “fanoutQueue1”, “fanoutQueue2”, or “fanoutQueue3”: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.fanout.Consumer fanoutQueue1 - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer - Consumer: Creating a non-transacted, auto-acknowledged session - Consumer: Creating a MessageConsumer - Consumer: Starting connection so MessageConsumer can receive messages - - You can do this in up to three windows, specifying a different - name for each queue. - - 3. In a separate window, use runSample.sh to run the Producer - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.fanout.Producer - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Producer: Creating a non-transacted, auto-acknowledged session - Producer: Creating a Message Producer - Producer: Creating a TestMessage to send to the destination - Producer: Sending message: 1 - Producer: Sending message: 2 - Producer: Sending message: 3 - Producer: Sending message: 4 - Producer: Sending message: 5 - Producer: Sending message: 6 - Producer: Sending message: 7 - Producer: Sending message: 8 - Producer: Sending message: 9 - Producer: Sending message: 10 - Producer: Closing connection - Producer: Closing JNDI context - - 4. Now go back to the window where the Listener program is - running. You should see output like this: - - Consumer: Received message: Message 1 - Consumer: Received message: Message 2 - Consumer: Received message: Message 3 - Consumer: Received message: Message 4 - Consumer: Received message: Message 5 - Consumer: Received message: Message 6 - Consumer: Received message: Message 7 - Consumer: Received message: Message 8 - Consumer: Received message: Message 9 - Consumer: Received message: Message 10 - Consumer: Received final message That's all, folks! - Consumer: Closing connection - Consumer: Closing JNDI context - - -Running the Publish/Subscribe Examples -====================================== - -To run these programs, do the following: - - 1. Make sure that a qpidd broker is running: - - $ ps -eaf | grep qpidd - - If a broker is running, you should see the qpidd process in the - output of the above command. - - 2. In the java directory, use runSample.sh to run the Listener - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.pubsub.Listener - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Listener: Setting an ExceptionListener on the connection as sample uses a TopicSubscriber - Listener: Creating a non-transacted, auto-acknowledged session - Listener: Creating a Message Subscriber for topic usa - Listener: Creating a Message Subscriber for topic europe - Listener: Creating a Message Subscriber for topic news - Listener: Creating a Message Subscriber for topic weather - Listener: Starting connection so TopicSubscriber can receive messages - - 3. In a separate window, use runSample.sh to run the Publisher - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.pubsub.Publisher - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Publisher: Creating a non-transacted, auto-acknowledged session - Publisher: Creating a TestMessage to send to the topics - Publisher: Creating a Message Publisher for topic usa.weather - Publisher: Sending message 1 - Publisher: Sending message 2 - Publisher: Sending message 3 - Publisher: Sending message 4 - Publisher: Sending message 5 - Publisher: Sending message 6 - Publisher: Creating a Message Publisher for topic usa.news - Publisher: Sending message 1 - Publisher: Sending message 2 - Publisher: Sending message 3 - Publisher: Sending message 4 - Publisher: Sending message 5 - Publisher: Sending message 6 - Publisher: Creating a Message Publisher for topic europe.weather - Publisher: Sending message 1 - Publisher: Sending message 2 - Publisher: Sending message 3 - Publisher: Sending message 4 - Publisher: Sending message 5 - Publisher: Sending message 6 - Publisher: Creating a Message Publisher for topic europe.news - Publisher: Sending message 1 - Publisher: Sending message 2 - Publisher: Sending message 3 - Publisher: Sending message 4 - Publisher: Sending message 5 - Publisher: Sending message 6 - Publisher: Closing connection - Publisher: Closing JNDI context - - 4. Now go back to the window where the Listener program is - running. You should see output like this: - - Listener: Received message for topic: usa: message 1 - Listener: Received message for topic: weather: message 1 - Listener: Received message for topic: usa: message 2 - Listener: Received message for topic: weather: message 2 - Listener: Received message for topic: usa: message 3 - Listener: Received message for topic: weather: message 3 - Listener: Received message for topic: usa: message 4 - Listener: Received message for topic: weather: message 4 - Listener: Received message for topic: usa: message 5 - Listener: Received message for topic: weather: message 5 - Listener: Received message for topic: usa: message 6 - Listener: Received message for topic: weather: message 6 - . . . - Listener: Shutting down listener for news - Listener: Shutting down listener for weather - Listener: Shutting down listener for usa - Listener: Shutting down listener for europe - Listener: Closing connection - Listener: Closing JNDI context - - -Running the Request/Response Examples -===================================== - -To run these programs, do the following: - - 1. Make sure that a qpidd broker is running: - - $ ps -eaf | grep qpidd - - If a broker is running, you should see the qpidd process in the output of the above command. - - 2. In the java directory, use runSample.sh to run the Server - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.requestResponse.Server - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer - Server: Creating a non-transacted, auto-acknowledged session - Server: Creating a MessageConsumer - Server: Creating a MessageProducer - Server: Starting connection so MessageConsumer can receive messages - - 3. In a separate window, use runSample.sh to run the Client - program: - - $ ./runSample.sh org.apache.qpid.example.jmsexample.requestResponse.Client - Using QPID_HOME: /usr/share/java/ - Using QPID_SAMPLE: /usr/share/doc/rhm-0.3 - Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer - Client: Creating a non-transacted, auto-acknowledged session - Client: Creating a QueueRequestor - Client: Starting connection - Client: Request Content= Twas brillig, and the slithy toves - Client: Response Content= TWAS BRILLIG, AND THE SLITHY TOVES - Client: Request Content= Did gire and gymble in the wabe. - Client: Response Content= DID GIRE AND GYMBLE IN THE WABE. - Client: Request Content= All mimsy were the borogroves, - Client: Response Content= ALL MIMSY WERE THE BOROGROVES, - Client: Request Content= And the mome raths outgrabe. - Client: Response Content= AND THE MOME RATHS OUTGRABE. - Client: Closing connection - Client: Closing JNDI context - + 1. Make sure that a Qpid broker is running. + 2. In the java directory, use runSample.sh to run the program: + $ ./runSample.sh <class name> <arguments>
\ No newline at end of file |