You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/01/16 20:38:51 UTC
svn commit: r496833 - in /incubator/qpid/trunk/qpid/java:
common/src/main/java/org/apache/qpid/util/concurrent/ perftests/
perftests/src/main/java/org/apache/qpid/requestreply/
Author: rgreig
Date: Tue Jan 16 11:38:51 2007
New Revision: 496833
URL: http://svn.apache.org/viewvc?view=rev&rev=496833
Log:
Fix to broken build due to missing file.
Added:
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java (with props)
Modified:
incubator/qpid/trunk/qpid/java/perftests/pom.xml
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
Added: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java?view=auto&rev=496833
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java (added)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java Tue Jan 16 11:38:51 2007
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (c) 2006 The Apache Software Foundation
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.util.concurrent;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Apache Software Foundation
+ */
+public class BooleanLatch extends CountDownLatch
+{
+ public BooleanLatch()
+ {
+ super(1);
+ }
+
+ public void signal()
+ {
+ countDown();
+ }
+
+ public void await(long nanos) throws InterruptedException
+ {
+ await(nanos, TimeUnit.NANOSECONDS);
+ }
+}
Propchange: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/qpid/trunk/qpid/java/perftests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/pom.xml?view=diff&rev=496833&r1=496832&r2=496833
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/perftests/pom.xml Tue Jan 16 11:38:51 2007
@@ -146,6 +146,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
+ <version>${assembly.version}</version>
<configuration>
<descriptors>
<descriptor>jar-with-dependencies.xml</descriptor>
Modified: incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java?view=diff&rev=496833&r1=496832&r2=496833
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java (original)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java Tue Jan 16 11:38:51 2007
@@ -20,23 +20,19 @@
*/
package org.apache.qpid.requestreply;
-import java.net.InetAddress;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jms.*;
-
import org.apache.log4j.Logger;
-
import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQNoConsumersException;
import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.message.TestMessageFactory;
import org.apache.qpid.jms.MessageProducer;
import org.apache.qpid.jms.Session;
import org.apache.qpid.ping.AbstractPingProducer;
import org.apache.qpid.util.concurrent.BooleanLatch;
+import javax.jms.*;
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* PingPongProducer is a client that sends pings to a queue and waits for pongs to be bounced back by a bounce back
* client (see {@link org.apache.qpid.requestreply.PingPongClient} for the bounce back client). It is designed to be run from the command line
@@ -238,7 +234,7 @@
*
* @throws JMSException All underlying JMSExceptions are allowed to fall through.
*/
- public Message pingAndWaitForReply(Message message, long timeout) throws JMSException
+ public Message pingAndWaitForReply(Message message, long timeout) throws JMSException, InterruptedException
{
_producer.send(message);
@@ -296,6 +292,11 @@
{
_publish = false;
_logger.debug("There was a JMSException: " + e.getMessage(), e);
+ }
+ catch (InterruptedException e)
+ {
+ _publish = false;
+ _logger.debug("There was an interruption: " + e.getMessage(), e);
}
}
}