Return-Path: Delivered-To: apmail-incubator-qpid-commits-archive@locus.apache.org Received: (qmail 20343 invoked from network); 28 Sep 2007 15:50:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2007 15:50:56 -0000 Received: (qmail 12646 invoked by uid 500); 28 Sep 2007 15:48:33 -0000 Delivered-To: apmail-incubator-qpid-commits-archive@incubator.apache.org Received: (qmail 12634 invoked by uid 500); 28 Sep 2007 15:48:33 -0000 Mailing-List: contact qpid-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: qpid-dev@incubator.apache.org Delivered-To: mailing list qpid-commits@incubator.apache.org Received: (qmail 12625 invoked by uid 99); 28 Sep 2007 15:48:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 08:48:33 -0700 X-ASF-Spam-Status: No, hits=-98.8 required=10.0 tests=ALL_TRUSTED,DNS_FROM_DOB,RCVD_IN_DOB X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Sep 2007 15:51:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id ABDE91A9832; Fri, 28 Sep 2007 08:48:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r580394 - in /incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client: AMQSession.java AMQSession_0_10.java BasicMessageProducer_0_10.java message/FiledTableSupport.java Date: Fri, 28 Sep 2007 15:48:18 -0000 To: qpid-commits@incubator.apache.org From: arnaudsimon@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070928154819.ABDE91A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: arnaudsimon Date: Fri Sep 28 08:48:17 2007 New Revision: 580394 URL: http://svn.apache.org/viewvc?rev=580394&view=rev Log: fixed several 0_10 issues Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java?rev=580394&r1=580393&r2=580394&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java (original) +++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java Fri Sep 28 08:48:17 2007 @@ -2101,7 +2101,7 @@ return getProtocolHandler().getProtocolMinorVersion(); } - private boolean hasMessageListeners() + protected boolean hasMessageListeners() { return _hasMessageListeners; } @@ -2342,7 +2342,7 @@ * * @todo Be aware of possible changes to parameter order as versions change. */ - private void suspendChannel(boolean suspend) throws AMQException // , FailoverException + protected void suspendChannel(boolean suspend) throws AMQException // , FailoverException { synchronized (_suspensionLock) { Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java?rev=580394&r1=580393&r2=580394&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java (original) +++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java Fri Sep 28 08:48:17 2007 @@ -22,6 +22,8 @@ import org.apache.qpid.AMQException; import org.apache.qpid.protocol.AMQConstant; import org.apache.qpid.client.failover.FailoverException; +import org.apache.qpid.client.failover.FailoverNoopSupport; +import org.apache.qpid.client.failover.FailoverProtectedOperation; import org.apache.qpid.client.protocol.AMQProtocolHandler; import org.apache.qpid.client.message.MessageFactoryRegistry; import org.apache.qpidity.nclient.Session; @@ -403,6 +405,9 @@ { getQpidSession().messageFlow(consumer.getConsumerTag().toString(), Session.MESSAGE_FLOW_UNIT_MESSAGE, MAX_PREFETCH); + // todo this + getQpidSession().messageFlow(consumer.getConsumerTag().toString(), Session.MESSAGE_FLOW_UNIT_BYTE, + 0xFFFFFFFF); } } // We need to sync so that we get notify of an error. @@ -456,4 +461,41 @@ } } + protected AMQShortString declareQueue(final AMQDestination amqd, final AMQProtocolHandler protocolHandler) + throws AMQException + { + /*return new FailoverRetrySupport(*/ + return new FailoverNoopSupport( + new FailoverProtectedOperation() + { + public AMQShortString execute() throws AMQException, FailoverException + { + // Generate the queue name if the destination indicates that a client generated name is to be used. + if (amqd.isNameRequired()) + { + + //TODO this is for 0_10 only to be changed + amqd.setQueueName(new AMQShortString("tmp_" +System.currentTimeMillis())); + + } + + sendQueueDeclare(amqd,protocolHandler); + + return amqd.getAMQQueueName(); + } + }, _connection).execute(); + } + + + void start() throws AMQException + { + + super.suspendChannel(false); + + // If the event dispatcher is not running then start it too. + if (hasMessageListeners()) + { + startDistpatcherIfNecessary(); + } + } } Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java?rev=580394&r1=580393&r2=580394&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java (original) +++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java Fri Sep 28 08:48:17 2007 @@ -116,10 +116,10 @@ qpidityMessage.getMessageProperties() .setReplyTo(new ReplyTo(dest.getExchangeName().toString(), dest.getRoutingKey().toString())); } - - if (contentHeaderProperties.getHeaders() != null) + //JMS_QPID_DESTTYPE is always set but useles so this is a temporary fix + // TODO remove second test + if (contentHeaderProperties.getHeaders() != null && contentHeaderProperties.getHeaders().size() > 1) { - // todo use the new fieldTable qpidityMessage.getMessageProperties().setApplicationHeaders(FiledTableSupport.convertToMap(contentHeaderProperties.getHeaders())); for(String key:qpidityMessage.getMessageProperties().getApplicationHeaders().keySet()) Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java?rev=580394&r1=580393&r2=580394&view=diff ============================================================================== --- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java (original) +++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java Fri Sep 28 08:48:17 2007 @@ -23,9 +23,8 @@ public static Map convertToMap(FieldTable ft) { Map map = new HashMap(); - for (Enumeration keys = ft.getPropertyNames(); keys.hasMoreElements();) + for (AMQShortString key: ft.keySet() ) { - AMQShortString key = (AMQShortString)keys.nextElement(); map.put(key.asString(), ft.getObject(key)); }