Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9AD75F5D9 for ; Tue, 2 Apr 2013 22:05:13 +0000 (UTC) Received: (qmail 88114 invoked by uid 500); 2 Apr 2013 22:05:13 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 88085 invoked by uid 500); 2 Apr 2013 22:05:13 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 88077 invoked by uid 99); 2 Apr 2013 22:05:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 22:05:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 22:05:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2014C238889B; Tue, 2 Apr 2013 22:04:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1463776 - /activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/ Date: Tue, 02 Apr 2013 22:04:47 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130402220448.2014C238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Tue Apr 2 22:04:47 2013 New Revision: 1463776 URL: http://svn.apache.org/r1463776 Log: Add fields for carrying poison ack cause and some utility constructors. Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java (with props) activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java (with props) activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java (with props) activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java (with props) Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java?rev=1463776&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java (added) +++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java Tue Apr 2 22:04:47 2013 @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.activemq.openwire.tool.commands; + +import java.io.PrintWriter; +import java.util.Set; + +public class MessageAckHeaderGenerator extends CommandHeaderGenerator { + + protected void populateIncludeFilesSet() { + Set includes = getIncludeFiles(); + includes.add(""); + includes.add(""); + + super.populateIncludeFilesSet(); + } + + protected void generateAdditionalConstructors( PrintWriter out ) { + + out.println(" "+getClassName()+"(const Pointer& message, int ackType, int messageCount);"); + out.println(""); + out.println(" "+getClassName()+"(const Pointer& dispatch, int ackType, int messageCount);"); + out.println(""); + + super.generateAdditionalConstructors(out); + } + +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java?rev=1463776&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java (added) +++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java Tue Apr 2 22:04:47 2013 @@ -0,0 +1,49 @@ +/** + * 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. + */ +package org.apache.activemq.openwire.tool.commands; + +import java.io.PrintWriter; + +public class MessageAckSourceGenerator extends CommandSourceGenerator { + + protected void generateAdditionalConstructors( PrintWriter out ) { + + out.println("////////////////////////////////////////////////////////////////////////////////"); + out.println("MessageAck::MessageAck(const Pointer& message, int ackType, int messageCount) :"); + out.println(" " + generateInitializerList() + " {"); + out.println(""); + out.println(" this->ackType = (unsigned char)ackType;"); + out.println(" this->destination = message->getDestination();"); + out.println(" this->lastMessageId = message->getMessageId();"); + out.println(" this->messageCount = messageCount;"); + out.println("}"); + out.println(""); + out.println("////////////////////////////////////////////////////////////////////////////////"); + out.println("MessageAck::MessageAck(const Pointer& dispatch, int ackType, int messageCount) :"); + out.println(" " + generateInitializerList() + " {"); + out.println(""); + out.println(" this->ackType = (unsigned char)ackType;"); + out.println(" this->consumerId = dispatch->getConsumerId();"); + out.println(" this->destination = dispatch->getDestination();"); + out.println(" this->lastMessageId = dispatch->getMessage()->getMessageId();"); + out.println(" this->messageCount = messageCount;"); + out.println("}"); + out.println(""); + + super.generateAdditionalConstructors(out); + } +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java?rev=1463776&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java (added) +++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java Tue Apr 2 22:04:47 2013 @@ -0,0 +1,50 @@ +/** + * 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. + */ +package org.apache.activemq.openwire.tool.commands; + +import java.io.PrintWriter; +import java.util.Set; + +public class MessageDispatchHeaderGenerator extends CommandHeaderGenerator { + + protected void populateIncludeFilesSet() { + Set includes = getIncludeFiles(); + includes.add(""); + + super.populateIncludeFilesSet(); + } + + protected void generateProperties( PrintWriter out ) { + + super.generateProperties(out); + + out.println(" private:"); + out.println(""); + out.println(" decaf::lang::Exception rollbackCause;"); + out.println(""); + } + + protected void generateAdditonalMembers( PrintWriter out ) { + out.println(" void setRollbackCause(const decaf::lang::Exception& cause);"); + out.println(""); + out.println(" decaf::lang::Exception getRollbackCause() const;"); + out.println(""); + + super.generateAdditonalMembers( out ); + } + +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java?rev=1463776&view=auto ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java (added) +++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java Tue Apr 2 22:04:47 2013 @@ -0,0 +1,42 @@ +/** + * 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. + */ +package org.apache.activemq.openwire.tool.commands; + +import java.io.PrintWriter; + +public class MessageDispatchSourceGenerator extends CommandSourceGenerator { + + protected String generateInitializerList() { + return super.generateInitializerList() + ", rollbackCause()"; + } + + protected void generateAdditionalMethods( PrintWriter out ) { + out.println("////////////////////////////////////////////////////////////////////////////////"); + out.println("void MessageDispatch::setRollbackCause(const decaf::lang::Exception& cause) {"); + out.println(" this->rollbackCause = cause;"); + out.println("}"); + out.println(""); + out.println("////////////////////////////////////////////////////////////////////////////////"); + out.println("decaf::lang::Exception MessageDispatch::getRollbackCause() const {"); + out.println(" return this->rollbackCause;"); + out.println("}"); + out.println(""); + + super.generateAdditionalMethods(out); + } + +} Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java?rev=1463776&r1=1463775&r2=1463776&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java (original) +++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java Tue Apr 2 22:04:47 2013 @@ -102,8 +102,8 @@ public class MessageIdSourceGenerator ex out.println(""); out.println(" if( key == \"\" ) {"); out.println(" this->key = this->producerId->toString() + \":\" + "); - out.println(" Long::toString( this->producerSequenceId) + \":\" + "); - out.println(" Long::toString( this->brokerSequenceId);"); + out.println(" Long::toString(this->producerSequenceId) + \":\" + "); + out.println(" Long::toString(this->brokerSequenceId);"); out.println(" }"); out.println(""); out.println(" return this->key;");