From 4eaa4e42093e5524d9552d8fa312c214524b6bb4 Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Sat, 10 Mar 2012 19:22:10 +0000 Subject: NO-JIRA : AMQP-1-0 sandbox updates - merge from trunk git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rg-amqp-1-0-sandbox@1299257 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/java/client/example/src/main/java/README.txt | 33 --- .../main/java/org/apache/qpid/example/Drain.java | 18 +- .../java/org/apache/qpid/example/OptionParser.java | 50 ++-- .../main/java/org/apache/qpid/example/Spout.java | 20 +- .../example/publisher/FileMessageDispatcher.java | 163 ------------- .../qpid/example/publisher/FileMessageFactory.java | 138 ----------- .../example/publisher/MessageFactoryException.java | 29 --- .../publisher/MonitorMessageDispatcher.java | 141 ----------- .../qpid/example/publisher/MonitorPublisher.java | 105 -------- .../example/publisher/MultiMessageDispatcher.java | 141 ----------- .../apache/qpid/example/publisher/Publisher.java | 208 ---------------- .../qpid/example/publisher/TopicPublisher.java | 59 ----- .../publisher/UndeliveredMessageException.java | 32 --- .../org/apache/qpid/example/pubsub/Client.java | 72 ------ .../qpid/example/pubsub/ConnectionSetup.java | 121 ---------- .../org/apache/qpid/example/pubsub/Publisher.java | 81 ------- .../org/apache/qpid/example/pubsub/Subscriber.java | 98 -------- .../qpid/example/shared/ConnectionException.java | 29 --- .../qpid/example/shared/ContextException.java | 29 --- .../org/apache/qpid/example/shared/FileUtils.java | 168 ------------- .../qpid/example/shared/InitialContextHelper.java | 81 ------- .../org/apache/qpid/example/shared/Statics.java | 57 ----- .../apache/qpid/example/shared/example.properties | 40 ---- .../apache/qpid/example/simple/reqresp/Client.java | 263 --------------------- .../apache/qpid/example/simple/reqresp/Server.java | 236 ------------------ .../example/subscriber/MonitoredSubscriber.java | 139 ----------- .../subscriber/MonitoredSubscriptionWrapper.java | 47 ---- .../apache/qpid/example/subscriber/Subscriber.java | 182 -------------- .../example/subscriber/SubscriptionWrapper.java | 46 ---- .../java/client/example/src/main/java/runSample.sh | 72 ------ 30 files changed, 49 insertions(+), 2849 deletions(-) delete mode 100644 qpid/java/client/example/src/main/java/README.txt delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MultiMessageDispatcher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/TopicPublisher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Client.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Server.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java delete mode 100644 qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java delete mode 100755 qpid/java/client/example/src/main/java/runSample.sh (limited to 'qpid/java/client/example/src') diff --git a/qpid/java/client/example/src/main/java/README.txt b/qpid/java/client/example/src/main/java/README.txt deleted file mode 100644 index 757054e492..0000000000 --- a/qpid/java/client/example/src/main/java/README.txt +++ /dev/null @@ -1,33 +0,0 @@ -In order to use the runSample script, you are required to set two environment -variables, QPID_HOME and QPID_SAMPLE. If not the default values will be used. - -QPID_HOME ---------- -This is the directory that contains the QPID distribution. If you are running the Qpid -Java broker on the same machine as the examples, you have already set QPID_HOME to this -directory. - -default: /usr/share/java/ - -QPID_SAMPLE ------------ - -This is the examples directory, which is the parent directory of the -'java' directory in which you find 'runSample.sh' - -(Ex:- $QPID_SRC_HOME/java/client/example/src/main) - -default: $PWD - -Note: you must have write privileges to this directory in order to run -the examples. - - -Running the Examples -=========================== - -To run these programs, do the following: - - 1. Make sure that a Qpid broker is running. - 2. In the java directory, use runSample.sh to run the program: - $ ./runSample.sh \ No newline at end of file diff --git a/qpid/java/client/example/src/main/java/org/apache/qpid/example/Drain.java b/qpid/java/client/example/src/main/java/org/apache/qpid/example/Drain.java index b43031ad23..28e1d5a87e 100644 --- a/qpid/java/client/example/src/main/java/org/apache/qpid/example/Drain.java +++ b/qpid/java/client/example/src/main/java/org/apache/qpid/example/Drain.java @@ -27,8 +27,6 @@ import javax.jms.MessageConsumer; import javax.jms.Session; import org.apache.qpid.client.AMQAnyDestination; -import org.apache.qpid.client.AMQConnection; -import org.slf4j.Logger; public class Drain extends OptionParser { @@ -50,13 +48,13 @@ public class Drain extends OptionParser static { - optDefs.add(BROKER); - optDefs.add(HELP); - optDefs.add(TIMEOUT); - optDefs.add(FOREVER); - optDefs.add(COUNT); - optDefs.add(CON_OPTIONS); - optDefs.add(BROKER_OPTIONS); + addOption(BROKER); + addOption(HELP); + addOption(TIMEOUT); + addOption(FOREVER); + addOption(COUNT); + addOption(CON_OPTIONS); + addOption(BROKER_OPTIONS); } public Drain(String[] args, String usage, String desc) throws Exception @@ -66,7 +64,7 @@ public class Drain extends OptionParser Connection con = createConnection(); con.start(); Session ssn = con.createSession(false,Session.AUTO_ACKNOWLEDGE); - Destination dest = new AMQAnyDestination(address); + Destination dest = new AMQAnyDestination(getAddress()); MessageConsumer consumer = ssn.createConsumer(dest); Message msg; diff --git a/qpid/java/client/example/src/main/java/org/apache/qpid/example/OptionParser.java b/qpid/java/client/example/src/main/java/org/apache/qpid/example/OptionParser.java index f4e17c5c4c..6aa12f07fa 100644 --- a/qpid/java/client/example/src/main/java/org/apache/qpid/example/OptionParser.java +++ b/qpid/java/client/example/src/main/java/org/apache/qpid/example/OptionParser.java @@ -68,12 +68,12 @@ public class OptionParser String.class); - protected Map optMap = new HashMap(); - protected static final List