diff --git a/openwire-cpp/README.txt b/openwire-cpp/README.txt new file mode 100644 index 0000000000..1c8635490f --- /dev/null +++ b/openwire-cpp/README.txt @@ -0,0 +1,48 @@ +Apache ActiveMQ C++ Client +========================== + + +The ActiveMQ C++ client has support for both synchrounous and asynchrounous messaging as well as local transactions and more. To ease programming it uses smart pointers and STL extensively. For more information see included test programs. + + +How to build +============ +To run the supplied makefiles you need to set two environment variables, CONFIG and OSTYPE. With the help of variables the makefiles can determine what settings needs to be set for your platform. + +CONFIG can be set to either "debug" or "release" depending on what type of output you want. OSTYPE is set to "linux" or "macosx". + +For Windows, use the Visual Studio 2005 project files. + + +Connection URI +============== +To connect to the ActiveMQ broker a URI is specified. The URI may have a set of configuration parameters that are used to configure the client. + +Sample URI: "tcp://192.168.64.142:61616?trace=false&protocol=openwire&encoding=none" + +Scheme +------ +Name......: tcp +Desciption: Type of transport protocol +Mandatory.: Yes + +Parameters +---------- +Name......: protocol +Desciption: Type of wire protocol +Default...: "openwire" +Values....: "openwire" +Mandatory.: No + +Name......: encoding +Desciption: Character encoding +Default...: "AsciiToUTF8" +Values....: "none", "AsciiToUTF8" +Mandatory.: No + +Name......: trace +Desciption: Enables debug output to console +Default...: "false" +Values....: "true", "false" +Mandatory.: No + diff --git a/openwire-cpp/activemq-cpp.vcproj b/openwire-cpp/activemq-cpp.vcproj index 86e60b2920..43c95b2e03 100644 --- a/openwire-cpp/activemq-cpp.vcproj +++ b/openwire-cpp/activemq-cpp.vcproj @@ -46,6 +46,7 @@ BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" + ProgramDataBaseFileName="$(IntDir)\amqlib.pdb" WarningLevel="4" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" @@ -108,6 +109,7 @@ PreprocessorDefinitions="WIN32;NDEBUG;_LIB" RuntimeLibrary="2" UsePrecompiledHeader="0" + ProgramDataBaseFileName="$(IntDir)\amqlib.pdb" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" @@ -178,6 +180,14 @@ RelativePath=".\src\main\cpp\activemq\ConnectionClosedException.hpp" > + + + + @@ -198,6 +208,14 @@ RelativePath=".\src\main\cpp\activemq\ConsumerClosedException.hpp" > + + + + @@ -281,14 +299,6 @@ - - - - @@ -393,6 +403,14 @@ RelativePath=".\src\main\cpp\activemq\command\BaseCommand.hpp" > + + + + @@ -565,6 +583,14 @@ RelativePath=".\src\main\cpp\activemq\command\KeepAliveInfo.hpp" > + + + + @@ -613,6 +639,22 @@ RelativePath=".\src\main\cpp\activemq\command\MessageId.hpp" > + + + + + + + + @@ -645,6 +687,14 @@ RelativePath=".\src\main\cpp\activemq\command\RemoveSubscriptionInfo.hpp" > + + + + @@ -949,6 +999,22 @@ + + + + + + + + @@ -1013,6 +1079,30 @@ RelativePath=".\src\main\cpp\ppr\io\SocketOutputStream.hpp" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/openwire-cpp/makefile b/openwire-cpp/makefile index 5cb92a1848..695bd6675e 100644 --- a/openwire-cpp/makefile +++ b/openwire-cpp/makefile @@ -1,5 +1,6 @@ SRCDIR = src/main/cpp -MAKESUPPORT_HOME = $(PWD) +TSTDIR = src/test/cpp +MAKE_HOME = $(PWD) LIBOFILES = \ $(OUTDIR)/activemq/BrokerException.o \ @@ -15,7 +16,6 @@ LIBOFILES = \ $(OUTDIR)/activemq/Session.o \ $(OUTDIR)/activemq/TransactionContext.o \ \ - $(OUTDIR)/activemq/command/AbstractCommand.o \ $(OUTDIR)/activemq/command/ActiveMQBytesMessage.o \ $(OUTDIR)/activemq/command/ActiveMQDestination.o \ $(OUTDIR)/activemq/command/ActiveMQMapMessage.o \ @@ -23,17 +23,21 @@ LIBOFILES = \ $(OUTDIR)/activemq/command/ActiveMQObjectMessage.o \ $(OUTDIR)/activemq/command/ActiveMQQueue.o \ $(OUTDIR)/activemq/command/ActiveMQStreamMessage.o \ + $(OUTDIR)/activemq/command/ActiveMQTempDestination.o \ $(OUTDIR)/activemq/command/ActiveMQTempQueue.o \ $(OUTDIR)/activemq/command/ActiveMQTempTopic.o \ $(OUTDIR)/activemq/command/ActiveMQTextMessage.o \ $(OUTDIR)/activemq/command/ActiveMQTopic.o \ + $(OUTDIR)/activemq/command/BaseDataStructure.o \ $(OUTDIR)/activemq/command/BaseCommand.o \ $(OUTDIR)/activemq/command/BrokerError.o \ $(OUTDIR)/activemq/command/BrokerId.o \ $(OUTDIR)/activemq/command/BrokerInfo.o \ + $(OUTDIR)/activemq/command/ConnectionControl.o \ $(OUTDIR)/activemq/command/ConnectionError.o \ $(OUTDIR)/activemq/command/ConnectionId.o \ $(OUTDIR)/activemq/command/ConnectionInfo.o \ + $(OUTDIR)/activemq/command/ConsumerControl.o \ $(OUTDIR)/activemq/command/ConsumerId.o \ $(OUTDIR)/activemq/command/ConsumerInfo.o \ $(OUTDIR)/activemq/command/ControlCommand.o \ @@ -49,16 +53,20 @@ LIBOFILES = \ $(OUTDIR)/activemq/command/JournalTrace.o \ $(OUTDIR)/activemq/command/JournalTransaction.o \ $(OUTDIR)/activemq/command/KeepAliveInfo.o \ + $(OUTDIR)/activemq/command/LastPartialCommand.o \ $(OUTDIR)/activemq/command/LocalTransactionId.o \ $(OUTDIR)/activemq/command/Message.o \ $(OUTDIR)/activemq/command/MessageAck.o \ $(OUTDIR)/activemq/command/MessageDispatch.o \ $(OUTDIR)/activemq/command/MessageDispatchNotification.o \ $(OUTDIR)/activemq/command/MessageId.o \ + $(OUTDIR)/activemq/command/NetworkBridgeFilter.o \ + $(OUTDIR)/activemq/command/PartialCommand.o \ $(OUTDIR)/activemq/command/ProducerId.o \ $(OUTDIR)/activemq/command/ProducerInfo.o \ $(OUTDIR)/activemq/command/RemoveInfo.o \ $(OUTDIR)/activemq/command/RemoveSubscriptionInfo.o \ + $(OUTDIR)/activemq/command/ReplayCommand.o \ $(OUTDIR)/activemq/command/Response.o \ $(OUTDIR)/activemq/command/SessionId.o \ $(OUTDIR)/activemq/command/SessionInfo.o \ @@ -68,7 +76,6 @@ LIBOFILES = \ $(OUTDIR)/activemq/command/TransactionInfo.o \ $(OUTDIR)/activemq/command/WireFormatInfo.o \ $(OUTDIR)/activemq/command/XATransactionId.o \ - $(OUTDIR)/activemq/command/ActiveMQTempDestination.o \ \ $(OUTDIR)/activemq/protocol/openwire/OpenWireMarshaller.o \ $(OUTDIR)/activemq/protocol/openwire/OpenWireProtocol.o \ @@ -84,6 +91,10 @@ LIBOFILES = \ \ $(OUTDIR)/cms/CmsException.o \ \ + $(OUTDIR)/ppr/io/encoding/AsciiToUTF8Encoder.o \ + $(OUTDIR)/ppr/io/encoding/CharsetEncoderRegistry.o \ + $(OUTDIR)/ppr/io/BufferedInputStream.o \ + $(OUTDIR)/ppr/io/BufferedOutputStream.o \ $(OUTDIR)/ppr/io/ByteArrayInputStream.o \ $(OUTDIR)/ppr/io/ByteArrayOutputStream.o \ $(OUTDIR)/ppr/io/DataInputStream.o \ @@ -106,12 +117,16 @@ LIBOFILES = \ OUTLIB = $(OUTDIR)/libactivemq.a EXEOFILES = \ - $(OUTDIR)/TestMain.o \ - $(OUTDIR)/TestListener.o \ + $(OUTDIR)/TestSuite.o \ + $(OUTDIR)/TestSynchQueue.o \ + $(OUTDIR)/TestAsynchQueue.o \ + $(OUTDIR)/TestAsynchTopic.o \ + $(OUTDIR)/TestLocalTXCommit.o \ EXELIBS = -lactivemq -lpthread -lstdc++ +OUTEXE = $(OUTDIR)/test DEFINES = -include $(MAKESUPPORT_HOME)/makefile.cfg +include $(MAKE_HOME)/makefile.cfg diff --git a/openwire-cpp/makefile-linux-debug.cfg b/openwire-cpp/makefile-linux-debug.cfg index 048d0cab4b..b73317609a 100644 --- a/openwire-cpp/makefile-linux-debug.cfg +++ b/openwire-cpp/makefile-linux-debug.cfg @@ -9,6 +9,6 @@ CC = g++ -frtti -g -pthread -DDEBUG -D_DEBUG -D_REENTRANT LD = g++ -g -frtti -pthread CCFLAGS = -Wall LDFLAGS = -luuid -OUTDIR = $(MAKESUPPORT_HOME)/out +OUTDIR = $(MAKE_HOME)/out ARFLAGS = diff --git a/openwire-cpp/makefile-linux-release.cfg b/openwire-cpp/makefile-linux-release.cfg index 1e023583d4..9de460768e 100644 --- a/openwire-cpp/makefile-linux-release.cfg +++ b/openwire-cpp/makefile-linux-release.cfg @@ -9,7 +9,7 @@ CC = g++ -frtti -pthread -O3 -DNDEBUG -D_REENTRANT LD = g++ -frtti -pthread CCFLAGS = -Wall LDFLAGS = -luuid -OUTDIR = $(MAKESUPPORT_HOME)/out +OUTDIR = $(MAKE_HOME)/out ARFLAGS = diff --git a/openwire-cpp/makefile-macosx-debug.cfg b/openwire-cpp/makefile-macosx-debug.cfg index a1e22c9c9f..58aa5c384f 100644 --- a/openwire-cpp/makefile-macosx-debug.cfg +++ b/openwire-cpp/makefile-macosx-debug.cfg @@ -9,6 +9,6 @@ CC = g++ -frtti -g -DDEBUG -D_DEBUG -D_REENTRANT -DMACOSX -Dunix LD = g++ -g -frtti CCFLAGS = -Wall LDFLAGS = -lpthread -OUTDIR = $(MAKESUPPORT_HOME)/out +OUTDIR = $(MAKE_HOME)/out ARFLAGS = diff --git a/openwire-cpp/makefile-macosx-release.cfg b/openwire-cpp/makefile-macosx-release.cfg index d8fb00808c..64802d7c54 100644 --- a/openwire-cpp/makefile-macosx-release.cfg +++ b/openwire-cpp/makefile-macosx-release.cfg @@ -9,7 +9,7 @@ CC = g++ -frtti -O3 -DNDEBUG -D_REENTRANT -DMACOSX -Dunix LD = g++ -frtti CCFLAGS = -Wall LDFLAGS = -lpthread -OUTDIR = $(MAKESUPPORT_HOME)/out +OUTDIR = $(MAKE_HOME)/out ARFLAGS = diff --git a/openwire-cpp/makefile.cfg b/openwire-cpp/makefile.cfg index 0c9e4c2993..7ce86d722b 100644 --- a/openwire-cpp/makefile.cfg +++ b/openwire-cpp/makefile.cfg @@ -3,7 +3,7 @@ CURRENT = $(PWD) # --- select compiler for structure # ---------------------------------------------------------- -include $(MAKESUPPORT_HOME)/makefile-$(OSTYPE)-$(CONFIG).cfg +include $(MAKE_HOME)/makefile-$(OSTYPE)-$(CONFIG).cfg # --- set generic commmands # ---------------------------------------------------------- @@ -46,6 +46,11 @@ $(OUTDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/%.hpp $(CC) -o $@ $(DEFINES) $(CCFLAGS) -I$(SRCDIR) \ $(LOCAL_INCLUDE) -c $< +$(OUTDIR)/%.o: $(TSTDIR)/%.cpp $(TSTDIR)/%.hpp + $(ECHO) " - "$(CC) "'"$<"'" + $(CC) -o $@ $(DEFINES) $(CCFLAGS) -I$(SRCDIR) -I$(TSTDIR) \ + $(LOCAL_INCLUDE) -c $< + # --- set generic targets and their handling procedures # ---------------------------------------------------------- @@ -53,28 +58,32 @@ all: default default: \ prepare \ - $(LIBOFILES) \ $(OUTLIB) \ postpare +test: \ + prepare \ + $(OUTEXE) \ + postpare + + $(OUTLIB): $(LIBOFILES) $(DEPLIBS) $(ECHO) " - Creating static library file "$@ $(AR) $(ARFLAGS) $@ $(LIBOFILES) -test: $(OUTLIB) - $(ECHO) " - Creating test executable" - $(CC) $(CFLAGS) -I$(SRCDIR) -c $(SRCDIR)/../../test/cpp/TestMain.cpp $(OBJS) -o $(OUTDIR)/TestMain.o - $(CC) $(CFLAGS) -I$(SRCDIR) -c $(SRCDIR)/../../test/cpp/TestListener.cpp $(OBJS) -o $(OUTDIR)/TestListener.o - $(LD) $(LDFLAGS) -o $(OUTDIR)/$@ -L$(OUTDIR) $(EXEOFILES) $(EXELIBS) +$(OUTEXE): $(OUTLIB) $(EXEOFILES) + $(ECHO) " - Creating test executable file "$(OUTEXE) + $(LD) $(LDFLAGS) -o $@ -L$(OUTDIR) $(EXEOFILES) $(EXELIBS) clean: $(ECHO) " - Cleaning up local directory "$(CURRENT) $(ECHO) " - Removing object files" $(RM) $(LIBOFILES) + $(RM) $(EXEOFILES) $(ECHO) " - Removing file "$(OUTLIB) $(RM) $(OUTLIB) - $(ECHO) " - Removing file "$(TESTMAIN) - $(RM) $(OUTDIR)/test + $(ECHO) " - Removing file "$(OUTEXE) + $(RM) $(OUTEXE) $(RM) *~ *% $(RM) #* $(RM) core @@ -93,6 +102,7 @@ prepare: $(MD) $(OUTDIR)/cms; \ $(MD) $(OUTDIR)/ppr; \ $(MD) $(OUTDIR)/ppr/io; \ + $(MD) $(OUTDIR)/ppr/io/encoding; \ $(MD) $(OUTDIR)/ppr/net; \ $(MD) $(OUTDIR)/ppr/thread; \ $(MD) $(OUTDIR)/ppr/util; \ diff --git a/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppClassesScript.java b/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppClassesScript.java new file mode 100644 index 0000000000..d0dcffb4dd --- /dev/null +++ b/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppClassesScript.java @@ -0,0 +1,209 @@ +/* + * + * Copyright 2005-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.activemq.openwire.tool; + +import org.codehaus.jam.JClass; + +import java.io.File; + +/** + * + * @version $Revision: 379824 $ + */ +public abstract class OpenWireCppClassesScript extends OpenWireClassesScript { + + public Object run() { + filePostFix = getFilePostFix(); + if (destDir == null) { + destDir = new File("../openwire-cpp/src/main/cpp/activemq/command"); + } + return super.run(); + } + + protected String getFilePostFix() { + return ".cpp"; + } + + /** + * Converts the Java type to a C++ type name + */ + public String toCppType(JClass type) { + String name = type.getSimpleName(); + if (name.equals("String")) { + return "p"; + } + else if (type.isArrayType()) { + if( name.equals("byte[]") ) + name = "char[]" ; + else if( name.equals("DataStructure[]") ) + name = "IDataStructure[]" ; + + return "array<" + name.substring(0, name.length()-2) + ">"; + } + else if (name.equals("Throwable") || name.equals("Exception")) { + return "p"; + } + else if (name.equals("ByteSequence")) { + return "array"; + } + else if (name.equals("boolean")) { + return "bool"; + } + else if (name.equals("long")) { + return "long long"; + } + else if (name.equals("byte")) { + return "char"; + } + else if( name.equals("Command") || name.equals("DataStructure") ) { + return "p" ; + } + else if( !type.isPrimitiveType() ) { + return "p<" + name + ">" ; + } + else { + return name ; + } + } + + /** + * Converts the Java type to a C++ default value + */ + public String toCppDefaultValue(JClass type) { + String name = type.getSimpleName(); + + if ( name.equals("boolean") ) { + return "false"; + } + else if (!type.isPrimitiveType()) { + return "NULL"; + } + else { + return "0"; + } + } + + /** + * Converts the Java type to the name of the C++ marshal method + * to be used + */ + public String toMarshalMethodName(JClass type) { + String name = type.getSimpleName(); + if (name.equals("String")) { + return "marshalString"; + } + else if (type.isArrayType()) { + if ( type.getArrayComponentType().isPrimitiveType() && name.equals("byte[]") ) + return "marshalByteArray" ; + else + return "marshalObjectArray" ; + } + else if ( name.equals("ByteSequence") ) { + return "marshalByteArray"; + } + else if (name.equals("short") ) { + return "marshalShort"; + } + else if (name.equals("int") ) { + return "marshalInt"; + } + else if (name.equals("long") ) { + return "marshalLong"; + } + else if (name.equals("byte")) { + return "marshalByte"; + } + else if (name.equals("double")) { + return "marshalDouble"; + } + else if (name.equals("float")) { + return "marshalFloat"; + } + else if (name.equals("boolean")) { + return "marshalBoolean"; + } + else if( !type.isPrimitiveType() ) { + return "marshalObject" ; + } + else { + return name ; + } + } + + /** + * Converts the Java type to the name of the C++ unmarshal method + * to be used + */ + public String toUnmarshalMethodName(JClass type) { + String name = type.getSimpleName(); + if (name.equals("String")) { + return "unmarshalString"; + } + else if (type.isArrayType()) { + if ( type.getArrayComponentType().isPrimitiveType() && name.equals("byte[]") ) + return "unmarshalByteArray" ; + else + return "unmarshalObjectArray" ; + } + else if ( name.equals("ByteSequence") ) { + return "unmarshalByteArray"; + } + else if (name.equals("short") ) { + return "unmarshalShort"; + } + else if (name.equals("int") ) { + return "unmarshalInt"; + } + else if (name.equals("long") ) { + return "unmarshalLong"; + } + else if (name.equals("byte")) { + return "unmarshalByte"; + } + else if (name.equals("double")) { + return "unmarshalDouble"; + } + else if (name.equals("float")) { + return "unmarshalFloat"; + } + else if (name.equals("boolean")) { + return "unmarshalBoolean"; + } + else if( !type.isPrimitiveType() ) { + return "unmarshalObject" ; + } + else { + return name ; + } + } + + /** + * Converts the Java type to a C++ pointer cast + */ + public String toUnmarshalCast(JClass type) { + String name = toCppType(type) ; + + if( name.startsWith("p<") ) + return "p_cast<" + name.substring(2) ; + else if( name.startsWith("array<") && + (type.isArrayType() && !type.getArrayComponentType().isPrimitiveType()) && + !type.getSimpleName().equals("ByteSequence") ) + return "array_cast<" + name.substring(6) ; + else + return "" ; + } +} diff --git a/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppHeadersScript.java b/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppHeadersScript.java new file mode 100644 index 0000000000..514e3114a4 --- /dev/null +++ b/openwire-cpp/src/gram/java/org/apache/activemq/openwire/tool/OpenWireCppHeadersScript.java @@ -0,0 +1,30 @@ +/** + * + * Copyright 2005-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.activemq.openwire.tool; + + +/** + * + * @version $Revision: 379734 $ + */ +public abstract class OpenWireCppHeadersScript extends OpenWireCppClassesScript { + + protected String getFilePostFix() { + return ".hpp"; + } + +} diff --git a/openwire-cpp/src/gram/script/GenerateCppClasses.groovy b/openwire-cpp/src/gram/script/GenerateCppClasses.groovy new file mode 100644 index 0000000000..05b2ed23a6 --- /dev/null +++ b/openwire-cpp/src/gram/script/GenerateCppClasses.groovy @@ -0,0 +1,125 @@ +/** + * + * Copyright 2005-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. + */ +import org.apache.activemq.openwire.tool.OpenWireCppClassesScript + +/** + * Generates the C++ commands for the Open Wire Format + * + * @version $Revision$ + */ +class GenerateCppClasses extends OpenWireCppClassesScript { + + void generateFile(PrintWriter out) { + out << """/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/${className}.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ${className} + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +${className}::${className}() +{""" + for (property in properties) { + def value = toCppDefaultValue(property.type) + def propertyName = property.simpleName + def parameterName = decapitalize(propertyName) + out << """ + this->${parameterName} = ${value} ;""" + } + out << """ +} + +${className}::~${className}() +{ +} + +unsigned char ${className}::getDataStructureType() +{ + return ${className}::TYPE ; +} +""" + for (property in properties) { + def type = toCppType(property.type) + def propertyName = property.simpleName + def parameterName = decapitalize(propertyName) + out << """ + +${type} ${className}::get${propertyName}() +{ + return ${parameterName} ; +} + +void ${className}::set${propertyName}(${type} ${parameterName}) +{ + this->${parameterName} = ${parameterName} ; +} +""" + } +out << """ +int ${className}::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += ${baseClass}::marshal(marshaller, mode, ostream) ; """ + for (property in properties) { + def marshalMethod = toMarshalMethodName(property.type) + def propertyName = decapitalize(property.simpleName) + out << """ + size += marshaller->${marshalMethod}(${propertyName}, mode, ostream) ; """ + } +out << """ + return size ; +} + +void ${className}::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + ${baseClass}::unmarshal(marshaller, mode, istream) ; """ + for (property in properties) { + def cast = toUnmarshalCast(property.type) + def unmarshalMethod = toUnmarshalMethodName(property.type) + def propertyName = decapitalize(property.simpleName) + out << """ + ${propertyName} = ${cast}(marshaller->${unmarshalMethod}(mode, istream)) ; """ + } +out << """ +} +""" + } +} diff --git a/openwire-cpp/src/gram/script/GenerateCppHeaders.groovy b/openwire-cpp/src/gram/script/GenerateCppHeaders.groovy new file mode 100644 index 0000000000..4ddda0a028 --- /dev/null +++ b/openwire-cpp/src/gram/script/GenerateCppHeaders.groovy @@ -0,0 +1,153 @@ +/** + * + * Copyright 2005-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. + */ +import org.apache.activemq.openwire.tool.OpenWireCppHeadersScript + +/** + * Generates the C++ commands for the Open Wire Format + * + * @version $Revision$ + */ +class GenerateCppHeaders extends OpenWireCppHeadersScript { + + void generateFile(PrintWriter out) { + out << """/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_${className}_hpp_ +#define ActiveMQ_${className}_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +""" + out << """#include "activemq/command/${baseClass}.hpp" +""" +for (property in properties) +{ + if( !property.type.isPrimitiveType() && + property.type.simpleName != "String" && + property.type.simpleName != "ByteSequence" ) + { + def includeName = toCppType(property.type) + if( property.type.isArrayType() ) + { + def arrayType = property.type.arrayComponentType ; + if( arrayType.isPrimitiveType() ) + continue ; + } + if( includeName.startsWith("array<") ) + includeName = includeName.substring(6, includeName.length()-1) ; + else if( includeName.startsWith("p<") ) + includeName = includeName.substring(2, includeName.length()-1) + + if( includeName.equals("IDataStructure") ) + out << """#include "activemq/${includeName}.hpp" +""" + else + out << """#include "activemq/command/${includeName}.hpp" +""" + } +} +out << """ +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ${className} + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ${className} : public ${baseClass} +{ +protected: +""" + for (property in properties) { + def type = toCppType(property.type) + def name = decapitalize(property.simpleName) + out << """ $type $name ; +""" + } + out << """ +public: + const static unsigned char TYPE = ${getOpenWireOpCode(jclass)}; + +public: + ${className}() ; + virtual ~${className}() ; + + virtual unsigned char getDataStructureType() ; +""" + for (property in properties) { + def type = toCppType(property.type) + def propertyName = property.simpleName + def parameterName = decapitalize(propertyName) + out << """ + virtual ${type} get${propertyName}() ; + virtual void set${propertyName}(${type} ${parameterName}) ; +""" + } + out << """ + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_${className}_hpp_*/ +""" + } +} diff --git a/openwire-cpp/src/main/cpp/activemq/Connection.cpp b/openwire-cpp/src/main/cpp/activemq/Connection.cpp index b12643b3d7..dec7437b56 100644 --- a/openwire-cpp/src/main/cpp/activemq/Connection.cpp +++ b/openwire-cpp/src/main/cpp/activemq/Connection.cpp @@ -206,7 +206,7 @@ p Connection::createSession(AcknowledgementMode ackMode) throw(CmsExce /* * Performs a synchronous request-response with the broker. */ -p Connection::syncRequest(p command) throw(CmsException) +p Connection::syncRequest(p command) throw(CmsException) { checkConnected() ; @@ -233,7 +233,7 @@ p Connection::syncRequest(p command) throw(CmsException) /* * */ -void Connection::oneway(p command) throw(CmsException) +void Connection::oneway(p command) throw(CmsException) { checkConnected() ; transport->oneway(command) ; @@ -247,6 +247,35 @@ void Connection::disposeOf(p dataStructure) throw(CmsException) p command = new RemoveInfo() ; command->setObjectId( dataStructure ) ; syncRequest(command) ; + + // + // Delete session from internal list if a session id was supplied + // Note! Dispose of sessions should only be invoked from Session.close() + // + if( dataStructure->getDataStructureType() == SessionId::TYPE ) + { + list< p >::iterator tempIter ; + p sessionId ; + + // Convert data structure to a session id + sessionId = p_cast (dataStructure) ; + + // Iterate through all sessions and check for a match on the session id + for( tempIter = sessions.begin() ; + tempIter != sessions.end() ; + tempIter++ ) + { + p session = p_cast (*tempIter) ; + + // Do we have a session id match? + if( session->getSessionId()->getValue() == sessionId->getValue() ) + { + // Remove session + sessions.remove(session) ; + break ; + } + } + } } /* @@ -332,7 +361,7 @@ void Connection::checkConnected() throw(CmsException) /* * Handle incoming commands. */ -void Connection::onCommand(p transport, p command) +void Connection::onCommand(p transport, p command) { if( command->getDataStructureType() == MessageDispatch::TYPE ) { diff --git a/openwire-cpp/src/main/cpp/activemq/Connection.hpp b/openwire-cpp/src/main/cpp/activemq/Connection.hpp index 6fb48a0c39..a071145744 100644 --- a/openwire-cpp/src/main/cpp/activemq/Connection.hpp +++ b/openwire-cpp/src/main/cpp/activemq/Connection.hpp @@ -102,8 +102,8 @@ public: // Operation methods virtual p createSession() throw(CmsException) ; virtual p createSession(AcknowledgementMode mode) throw(CmsException) ; - virtual p syncRequest(p command) throw(CmsException) ; - virtual void oneway(p command) throw(CmsException) ; + virtual p syncRequest(p command) throw(CmsException) ; + virtual void oneway(p command) throw(CmsException) ; virtual void disposeOf(p dataStructure) throw(CmsException) ; virtual p createTemporaryDestinationName() ; virtual p createLocalTransactionId() ; @@ -113,7 +113,7 @@ protected: // Implementation methods p createSessionInfo(AcknowledgementMode mode) ; void checkConnected() throw(CmsException) ; - void onCommand(p transport, p command) ; + void onCommand(p transport, p command) ; void onError(p transport, exception& error) ; } ; diff --git a/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp b/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp index 2ab50affa0..3249a399a9 100644 --- a/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp +++ b/openwire-cpp/src/main/cpp/activemq/ConnectionFactory.cpp @@ -27,7 +27,7 @@ using namespace apache::activemq; ConnectionFactory::ConnectionFactory() { // Use default URI - brokerUri = new Uri ("tcp://localhost:61616?wireFormat=openwire") ; + brokerUri = new Uri ("tcp://localhost:61616") ; username = NULL ; password = NULL ; clientId = Guid::getGuidString() ; diff --git a/openwire-cpp/src/main/cpp/activemq/ICommand.hpp b/openwire-cpp/src/main/cpp/activemq/ICommand.hpp index cb22b02709..419a94986b 100644 --- a/openwire-cpp/src/main/cpp/activemq/ICommand.hpp +++ b/openwire-cpp/src/main/cpp/activemq/ICommand.hpp @@ -17,17 +17,18 @@ #ifndef ActiveMQ_ICommand_hpp_ #define ActiveMQ_ICommand_hpp_ -#include "activemq/IDataStructure.hpp" +#include "ppr/util/ifr/p" namespace apache { namespace activemq { + using namespace ifr; /* * An OpenWire command */ -struct ICommand : IDataStructure +struct ICommand : Interface { virtual int getCommandId() = 0; virtual void setCommandId(int value) = 0; diff --git a/openwire-cpp/src/main/cpp/activemq/IDataStructure.hpp b/openwire-cpp/src/main/cpp/activemq/IDataStructure.hpp index 3a0bd29597..16bc8fd82b 100644 --- a/openwire-cpp/src/main/cpp/activemq/IDataStructure.hpp +++ b/openwire-cpp/src/main/cpp/activemq/IDataStructure.hpp @@ -39,7 +39,6 @@ namespace apache struct IDataStructure : Interface { virtual unsigned char getDataStructureType() = 0 ; - virtual bool isMarshallAware() = 0 ; virtual int marshal(p marshaller, int mode, p writer) = 0 ; virtual void unmarshal(p marshaller, int mode, p reader) = 0 ; } ; diff --git a/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp b/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp index 50310ae4d3..a0e5e07512 100644 --- a/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp +++ b/openwire-cpp/src/main/cpp/activemq/MessageConsumer.cpp @@ -162,10 +162,11 @@ void MessageConsumer::dispatchAsyncMessages() if( message != NULL ) { - listener->onMessage(message) ; - // Auto acknowledge message if selected autoAcknowledge(message) ; + + // Let listener process message + listener->onMessage(message) ; } else break ; diff --git a/openwire-cpp/src/main/cpp/activemq/Session.cpp b/openwire-cpp/src/main/cpp/activemq/Session.cpp index 8cd6153d67..a301637071 100644 --- a/openwire-cpp/src/main/cpp/activemq/Session.cpp +++ b/openwire-cpp/src/main/cpp/activemq/Session.cpp @@ -421,6 +421,11 @@ void Session::close() map >::iterator consumerIter ; map >::iterator producerIter ; + // Shutdown dispatch thread + dispatchThread->interrupt() ; + dispatchThread->join() ; + dispatchThread = NULL ; + // Iterate through all consumers and close them down for( consumerIter = consumers.begin() ; consumerIter != consumers.end() ; @@ -438,12 +443,13 @@ void Session::close() producerIter->second->close() ; producerIter->second = NULL ; } - // De-register session from broker + // De-register session from broker/connection connection->disposeOf( sessionInfo->getSessionId() ) ; // Clean up connection = NULL ; closed = true ; + } } diff --git a/openwire-cpp/src/main/cpp/activemq/Session.hpp b/openwire-cpp/src/main/cpp/activemq/Session.hpp index f6e3832a7e..a731ef4974 100644 --- a/openwire-cpp/src/main/cpp/activemq/Session.hpp +++ b/openwire-cpp/src/main/cpp/activemq/Session.hpp @@ -134,6 +134,7 @@ public: void interrupt() { interrupted = true ; + wakeup() ; } void wakeup() @@ -144,13 +145,19 @@ public: protected: virtual void run () throw (p) { - while( !interrupted ) + do { // Wait for wake-up call semaphore.wait() ; + if( interrupted ) + break ; + session->dispatchAsyncMessages() ; - } + } while( !interrupted ) ; + + // Clean up (prevent cyclic dependency) + session = NULL ; } } ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.cpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.cpp index 567ea21a49..0d77c78b2d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.cpp @@ -24,8 +24,10 @@ using namespace apache::activemq::command; */ ActiveMQBytesMessage::ActiveMQBytesMessage() { - this->in = NULL ; - this->out = new ByteArrayOutputStream() ; + this->bis = NULL ; + this->bos = new ByteArrayOutputStream() ; + this->dis = NULL ; + this->dos = new DataOutputStream( bos ) ; this->readMode = false ; } @@ -38,8 +40,10 @@ ActiveMQBytesMessage::ActiveMQBytesMessage(char* body, int size) array buffer = array (size) ; memcpy(buffer.c_array(), body, size); - this->in = NULL ; - this->out = new ByteArrayOutputStream(buffer) ; + this->bis = NULL ; + this->bos = new ByteArrayOutputStream(buffer) ; + this->dis = NULL ; + this->dos = new DataOutputStream( bos ) ; this->readMode = false ; } @@ -63,10 +67,20 @@ unsigned char ActiveMQBytesMessage::getDataStructureType() */ void ActiveMQBytesMessage::reset() { - if( !readMode ) + if( readMode ) { - this->in = new ByteArrayInputStream( out->toArray() ) ; - this->out = NULL ; + this->bos = new ByteArrayOutputStream( bis->toArray() ) ; + this->bis = NULL ; + this->dos = new DataOutputStream( bos ) ; + this->dis = NULL ; + this->readMode = false ; + } + else + { + this->bis = new ByteArrayInputStream( bos->toArray() ) ; + this->bos = NULL ; + this->dis = new DataInputStream( bis ) ; + this->dos = NULL ; this->readMode = true ; } } @@ -83,7 +97,7 @@ char ActiveMQBytesMessage::readByte() throw(MessageNotReadableException, Message try { // Read a single byte - return readByte() ; + return dis->readByte() ; } catch( EOFException eof ) { @@ -94,7 +108,7 @@ char ActiveMQBytesMessage::readByte() throw(MessageNotReadableException, Message /* * */ -int ActiveMQBytesMessage::readBytes(char* buffer, int index, int length) throw (MessageNotReadableException, MessageEOFException) +int ActiveMQBytesMessage::readBytes(char* buffer, int offset, int length) throw (MessageNotReadableException, MessageEOFException) { // Assert read mode if( !readMode ) @@ -103,7 +117,7 @@ int ActiveMQBytesMessage::readBytes(char* buffer, int index, int length) throw ( try { // Read some bytes - return in->read(buffer, index, length) ; + return dis->read(buffer, offset, length) ; } catch( EOFException eof ) { @@ -123,7 +137,7 @@ bool ActiveMQBytesMessage::readBoolean() throw(MessageNotReadableException, Mess try { // Read a boolean - return in->readBoolean() ; + return dis->readBoolean() ; } catch( EOFException eof ) { @@ -143,7 +157,7 @@ double ActiveMQBytesMessage::readDouble() throw(MessageNotReadableException, Mes try { // Read a double - return in->readDouble() ; + return dis->readDouble() ; } catch( EOFException eof ) { @@ -163,7 +177,7 @@ float ActiveMQBytesMessage::readFloat() throw(MessageNotReadableException, Messa try { // Read a float - return in->readFloat() ; + return dis->readFloat() ; } catch( EOFException eof ) { @@ -183,7 +197,7 @@ short ActiveMQBytesMessage::readShort() throw(MessageNotReadableException, Messa try { // Read a short - return in->readShort() ; + return dis->readShort() ; } catch( EOFException eof ) { @@ -203,7 +217,7 @@ int ActiveMQBytesMessage::readInt() throw(MessageNotReadableException, MessageEO try { // Read an integer - return in->readInt() ; + return dis->readInt() ; } catch( EOFException eof ) { @@ -223,7 +237,7 @@ long long ActiveMQBytesMessage::readLong() throw(MessageNotReadableException, Me try { // Read a long long - return in->readLong() ; + return dis->readLong() ; } catch( EOFException eof ) { @@ -234,7 +248,7 @@ long long ActiveMQBytesMessage::readLong() throw(MessageNotReadableException, Me /* * */ -p ActiveMQBytesMessage::readUTF() throw(MessageNotReadableException, MessageEOFException) +p ActiveMQBytesMessage::readString() throw(MessageNotReadableException, MessageEOFException) { // Assert read mode if( !readMode ) @@ -243,7 +257,7 @@ p ActiveMQBytesMessage::readUTF() throw(MessageNotReadableException, Mes try { // Read a string - return in->readString() ; + return dis->readString() ; } catch( EOFException eof ) { @@ -261,20 +275,20 @@ void ActiveMQBytesMessage::writeByte(char value) throw (MessageNotWritableExcept throw MessageNotWritableException() ; // Write a single byte - out->writeByte(value) ; + dos->writeByte(value) ; } /* * */ -void ActiveMQBytesMessage::writeBytes(char* value, int index, int length) throw (MessageNotWritableException) +void ActiveMQBytesMessage::writeBytes(char* value, int offset, int length) throw (MessageNotWritableException) { // Assert write mode if( readMode ) throw MessageNotWritableException() ; // Write some bytes - out->write(value, index, length) ; + dos->write(value, offset, length) ; } /* @@ -287,7 +301,7 @@ void ActiveMQBytesMessage::writeBoolean(bool value) throw (MessageNotWritableExc throw MessageNotWritableException() ; // Write a boolean - out->writeBoolean(value) ; + dos->writeBoolean(value) ; } /* @@ -300,7 +314,7 @@ void ActiveMQBytesMessage::writeDouble(double value) throw (MessageNotWritableEx throw MessageNotWritableException() ; // Write a double - out->writeDouble(value) ; + dos->writeDouble(value) ; } /* @@ -313,7 +327,7 @@ void ActiveMQBytesMessage::writeFloat(float value) throw (MessageNotWritableExce throw MessageNotWritableException() ; // Write a float - out->writeFloat(value) ; + dos->writeFloat(value) ; } /* @@ -326,7 +340,7 @@ void ActiveMQBytesMessage::writeInt(int value) throw (MessageNotWritableExceptio throw MessageNotWritableException() ; // Write an integer - out->writeInt(value) ; + dos->writeInt(value) ; } /* @@ -339,7 +353,7 @@ void ActiveMQBytesMessage::writeLong(long long value) throw (MessageNotWritableE throw MessageNotWritableException() ; // Write a long long - out->writeLong(value) ; + dos->writeLong(value) ; } /* @@ -352,13 +366,13 @@ void ActiveMQBytesMessage::writeShort(short value) throw (MessageNotWritableExce throw MessageNotWritableException() ; // Write a short - out->writeShort(value) ; + dos->writeShort(value) ; } /* * */ -void ActiveMQBytesMessage::writeUTF(const char* value) throw (MessageNotWritableException) +void ActiveMQBytesMessage::writeString(const char* value) throw (MessageNotWritableException) { // Assert write mode if( readMode ) @@ -366,22 +380,22 @@ void ActiveMQBytesMessage::writeUTF(const char* value) throw (MessageNotWritable // Write a string p v = new string(value) ; - out->writeString(v) ; + dos->writeString(v) ; } /* * */ -int ActiveMQBytesMessage::marshal(p marshaller, int mode, p writer) throw (IOException) +int ActiveMQBytesMessage::marshal(p marshaller, int mode, p ostream) throw (IOException) { int size = 0 ; // Copy body to message content container if( mode == IMarshaller::MARSHAL_SIZE ) - this->content = ( readMode) ? in->toArray() : out->toArray() ; + this->content = ( readMode) ? bis->toArray() : bos->toArray() ; // size += (int)this->content.size() ; - size += ActiveMQMessage::marshal(marshaller, mode, writer) ; + size += ActiveMQMessage::marshal(marshaller, mode, ostream) ; // Note! Message content marshalling is done in super class @@ -391,16 +405,18 @@ int ActiveMQBytesMessage::marshal(p marshaller, int mode, p marshaller, int mode, p reader) throw (IOException) +void ActiveMQBytesMessage::unmarshal(p marshaller, int mode, p istream) throw (IOException) { // Note! Message content unmarshalling is done in super class - ActiveMQMessage::unmarshal(marshaller, mode, reader) ; + ActiveMQMessage::unmarshal(marshaller, mode, istream) ; // Copy body to message content holder if( mode == IMarshaller::MARSHAL_READ ) { - in = new ByteArrayInputStream( this->content ) ; - out = NULL ; + bis = new ByteArrayInputStream( this->content ) ; + bos = NULL ; + dis = new DataInputStream( bis ) ; + dos = NULL ; readMode = true ; } } diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.hpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.hpp index fcd8385a19..d151e821c8 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQBytesMessage.hpp @@ -30,6 +30,8 @@ #include "activemq/command/ActiveMQMessage.hpp" #include "ppr/io/ByteArrayInputStream.hpp" #include "ppr/io/ByteArrayOutputStream.hpp" +#include "ppr/io/DataInputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" #include "ppr/io/EOFException.hpp" #include "ppr/util/Endian.hpp" #include "ppr/util/MapItemHolder.hpp" @@ -53,9 +55,11 @@ namespace apache class ActiveMQBytesMessage : public ActiveMQMessage , public IBytesMessage { private: - p in ; - p out ; - bool readMode ; + p dis ; + p dos ; + p bis ; + p bos ; + bool readMode ; const static int INITIAL_SIZE = 256 ; const static int EXPAND_SIZE = 128 ; @@ -72,23 +76,23 @@ public: virtual void reset() ; virtual char readByte() throw (MessageNotReadableException, MessageEOFException) ; - virtual int readBytes(char* buffer, int index, int length) throw (MessageNotReadableException, MessageEOFException) ; + virtual int readBytes(char* buffer, int offset, int length) throw (MessageNotReadableException, MessageEOFException) ; virtual bool readBoolean() throw (MessageNotReadableException, MessageEOFException) ; virtual double readDouble() throw (MessageNotReadableException, MessageEOFException) ; virtual float readFloat() throw (MessageNotReadableException, MessageEOFException) ; virtual int readInt() throw (MessageNotReadableException, MessageEOFException) ; virtual long long readLong() throw (MessageNotReadableException, MessageEOFException) ; virtual short readShort() throw (MessageNotReadableException, MessageEOFException) ; - virtual p readUTF() throw (MessageNotReadableException, MessageEOFException) ; + virtual p readString() throw (MessageNotReadableException, MessageEOFException) ; virtual void writeBoolean(bool value) throw (MessageNotWritableException) ; virtual void writeByte(char value) throw (MessageNotWritableException) ; - virtual void writeBytes(char* value, int index, int length) throw (MessageNotWritableException) ; + virtual void writeBytes(char* value, int offset, int length) throw (MessageNotWritableException) ; virtual void writeDouble(double value) throw (MessageNotWritableException) ; virtual void writeFloat(float value) throw (MessageNotWritableException) ; virtual void writeInt(int value) throw (MessageNotWritableException) ; virtual void writeLong(long long value) throw (MessageNotWritableException) ; virtual void writeShort(short value) throw (MessageNotWritableException) ; - virtual void writeUTF(const char* value) throw (MessageNotWritableException) ; + virtual void writeString(const char* value) throw (MessageNotWritableException) ; virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.cpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.cpp index b9291709c2..c75a47e227 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.cpp @@ -347,18 +347,18 @@ p ActiveMQDestination::getClientId(p destination) /* * */ -int ActiveMQDestination::marshal(p marshaller, int mode, p writer) throw (IOException) +int ActiveMQDestination::marshal(p marshaller, int mode, p ostream) throw (IOException) { int size = 0 ; - size += marshaller->marshalString(physicalName, mode, writer) ; + size += marshaller->marshalString(physicalName, mode, ostream) ; return size ; } /* * */ -void ActiveMQDestination::unmarshal(p marshaller, int mode, p reader) throw (IOException) +void ActiveMQDestination::unmarshal(p marshaller, int mode, p istream) throw (IOException) { - physicalName = p_cast(marshaller->unmarshalString(mode, reader)) ; + physicalName = p_cast(marshaller->unmarshalString(mode, istream)) ; } diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.hpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.hpp index 1ac368a87b..07c3c880ca 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQDestination.hpp @@ -23,7 +23,7 @@ #include "cms/IQueue.hpp" #include "cms/ITemporaryTopic.hpp" #include "cms/ITemporaryQueue.hpp" -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/command/BaseCommand.hpp" #include "activemq/protocol/IMarshaller.hpp" #include "ppr/io/IOutputStream.hpp" #include "ppr/io/IInputStream.hpp" @@ -49,7 +49,7 @@ namespace apache /* * */ -class ActiveMQDestination : public AbstractCommand, public IDestination +class ActiveMQDestination : public BaseCommand, public IDestination { private: p orderedTarget, @@ -109,8 +109,8 @@ public: virtual bool isWildcard() ; virtual p toString() ; - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; // // Abstract methods diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp index c02609d62b..3c34c57cf9 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.cpp @@ -15,8 +15,11 @@ * limitations under the License. */ #include "activemq/command/ActiveMQMapMessage.hpp" + #include "ppr/io/ByteArrayOutputStream.hpp" #include "ppr/io/ByteArrayInputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/DataInputStream.hpp" using namespace apache::activemq::command; @@ -411,7 +414,7 @@ p ActiveMQMapMessage::getString(const char* name) throw (MessageFormatEx /* * */ -void ActiveMQMapMessage::setString(const char* name, p value) throw (IllegalArgumentException) +void ActiveMQMapMessage::setString(const char* name, const char* value) throw (IllegalArgumentException) { // Assert arguments if( name == NULL || strcmp(name, "") == 0 ) @@ -455,23 +458,24 @@ bool ActiveMQMapMessage::itemExists(const char* name) /* * */ -int ActiveMQMapMessage::marshal(p marshaller, int mode, p writer) throw (IOException) +int ActiveMQMapMessage::marshal(p marshaller, int mode, p ostream) throw (IOException) { int size = 0 ; - // Update message content + // Update message content during size lookup if( mode == IMarshaller::MARSHAL_SIZE ) { - p arrayWriter = new ByteArrayOutputStream() ; + p bos = new ByteArrayOutputStream() ; + p dos = new DataOutputStream( bos ) ; // Marshal map into a byte array - marshaller->marshalMap(contentMap, mode, arrayWriter) ; + marshaller->marshalMap(contentMap, IMarshaller::MARSHAL_WRITE, dos) ; // Store map byte array in message content - this->content = arrayWriter->toArray() ; + this->content = bos->toArray() ; } // Note! Message content marshalling is done in super class - size += ActiveMQMessage::marshal(marshaller, mode, writer) ; + size += ActiveMQMessage::marshal(marshaller, mode, ostream) ; return size ; } @@ -479,17 +483,18 @@ int ActiveMQMapMessage::marshal(p marshaller, int mode, p marshaller, int mode, p reader) throw (IOException) +void ActiveMQMapMessage::unmarshal(p marshaller, int mode, p istream) throw (IOException) { // Note! Message content unmarshalling is done in super class - ActiveMQMessage::unmarshal(marshaller, mode, reader) ; + ActiveMQMessage::unmarshal(marshaller, mode, istream) ; // Extract map from message content if( mode == IMarshaller::MARSHAL_READ ) { - p arrayReader = new ByteArrayInputStream( this->content ) ; + p bis = new ByteArrayInputStream( this->content ) ; + p dis = new DataInputStream( bis ) ; // Unmarshal map into a map - contentMap = marshaller->unmarshalMap(mode, arrayReader) ; + contentMap = marshaller->unmarshalMap(mode, dis) ; } } diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp index 0d58f8123f..8f65859c6d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMapMessage.hpp @@ -83,12 +83,12 @@ public: virtual short getShort(const char* name) throw (MessageFormatException, IllegalArgumentException) ; virtual void setShort(const char* name, short value) throw (IllegalArgumentException) ; virtual p getString(const char* name) throw (MessageFormatException, IllegalArgumentException) ; - virtual void setString(const char* name, p value) throw (IllegalArgumentException) ; + virtual void setString(const char* name, const char* value) throw (IllegalArgumentException) ; virtual array getMapNames() ; virtual bool itemExists(const char* name) ; - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; // // The methods below are needed to resolve the multiple diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp index f264951368..32222923d3 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.cpp @@ -15,8 +15,11 @@ * limitations under the License. */ #include "activemq/command/ActiveMQMessage.hpp" + #include "ppr/io/ByteArrayOutputStream.hpp" #include "ppr/io/ByteArrayInputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/DataInputStream.hpp" using namespace apache::activemq::command; @@ -320,23 +323,24 @@ void ActiveMQMessage::acknowledge() /* * */ -int ActiveMQMessage::marshal(p marshaller, int mode, p writer) throw(IOException) +int ActiveMQMessage::marshal(p marshaller, int mode, p ostream) throw(IOException) { int size = 0 ; // Update message content if available if( mode == IMarshaller::MARSHAL_SIZE && this->properties != NULL ) { - p arrayWriter = new ByteArrayOutputStream() ; + p bos = new ByteArrayOutputStream() ; + p dos = new DataOutputStream( bos ) ; // Marshal properties into a byte array - marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, arrayWriter) ; + marshaller->marshalMap(properties, IMarshaller::MARSHAL_WRITE, dos) ; // Store properties byte array in message content - this->marshalledProperties = arrayWriter->toArray() ; + this->marshalledProperties = bos->toArray() ; } // Note! Message propertys marshalling is done in super class - size += Message::marshal(marshaller, mode, writer) ; + size += Message::marshal(marshaller, mode, ostream) ; return size ; } @@ -344,31 +348,21 @@ int ActiveMQMessage::marshal(p marshaller, int mode, p marshaller, int mode, p reader) throw(IOException) +void ActiveMQMessage::unmarshal(p marshaller, int mode, p istream) throw(IOException) { // Note! Message property unmarshalling is done in super class - Message::unmarshal(marshaller, mode, reader) ; + Message::unmarshal(marshaller, mode, istream) ; // Extract properties from message if( mode == IMarshaller::MARSHAL_READ ) { if( this->marshalledProperties != NULL ) { - p arrayReader = new ByteArrayInputStream( this->marshalledProperties ) ; + p bis = new ByteArrayInputStream( this->marshalledProperties ) ; + p dis = new DataInputStream( bis ) ; // Unmarshal map into a map - properties = marshaller->unmarshalMap(mode, arrayReader) ; + properties = marshaller->unmarshalMap(mode, dis) ; } } } - - -// Static methods --------------------------------------------------- - -/* - * - */ -/*p ActiveMQMessage::transform(p message) -{ - return p_cast (message) ; -}*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp index 4d8ec2e220..cdf3cc2a5a 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQMessage.hpp @@ -88,12 +88,8 @@ public: protected: // Implementation - int marshal(p marshaller, int mode, p writer) throw(IOException) ; - void unmarshal(p marshaller, int mode, p reader) throw(IOException) ; - -public: - // Static methods - //static p transform(p message) ; + int marshal(p marshaller, int mode, p ostream) throw(IOException) ; + void unmarshal(p marshaller, int mode, p istream) throw(IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp index 394a5c727d..75c4bac901 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.cpp @@ -23,6 +23,7 @@ using namespace apache::activemq::command; */ ActiveMQTextMessage::ActiveMQTextMessage() { + encoder = CharsetEncoderRegistry::getEncoder() ; setText(NULL) ; } @@ -31,6 +32,16 @@ ActiveMQTextMessage::ActiveMQTextMessage() */ ActiveMQTextMessage::ActiveMQTextMessage(const char* text) { + encoder = CharsetEncoderRegistry::getEncoder() ; + setText(text) ; +} + +/* + * + */ +ActiveMQTextMessage::ActiveMQTextMessage(const char* text, const char* encname) +{ + encoder = CharsetEncoderRegistry::getEncoder(encname) ; setText(text) ; } @@ -57,17 +68,16 @@ p ActiveMQTextMessage::getText() // Extract text from message content if( this->content.size() > 0 ) { - int utflen = 0 ; - char* buffer = this->content.c_array() ; + p value ; - // TODO: assuming that the text is ASCII - utflen |= (char) ((buffer[0] << 24) & 0xFF) ; - utflen |= (char) ((buffer[1] >> 16) & 0xFF); - utflen |= (char) ((buffer[2] >> 8) & 0xFF); - utflen |= (char) ((buffer[3] >> 0) & 0xFF); + // Use undecoded string, skip string length + value = new string( this->content.c_array() + sizeof(int), this->content.size() - sizeof(int) ) ; - p text = new string( buffer + 4, this->content.size() - 4 ) ; - return text ; + // Decode string if an encoder has been set up + if( encoder != NULL ) + value = encoder->decode( value ) ; + + return value ; } return NULL ; } @@ -79,19 +89,32 @@ void ActiveMQTextMessage::setText(const char* text) { if( text != NULL ) { - int length = (int)strlen(text) ; - int utflen = length ; + p dos ; + p bos ; + p value ; + int length ; - // TODO: assuming that the text is ASCII - this->content = array (length + 4) ; + // Set up in-memory streams + bos = new ByteArrayOutputStream() ; + dos = new DataOutputStream( bos ) ; - this->content[0] = (char) ((utflen >> 24) & 0xFF) ; - this->content[1] = (char) ((utflen >> 16) & 0xFF); - this->content[2] = (char) ((utflen >> 8) & 0xFF); - this->content[3] = (char) ((utflen >> 0) & 0xFF); + // Encode string if an encoder has been set up + if( encoder != NULL ) + { + // Encode string + value = encoder->encode( p (new string(text)), &length) ; + } + else // ...use unencoded string + { + length = (int)strlen(text) ; + value = new string(text) ; + } + // Prepend data with the string length (4 bytes) + dos->writeInt( length ) ; + dos->write( value->c_str(), 0, length ) ; - for( int i = 0 ; i < length ; i++ ) - this->content[4+i] = text[i] ; + // Finally, store text in content holder + this->content = bos->toArray() ; } else this->content = NULL ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.hpp b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.hpp index 73cc281307..1f53f84d5c 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ActiveMQTextMessage.hpp @@ -20,6 +20,10 @@ #include #include "cms/ITextMessage.hpp" #include "activemq/command/ActiveMQMessage.hpp" +#include "ppr/io/ByteArrayOutputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/encoding/ICharsetEncoder.hpp" +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" #include "ppr/util/MapItemHolder.hpp" #include "ppr/util/ifr/p" @@ -31,6 +35,8 @@ namespace apache { using namespace ifr; using namespace apache::cms; + using namespace apache::ppr::io; + using namespace apache::ppr::io::encoding; using namespace apache::ppr::util; /* @@ -38,12 +44,16 @@ namespace apache */ class ActiveMQTextMessage : public ActiveMQMessage, public ITextMessage { +private: + p encoder ; + public: const static unsigned char TYPE = 28 ; public: ActiveMQTextMessage() ; ActiveMQTextMessage(const char* text) ; + ActiveMQTextMessage(const char* text, const char* encname) ; virtual ~ActiveMQTextMessage() ; virtual unsigned char getDataStructureType() ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp index 5c6dd10426..17a592b3b2 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.cpp @@ -21,17 +21,77 @@ using namespace apache::activemq::command; // Attribute methods ------------------------------------------------ +/* + * + */ +int BaseCommand::getCommandId() +{ + return commandId ; +} + +/* + * + */ +void BaseCommand::setCommandId(int id) +{ + commandId = id ; +} + +/* + * + */ +bool BaseCommand::getResponseRequired() +{ + return responseRequired ; +} + +/* + * + */ +void BaseCommand::setResponseRequired(bool value) +{ + responseRequired = value ; +} + +/* + * + */ int BaseCommand::getHashCode() { - return ( commandId * 38 ) + getDataStructureType() ; + return ( commandId * 38 ) + BaseDataStructure::getDataStructureType() ; } // Operation methods ------------------------------------------------ +/* + * + */ +int BaseCommand::marshal(p marshaller, int mode, p ostream) throw(IOException) +{ + int size = 0 ; + + size += marshaller->marshalInt(commandId, mode, ostream) ; + size += marshaller->marshalBoolean(responseRequired, mode, ostream) ; + + return size ; +} + +/* + * + */ +void BaseCommand::unmarshal(p marshaller, int mode, p istream) throw(IOException) +{ + commandId = marshaller->unmarshalInt(mode, istream) ; + responseRequired = marshaller->unmarshalBoolean(mode, istream) ; +} + +/* + * + */ bool BaseCommand::operator== (BaseCommand& that) { - if( this->getDataStructureType() == that.getDataStructureType() && + if( BaseDataStructure::getDataStructureType() == ((BaseDataStructure)that).getDataStructureType() && this->commandId == that.commandId ) { return true ; @@ -39,12 +99,15 @@ bool BaseCommand::operator== (BaseCommand& that) return false ; } +/* + * + */ p BaseCommand::toString() { p str = new string() ; char buffer[10] ; - str->assign( getDataStructureTypeAsString( getDataStructureType() )->c_str() ) ; + str->assign( BaseDataStructure::getDataStructureTypeAsString( BaseDataStructure::getDataStructureType() )->c_str() ) ; if( str->length() == 0 ) str->assign("") ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.hpp index 99144a7597..4eb1c1c449 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BaseCommand.hpp @@ -18,7 +18,12 @@ #define ActiveMQ_BaseCommand_hpp_ #include -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/ICommand.hpp" +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" #include "ppr/util/ifr/p" namespace apache @@ -29,13 +34,28 @@ namespace apache { using namespace ifr; using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; /* * */ -class BaseCommand : public AbstractCommand +class BaseCommand : public BaseDataStructure, public ICommand { +protected: + int commandId ; + bool responseRequired ; + public: + virtual int getCommandId() ; + virtual void setCommandId(int id) ; + virtual bool getResponseRequired() ; + virtual void setResponseRequired(bool value) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw(IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw(IOException) ; + // Equals operator bool operator== (BaseCommand& other) ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.cpp similarity index 80% rename from openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.cpp rename to openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.cpp index 6a442a4b12..2f4c91ca46 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.cpp @@ -15,7 +15,8 @@ * limitations under the License. */ #include -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/command/BaseDataStructure.hpp" + #include "activemq/command/ActiveMQMessage.hpp" #include "activemq/command/ActiveMQBytesMessage.hpp" #include "activemq/command/ActiveMQMapMessage.hpp" @@ -23,6 +24,11 @@ #include "activemq/command/ActiveMQStreamMessage.hpp" #include "activemq/command/ActiveMQTextMessage.hpp" #include "activemq/command/ActiveMQQueue.hpp" +#include "activemq/command/ActiveMQTopic.hpp" +#include "activemq/command/ActiveMQTempQueue.hpp" +#include "activemq/command/ActiveMQTempTopic.hpp" +#include "activemq/command/ExceptionResponse.hpp" +#include "activemq/command/ConnectionId.hpp" #include "activemq/command/ConsumerId.hpp" #include "activemq/command/ProducerId.hpp" #include "activemq/command/MessageId.hpp" @@ -49,39 +55,7 @@ using namespace apache::activemq::command; /* * */ -int AbstractCommand::getCommandId() -{ - return commandId ; -} - -/* - * - */ -void AbstractCommand::setCommandId(int id) -{ - commandId = id ; -} - -/* - * - */ -bool AbstractCommand::getResponseRequired() -{ - return responseRequired ; -} - -/* - * - */ -void AbstractCommand::setResponseRequired(bool value) -{ - responseRequired = value ; -} - -/* - * - */ -unsigned char AbstractCommand::getDataStructureType() +unsigned char BaseDataStructure::getDataStructureType() { return 0 ; } @@ -89,15 +63,7 @@ unsigned char AbstractCommand::getDataStructureType() /* * */ -bool AbstractCommand::isMarshallAware() -{ - return false ; -} - -/* - * - */ -int AbstractCommand::marshal(p marshaller, int mode, p writer) throw(IOException) +int BaseDataStructure::marshal(p marshaller, int mode, p ostream) throw(IOException) { return 0 ; } @@ -105,15 +71,15 @@ int AbstractCommand::marshal(p marshaller, int mode, p marshaller, int mode, p reader) throw(IOException) +void BaseDataStructure::unmarshal(p marshaller, int mode, p istream) throw(IOException) { } /* * */ -p AbstractCommand::createObject(unsigned char type) - { +p BaseDataStructure::createObject(unsigned char type) +{ switch( type ) { case ActiveMQMessage::TYPE: @@ -130,6 +96,16 @@ p AbstractCommand::createObject(unsigned char type) return new ActiveMQMapMessage() ; case ActiveMQQueue::TYPE: return new ActiveMQQueue() ; + case ActiveMQTopic::TYPE: + return new ActiveMQTopic() ; + case ActiveMQTempQueue::TYPE: + return new ActiveMQTempQueue() ; + case ActiveMQTempTopic::TYPE: + return new ActiveMQTempTopic() ; + case ExceptionResponse::TYPE: + return new ExceptionResponse() ; + case ConnectionId::TYPE: + return new ConnectionId() ; case ConsumerId::TYPE: return new ConsumerId() ; case ProducerId::TYPE: @@ -178,7 +154,7 @@ p AbstractCommand::createObject(unsigned char type) /* * */ -p AbstractCommand::getDataStructureTypeAsString(unsigned char type) +p BaseDataStructure::getDataStructureTypeAsString(unsigned char type) { p packetType = new string() ; @@ -205,6 +181,12 @@ p AbstractCommand::getDataStructureTypeAsString(unsigned char type) case ActiveMQQueue::TYPE: packetType->assign("ACTIVEMQ_QUEUE") ; break ; + case ActiveMQTopic::TYPE: + packetType->assign("ACTIVEMQ_TOPIC") ; + break ; + case ConnectionId::TYPE: + packetType->assign("CONNECTION_ID") ; + break ; case ConsumerId::TYPE: packetType->assign("CONSUMER_ID") ; break ; @@ -226,6 +208,9 @@ p AbstractCommand::getDataStructureTypeAsString(unsigned char type) case Response::TYPE: packetType->assign("RESPONSE") ; break ; + case ExceptionResponse::TYPE: + packetType->assign("EXCEPTION_RESPONSE") ; + break ; case ConsumerInfo::TYPE: packetType->assign("CONSUMER_INFO") ; break ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.hpp similarity index 67% rename from openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.hpp rename to openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.hpp index 8d28b92d92..b44c57357f 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/AbstractCommand.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BaseDataStructure.hpp @@ -14,11 +14,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef ActiveMQ_AbstractCommand_hpp_ -#define ActiveMQ_AbstractCommand_hpp_ +#ifndef ActiveMQ_BaseDataStructure_hpp_ +#define ActiveMQ_BaseDataStructure_hpp_ #include -#include "activemq/ICommand.hpp" #include "activemq/IDataStructure.hpp" #include "ppr/io/IOutputStream.hpp" #include "ppr/io/IInputStream.hpp" @@ -39,24 +38,16 @@ namespace apache /* * */ -class AbstractCommand : public ICommand +class BaseDataStructure : public IDataStructure { protected: - int commandId ; - bool responseRequired ; + BaseDataStructure() { } ; -protected: - AbstractCommand() : commandId (0), responseRequired (false) {} public: - virtual int getCommandId() ; - virtual void setCommandId(int id) ; - virtual bool getResponseRequired() ; - virtual void setResponseRequired(bool value) ; virtual unsigned char getDataStructureType() ; - virtual bool isMarshallAware() ; - virtual int marshal(p marshaller, int mode, p writer) throw(IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw(IOException) ; + virtual int marshal(p marshaller, int mode, p ostream) throw(IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw(IOException) ; static p createObject(unsigned char type) ; static p getDataStructureTypeAsString(unsigned char type) ; @@ -67,4 +58,4 @@ public: } } -#endif /*ActiveMQ_AbstractCommand_hpp_*/ +#endif /*ActiveMQ_BaseDataStructure_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/BrokerError.hpp b/openwire-cpp/src/main/cpp/activemq/command/BrokerError.hpp index 3a7d8fae8e..b3444252ff 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BrokerError.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BrokerError.hpp @@ -20,7 +20,7 @@ #include #include #include -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/command/BaseCommand.hpp" #include "ppr/util/ifr/array" #include "ppr/util/ifr/p" @@ -47,7 +47,7 @@ struct StackTraceElement /* * Represents an exception on the broker. */ -class BrokerError : public AbstractCommand +class BrokerError : public BaseCommand { private: p message ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/BrokerId.cpp b/openwire-cpp/src/main/cpp/activemq/command/BrokerId.cpp index 3610f84e00..f56dbcefb3 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BrokerId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BrokerId.cpp @@ -1,67 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/BrokerId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for BrokerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -BrokerId::BrokerId() -{ - this->value = NULL ; -} - -BrokerId::~BrokerId() -{ -} - -unsigned char BrokerId::getDataStructureType() -{ - return BrokerId::TYPE ; -} - - -p BrokerId::getValue() -{ - return value ; -} - -void BrokerId::setValue(p value) -{ - this->value = value ; -} - -int BrokerId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalString(value, mode, writer) ; - return size ; -} - -void BrokerId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - value = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/BrokerId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for BrokerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +BrokerId::BrokerId() +{ + this->value = NULL ; +} + +BrokerId::~BrokerId() +{ +} + +unsigned char BrokerId::getDataStructureType() +{ + return BrokerId::TYPE ; +} + + +p BrokerId::getValue() +{ + return value ; +} + +void BrokerId::setValue(p value) +{ + this->value = value ; +} + +int BrokerId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(value, mode, ostream) ; + return size ; +} + +void BrokerId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + value = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/BrokerId.hpp b/openwire-cpp/src/main/cpp/activemq/command/BrokerId.hpp index 3cb6f1437d..4d8511aad4 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BrokerId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BrokerId.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_BrokerId_hpp_ -#define ActiveMQ_BrokerId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for BrokerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class BrokerId : public AbstractCommand -{ -protected: - p value ; - -public: - const static unsigned char TYPE = 124; - -public: - BrokerId() ; - virtual ~BrokerId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getValue() ; - virtual void setValue(p value) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_BrokerId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_BrokerId_hpp_ +#define ActiveMQ_BrokerId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for BrokerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class BrokerId : public BaseDataStructure +{ +protected: + p value ; + +public: + const static unsigned char TYPE = 124; + +public: + BrokerId() ; + virtual ~BrokerId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getValue() ; + virtual void setValue(p value) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_BrokerId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.cpp index 11631a6ae1..0a3c5da948 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.cpp @@ -1,127 +1,153 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/BrokerInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for BrokerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -BrokerInfo::BrokerInfo() -{ - this->brokerId = NULL ; - this->brokerURL = NULL ; - this->peerBrokerInfos = NULL ; - this->brokerName = NULL ; - this->slaveBroker = false ; -} - -BrokerInfo::~BrokerInfo() -{ -} - -unsigned char BrokerInfo::getDataStructureType() -{ - return BrokerInfo::TYPE ; -} - - -p BrokerInfo::getBrokerId() -{ - return brokerId ; -} - -void BrokerInfo::setBrokerId(p brokerId) -{ - this->brokerId = brokerId ; -} - - -p BrokerInfo::getBrokerURL() -{ - return brokerURL ; -} - -void BrokerInfo::setBrokerURL(p brokerURL) -{ - this->brokerURL = brokerURL ; -} - - -array BrokerInfo::getPeerBrokerInfos() -{ - return peerBrokerInfos ; -} - -void BrokerInfo::setPeerBrokerInfos(array peerBrokerInfos) -{ - this->peerBrokerInfos = peerBrokerInfos ; -} - - -p BrokerInfo::getBrokerName() -{ - return brokerName ; -} - -void BrokerInfo::setBrokerName(p brokerName) -{ - this->brokerName = brokerName ; -} - - -bool BrokerInfo::getSlaveBroker() -{ - return slaveBroker ; -} - -void BrokerInfo::setSlaveBroker(bool slaveBroker) -{ - this->slaveBroker = slaveBroker ; -} - -int BrokerInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(brokerId, mode, writer) ; - size += marshaller->marshalString(brokerURL, mode, writer) ; - size += marshaller->marshalObjectArray(peerBrokerInfos, mode, writer) ; - size += marshaller->marshalString(brokerName, mode, writer) ; - size += marshaller->marshalBoolean(slaveBroker, mode, writer) ; - return size ; -} - -void BrokerInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - brokerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - brokerURL = p_cast(marshaller->unmarshalString(mode, reader)) ; - peerBrokerInfos = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; - brokerName = p_cast(marshaller->unmarshalString(mode, reader)) ; - slaveBroker = (marshaller->unmarshalBoolean(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/BrokerInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for BrokerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +BrokerInfo::BrokerInfo() +{ + this->brokerId = NULL ; + this->brokerURL = NULL ; + this->peerBrokerInfos = NULL ; + this->brokerName = NULL ; + this->slaveBroker = false ; + this->masterBroker = false ; + this->faultTolerantConfiguration = false ; +} + +BrokerInfo::~BrokerInfo() +{ +} + +unsigned char BrokerInfo::getDataStructureType() +{ + return BrokerInfo::TYPE ; +} + + +p BrokerInfo::getBrokerId() +{ + return brokerId ; +} + +void BrokerInfo::setBrokerId(p brokerId) +{ + this->brokerId = brokerId ; +} + + +p BrokerInfo::getBrokerURL() +{ + return brokerURL ; +} + +void BrokerInfo::setBrokerURL(p brokerURL) +{ + this->brokerURL = brokerURL ; +} + + +array BrokerInfo::getPeerBrokerInfos() +{ + return peerBrokerInfos ; +} + +void BrokerInfo::setPeerBrokerInfos(array peerBrokerInfos) +{ + this->peerBrokerInfos = peerBrokerInfos ; +} + + +p BrokerInfo::getBrokerName() +{ + return brokerName ; +} + +void BrokerInfo::setBrokerName(p brokerName) +{ + this->brokerName = brokerName ; +} + + +bool BrokerInfo::getSlaveBroker() +{ + return slaveBroker ; +} + +void BrokerInfo::setSlaveBroker(bool slaveBroker) +{ + this->slaveBroker = slaveBroker ; +} + + +bool BrokerInfo::getMasterBroker() +{ + return masterBroker ; +} + +void BrokerInfo::setMasterBroker(bool masterBroker) +{ + this->masterBroker = masterBroker ; +} + + +bool BrokerInfo::getFaultTolerantConfiguration() +{ + return faultTolerantConfiguration ; +} + +void BrokerInfo::setFaultTolerantConfiguration(bool faultTolerantConfiguration) +{ + this->faultTolerantConfiguration = faultTolerantConfiguration ; +} + +int BrokerInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(brokerId, mode, ostream) ; + size += marshaller->marshalString(brokerURL, mode, ostream) ; + size += marshaller->marshalObjectArray(peerBrokerInfos, mode, ostream) ; + size += marshaller->marshalString(brokerName, mode, ostream) ; + size += marshaller->marshalBoolean(slaveBroker, mode, ostream) ; + size += marshaller->marshalBoolean(masterBroker, mode, ostream) ; + size += marshaller->marshalBoolean(faultTolerantConfiguration, mode, ostream) ; + return size ; +} + +void BrokerInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + brokerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + brokerURL = p_cast(marshaller->unmarshalString(mode, istream)) ; + peerBrokerInfos = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; + brokerName = p_cast(marshaller->unmarshalString(mode, istream)) ; + slaveBroker = (marshaller->unmarshalBoolean(mode, istream)) ; + masterBroker = (marshaller->unmarshalBoolean(mode, istream)) ; + faultTolerantConfiguration = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.hpp index 32feec1e49..8223f0450d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/BrokerInfo.hpp @@ -1,100 +1,109 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_BrokerInfo_hpp_ -#define ActiveMQ_BrokerInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/command/BrokerInfo.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for BrokerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class BrokerInfo : public BaseCommand -{ -protected: - p brokerId ; - p brokerURL ; - array peerBrokerInfos ; - p brokerName ; - bool slaveBroker ; - -public: - const static unsigned char TYPE = 2; - -public: - BrokerInfo() ; - virtual ~BrokerInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getBrokerId() ; - virtual void setBrokerId(p brokerId) ; - - virtual p getBrokerURL() ; - virtual void setBrokerURL(p brokerURL) ; - - virtual array getPeerBrokerInfos() ; - virtual void setPeerBrokerInfos(array peerBrokerInfos) ; - - virtual p getBrokerName() ; - virtual void setBrokerName(p brokerName) ; - - virtual bool getSlaveBroker() ; - virtual void setSlaveBroker(bool slaveBroker) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_BrokerInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_BrokerInfo_hpp_ +#define ActiveMQ_BrokerInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/BrokerId.hpp" +#include "activemq/command/BrokerInfo.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for BrokerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class BrokerInfo : public BaseCommand +{ +protected: + p brokerId ; + p brokerURL ; + array peerBrokerInfos ; + p brokerName ; + bool slaveBroker ; + bool masterBroker ; + bool faultTolerantConfiguration ; + +public: + const static unsigned char TYPE = 2; + +public: + BrokerInfo() ; + virtual ~BrokerInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getBrokerId() ; + virtual void setBrokerId(p brokerId) ; + + virtual p getBrokerURL() ; + virtual void setBrokerURL(p brokerURL) ; + + virtual array getPeerBrokerInfos() ; + virtual void setPeerBrokerInfos(array peerBrokerInfos) ; + + virtual p getBrokerName() ; + virtual void setBrokerName(p brokerName) ; + + virtual bool getSlaveBroker() ; + virtual void setSlaveBroker(bool slaveBroker) ; + + virtual bool getMasterBroker() ; + virtual void setMasterBroker(bool masterBroker) ; + + virtual bool getFaultTolerantConfiguration() ; + virtual void setFaultTolerantConfiguration(bool faultTolerantConfiguration) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_BrokerInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.cpp new file mode 100644 index 0000000000..3a5551c188 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.cpp @@ -0,0 +1,125 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConnectionControl.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionControl + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConnectionControl::ConnectionControl() +{ + this->close = false ; + this->exit = false ; + this->faultTolerant = false ; + this->resume = false ; + this->suspend = false ; +} + +ConnectionControl::~ConnectionControl() +{ +} + +unsigned char ConnectionControl::getDataStructureType() +{ + return ConnectionControl::TYPE ; +} + + +bool ConnectionControl::getClose() +{ + return close ; +} + +void ConnectionControl::setClose(bool close) +{ + this->close = close ; +} + + +bool ConnectionControl::getExit() +{ + return exit ; +} + +void ConnectionControl::setExit(bool exit) +{ + this->exit = exit ; +} + + +bool ConnectionControl::getFaultTolerant() +{ + return faultTolerant ; +} + +void ConnectionControl::setFaultTolerant(bool faultTolerant) +{ + this->faultTolerant = faultTolerant ; +} + + +bool ConnectionControl::getResume() +{ + return resume ; +} + +void ConnectionControl::setResume(bool resume) +{ + this->resume = resume ; +} + + +bool ConnectionControl::getSuspend() +{ + return suspend ; +} + +void ConnectionControl::setSuspend(bool suspend) +{ + this->suspend = suspend ; +} + +int ConnectionControl::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalBoolean(close, mode, ostream) ; + size += marshaller->marshalBoolean(exit, mode, ostream) ; + size += marshaller->marshalBoolean(faultTolerant, mode, ostream) ; + size += marshaller->marshalBoolean(resume, mode, ostream) ; + size += marshaller->marshalBoolean(suspend, mode, ostream) ; + return size ; +} + +void ConnectionControl::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + close = (marshaller->unmarshalBoolean(mode, istream)) ; + exit = (marshaller->unmarshalBoolean(mode, istream)) ; + faultTolerant = (marshaller->unmarshalBoolean(mode, istream)) ; + resume = (marshaller->unmarshalBoolean(mode, istream)) ; + suspend = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.hpp new file mode 100644 index 0000000000..ef40a56392 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionControl.hpp @@ -0,0 +1,99 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConnectionControl_hpp_ +#define ActiveMQ_ConnectionControl_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionControl + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConnectionControl : public BaseCommand +{ +protected: + bool close ; + bool exit ; + bool faultTolerant ; + bool resume ; + bool suspend ; + +public: + const static unsigned char TYPE = 18; + +public: + ConnectionControl() ; + virtual ~ConnectionControl() ; + + virtual unsigned char getDataStructureType() ; + + virtual bool getClose() ; + virtual void setClose(bool close) ; + + virtual bool getExit() ; + virtual void setExit(bool exit) ; + + virtual bool getFaultTolerant() ; + virtual void setFaultTolerant(bool faultTolerant) ; + + virtual bool getResume() ; + virtual void setResume(bool resume) ; + + virtual bool getSuspend() ; + virtual void setSuspend(bool suspend) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConnectionControl_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.cpp index 887d4faa30..968da9bbf3 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.cpp @@ -1,85 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ConnectionError.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ConnectionError - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ConnectionError::ConnectionError() -{ - this->exception = NULL ; - this->connectionId = NULL ; -} - -ConnectionError::~ConnectionError() -{ -} - -unsigned char ConnectionError::getDataStructureType() -{ - return ConnectionError::TYPE ; -} - - -p ConnectionError::getException() -{ - return exception ; -} - -void ConnectionError::setException(p exception) -{ - this->exception = exception ; -} - - -p ConnectionError::getConnectionId() -{ - return connectionId ; -} - -void ConnectionError::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - -int ConnectionError::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(exception, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - return size ; -} - -void ConnectionError::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - exception = p_cast(marshaller->unmarshalObject(mode, reader)) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConnectionError.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionError + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConnectionError::ConnectionError() +{ + this->exception = NULL ; + this->connectionId = NULL ; +} + +ConnectionError::~ConnectionError() +{ +} + +unsigned char ConnectionError::getDataStructureType() +{ + return ConnectionError::TYPE ; +} + + +p ConnectionError::getException() +{ + return exception ; +} + +void ConnectionError::setException(p exception) +{ + this->exception = exception ; +} + + +p ConnectionError::getConnectionId() +{ + return connectionId ; +} + +void ConnectionError::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + +int ConnectionError::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(exception, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + return size ; +} + +void ConnectionError::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + exception = p_cast(marshaller->unmarshalObject(mode, istream)) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.hpp index 57be855505..9719f4624c 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionError.hpp @@ -1,88 +1,89 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ConnectionError_hpp_ -#define ActiveMQ_ConnectionError_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/BrokerError.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ConnectionError - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ConnectionError : public BaseCommand -{ -protected: - p exception ; - p connectionId ; - -public: - const static unsigned char TYPE = 16; - -public: - ConnectionError() ; - virtual ~ConnectionError() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getException() ; - virtual void setException(p exception) ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ConnectionError_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConnectionError_hpp_ +#define ActiveMQ_ConnectionError_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/BrokerError.hpp" +#include "activemq/command/ConnectionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionError + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConnectionError : public BaseCommand +{ +protected: + p exception ; + p connectionId ; + +public: + const static unsigned char TYPE = 16; + +public: + ConnectionError() ; + virtual ~ConnectionError() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getException() ; + virtual void setException(p exception) ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConnectionError_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.cpp index bd62f71729..3c30ac8858 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.cpp @@ -1,67 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ConnectionId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ConnectionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ConnectionId::ConnectionId() -{ - this->value = NULL ; -} - -ConnectionId::~ConnectionId() -{ -} - -unsigned char ConnectionId::getDataStructureType() -{ - return ConnectionId::TYPE ; -} - - -p ConnectionId::getValue() -{ - return value ; -} - -void ConnectionId::setValue(p value) -{ - this->value = value ; -} - -int ConnectionId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalString(value, mode, writer) ; - return size ; -} - -void ConnectionId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - value = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConnectionId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConnectionId::ConnectionId() +{ + this->value = NULL ; +} + +ConnectionId::~ConnectionId() +{ +} + +unsigned char ConnectionId::getDataStructureType() +{ + return ConnectionId::TYPE ; +} + + +p ConnectionId::getValue() +{ + return value ; +} + +void ConnectionId::setValue(p value) +{ + this->value = value ; +} + +int ConnectionId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(value, mode, ostream) ; + return size ; +} + +void ConnectionId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + value = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.hpp index e4d49da011..3ead02ee0f 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionId.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ConnectionId_hpp_ -#define ActiveMQ_ConnectionId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ConnectionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ConnectionId : public AbstractCommand -{ -protected: - p value ; - -public: - const static unsigned char TYPE = 120; - -public: - ConnectionId() ; - virtual ~ConnectionId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getValue() ; - virtual void setValue(p value) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ConnectionId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConnectionId_hpp_ +#define ActiveMQ_ConnectionId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConnectionId : public BaseDataStructure +{ +protected: + p value ; + +public: + const static unsigned char TYPE = 120; + +public: + ConnectionId() ; + virtual ~ConnectionId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getValue() ; + virtual void setValue(p value) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConnectionId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.cpp index b03c263753..61c427669c 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.cpp @@ -1,127 +1,153 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ConnectionInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ConnectionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ConnectionInfo::ConnectionInfo() -{ - this->connectionId = NULL ; - this->clientId = NULL ; - this->password = NULL ; - this->userName = NULL ; - this->brokerPath = NULL ; -} - -ConnectionInfo::~ConnectionInfo() -{ -} - -unsigned char ConnectionInfo::getDataStructureType() -{ - return ConnectionInfo::TYPE ; -} - - -p ConnectionInfo::getConnectionId() -{ - return connectionId ; -} - -void ConnectionInfo::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -p ConnectionInfo::getClientId() -{ - return clientId ; -} - -void ConnectionInfo::setClientId(p clientId) -{ - this->clientId = clientId ; -} - - -p ConnectionInfo::getPassword() -{ - return password ; -} - -void ConnectionInfo::setPassword(p password) -{ - this->password = password ; -} - - -p ConnectionInfo::getUserName() -{ - return userName ; -} - -void ConnectionInfo::setUserName(p userName) -{ - this->userName = userName ; -} - - -array ConnectionInfo::getBrokerPath() -{ - return brokerPath ; -} - -void ConnectionInfo::setBrokerPath(array brokerPath) -{ - this->brokerPath = brokerPath ; -} - -int ConnectionInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - size += marshaller->marshalString(clientId, mode, writer) ; - size += marshaller->marshalString(password, mode, writer) ; - size += marshaller->marshalString(userName, mode, writer) ; - size += marshaller->marshalObjectArray(brokerPath, mode, writer) ; - return size ; -} - -void ConnectionInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - clientId = p_cast(marshaller->unmarshalString(mode, reader)) ; - password = p_cast(marshaller->unmarshalString(mode, reader)) ; - userName = p_cast(marshaller->unmarshalString(mode, reader)) ; - brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConnectionInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConnectionInfo::ConnectionInfo() +{ + this->connectionId = NULL ; + this->clientId = NULL ; + this->password = NULL ; + this->userName = NULL ; + this->brokerPath = NULL ; + this->brokerMasterConnector = false ; + this->manageable = false ; +} + +ConnectionInfo::~ConnectionInfo() +{ +} + +unsigned char ConnectionInfo::getDataStructureType() +{ + return ConnectionInfo::TYPE ; +} + + +p ConnectionInfo::getConnectionId() +{ + return connectionId ; +} + +void ConnectionInfo::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +p ConnectionInfo::getClientId() +{ + return clientId ; +} + +void ConnectionInfo::setClientId(p clientId) +{ + this->clientId = clientId ; +} + + +p ConnectionInfo::getPassword() +{ + return password ; +} + +void ConnectionInfo::setPassword(p password) +{ + this->password = password ; +} + + +p ConnectionInfo::getUserName() +{ + return userName ; +} + +void ConnectionInfo::setUserName(p userName) +{ + this->userName = userName ; +} + + +array ConnectionInfo::getBrokerPath() +{ + return brokerPath ; +} + +void ConnectionInfo::setBrokerPath(array brokerPath) +{ + this->brokerPath = brokerPath ; +} + + +bool ConnectionInfo::getBrokerMasterConnector() +{ + return brokerMasterConnector ; +} + +void ConnectionInfo::setBrokerMasterConnector(bool brokerMasterConnector) +{ + this->brokerMasterConnector = brokerMasterConnector ; +} + + +bool ConnectionInfo::getManageable() +{ + return manageable ; +} + +void ConnectionInfo::setManageable(bool manageable) +{ + this->manageable = manageable ; +} + +int ConnectionInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + size += marshaller->marshalString(clientId, mode, ostream) ; + size += marshaller->marshalString(password, mode, ostream) ; + size += marshaller->marshalString(userName, mode, ostream) ; + size += marshaller->marshalObjectArray(brokerPath, mode, ostream) ; + size += marshaller->marshalBoolean(brokerMasterConnector, mode, ostream) ; + size += marshaller->marshalBoolean(manageable, mode, ostream) ; + return size ; +} + +void ConnectionInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + clientId = p_cast(marshaller->unmarshalString(mode, istream)) ; + password = p_cast(marshaller->unmarshalString(mode, istream)) ; + userName = p_cast(marshaller->unmarshalString(mode, istream)) ; + brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; + brokerMasterConnector = (marshaller->unmarshalBoolean(mode, istream)) ; + manageable = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.hpp index 46f14d86fa..0e18841b31 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConnectionInfo.hpp @@ -1,100 +1,109 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ConnectionInfo_hpp_ -#define ActiveMQ_ConnectionInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ConnectionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ConnectionInfo : public BaseCommand -{ -protected: - p connectionId ; - p clientId ; - p password ; - p userName ; - array brokerPath ; - -public: - const static unsigned char TYPE = 3; - -public: - ConnectionInfo() ; - virtual ~ConnectionInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual p getClientId() ; - virtual void setClientId(p clientId) ; - - virtual p getPassword() ; - virtual void setPassword(p password) ; - - virtual p getUserName() ; - virtual void setUserName(p userName) ; - - virtual array getBrokerPath() ; - virtual void setBrokerPath(array brokerPath) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ConnectionInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConnectionInfo_hpp_ +#define ActiveMQ_ConnectionInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConnectionId.hpp" +#include "activemq/command/BrokerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConnectionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConnectionInfo : public BaseCommand +{ +protected: + p connectionId ; + p clientId ; + p password ; + p userName ; + array brokerPath ; + bool brokerMasterConnector ; + bool manageable ; + +public: + const static unsigned char TYPE = 3; + +public: + ConnectionInfo() ; + virtual ~ConnectionInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual p getClientId() ; + virtual void setClientId(p clientId) ; + + virtual p getPassword() ; + virtual void setPassword(p password) ; + + virtual p getUserName() ; + virtual void setUserName(p userName) ; + + virtual array getBrokerPath() ; + virtual void setBrokerPath(array brokerPath) ; + + virtual bool getBrokerMasterConnector() ; + virtual void setBrokerMasterConnector(bool brokerMasterConnector) ; + + virtual bool getManageable() ; + virtual void setManageable(bool manageable) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConnectionInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.cpp new file mode 100644 index 0000000000..87a44398f9 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.cpp @@ -0,0 +1,97 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConsumerControl.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerControl + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConsumerControl::ConsumerControl() +{ + this->close = false ; + this->consumerId = NULL ; + this->prefetch = 0 ; +} + +ConsumerControl::~ConsumerControl() +{ +} + +unsigned char ConsumerControl::getDataStructureType() +{ + return ConsumerControl::TYPE ; +} + + +bool ConsumerControl::getClose() +{ + return close ; +} + +void ConsumerControl::setClose(bool close) +{ + this->close = close ; +} + + +p ConsumerControl::getConsumerId() +{ + return consumerId ; +} + +void ConsumerControl::setConsumerId(p consumerId) +{ + this->consumerId = consumerId ; +} + + +int ConsumerControl::getPrefetch() +{ + return prefetch ; +} + +void ConsumerControl::setPrefetch(int prefetch) +{ + this->prefetch = prefetch ; +} + +int ConsumerControl::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalBoolean(close, mode, ostream) ; + size += marshaller->marshalObject(consumerId, mode, ostream) ; + size += marshaller->marshalInt(prefetch, mode, ostream) ; + return size ; +} + +void ConsumerControl::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + close = (marshaller->unmarshalBoolean(mode, istream)) ; + consumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + prefetch = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.hpp new file mode 100644 index 0000000000..b9f87d7253 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerControl.hpp @@ -0,0 +1,92 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConsumerControl_hpp_ +#define ActiveMQ_ConsumerControl_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConsumerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerControl + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConsumerControl : public BaseCommand +{ +protected: + bool close ; + p consumerId ; + int prefetch ; + +public: + const static unsigned char TYPE = 17; + +public: + ConsumerControl() ; + virtual ~ConsumerControl() ; + + virtual unsigned char getDataStructureType() ; + + virtual bool getClose() ; + virtual void setClose(bool close) ; + + virtual p getConsumerId() ; + virtual void setConsumerId(p consumerId) ; + + virtual int getPrefetch() ; + virtual void setPrefetch(int prefetch) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConsumerControl_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.cpp index bcb3679216..1b49967876 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.cpp @@ -1,95 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ConsumerId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ConsumerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ConsumerId::ConsumerId() -{ - this->connectionId = NULL ; - this->sessionId = 0 ; - this->value = 0 ; -} - -ConsumerId::~ConsumerId() -{ -} - -unsigned char ConsumerId::getDataStructureType() -{ - return ConsumerId::TYPE ; -} - - -p ConsumerId::getConnectionId() -{ - return connectionId ; -} - -void ConsumerId::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -long long ConsumerId::getSessionId() -{ - return sessionId ; -} - -void ConsumerId::setSessionId(long long sessionId) -{ - this->sessionId = sessionId ; -} - - -long long ConsumerId::getValue() -{ - return value ; -} - -void ConsumerId::setValue(long long value) -{ - this->value = value ; -} - -int ConsumerId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalString(connectionId, mode, writer) ; - size += marshaller->marshalLong(sessionId, mode, writer) ; - size += marshaller->marshalLong(value, mode, writer) ; - return size ; -} - -void ConsumerId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - connectionId = p_cast(marshaller->unmarshalString(mode, reader)) ; - sessionId = (marshaller->unmarshalLong(mode, reader)) ; - value = (marshaller->unmarshalLong(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConsumerId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConsumerId::ConsumerId() +{ + this->connectionId = NULL ; + this->sessionId = 0 ; + this->value = 0 ; +} + +ConsumerId::~ConsumerId() +{ +} + +unsigned char ConsumerId::getDataStructureType() +{ + return ConsumerId::TYPE ; +} + + +p ConsumerId::getConnectionId() +{ + return connectionId ; +} + +void ConsumerId::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +long long ConsumerId::getSessionId() +{ + return sessionId ; +} + +void ConsumerId::setSessionId(long long sessionId) +{ + this->sessionId = sessionId ; +} + + +long long ConsumerId::getValue() +{ + return value ; +} + +void ConsumerId::setValue(long long value) +{ + this->value = value ; +} + +int ConsumerId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(connectionId, mode, ostream) ; + size += marshaller->marshalLong(sessionId, mode, ostream) ; + size += marshaller->marshalLong(value, mode, ostream) ; + return size ; +} + +void ConsumerId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalString(mode, istream)) ; + sessionId = (marshaller->unmarshalLong(mode, istream)) ; + value = (marshaller->unmarshalLong(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.hpp index a0fe0316a8..cd272ad1df 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerId.hpp @@ -1,90 +1,91 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ConsumerId_hpp_ -#define ActiveMQ_ConsumerId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ConsumerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ConsumerId : public AbstractCommand -{ -protected: - p connectionId ; - long long sessionId ; - long long value ; - -public: - const static unsigned char TYPE = 122; - -public: - ConsumerId() ; - virtual ~ConsumerId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual long long getSessionId() ; - virtual void setSessionId(long long sessionId) ; - - virtual long long getValue() ; - virtual void setValue(long long value) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ConsumerId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConsumerId_hpp_ +#define ActiveMQ_ConsumerId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConsumerId : public BaseDataStructure +{ +protected: + p connectionId ; + long long sessionId ; + long long value ; + +public: + const static unsigned char TYPE = 122; + +public: + ConsumerId() ; + virtual ~ConsumerId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual long long getSessionId() ; + virtual void setSessionId(long long sessionId) ; + + virtual long long getValue() ; + virtual void setValue(long long value) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConsumerId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.cpp index d8db689696..d823a3b4c9 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.cpp @@ -1,243 +1,293 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ConsumerInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ConsumerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ConsumerInfo::ConsumerInfo() -{ - this->consumerId = NULL ; - this->browser = false ; - this->destination = NULL ; - this->prefetchSize = 0 ; - this->dispatchAsync = false ; - this->selector = NULL ; - this->subcriptionName = NULL ; - this->noLocal = false ; - this->exclusive = false ; - this->retroactive = false ; - this->priority = 0 ; - this->brokerPath = NULL ; - this->networkSubscription = false ; -} - -ConsumerInfo::~ConsumerInfo() -{ -} - -unsigned char ConsumerInfo::getDataStructureType() -{ - return ConsumerInfo::TYPE ; -} - - -p ConsumerInfo::getConsumerId() -{ - return consumerId ; -} - -void ConsumerInfo::setConsumerId(p consumerId) -{ - this->consumerId = consumerId ; -} - - -bool ConsumerInfo::getBrowser() -{ - return browser ; -} - -void ConsumerInfo::setBrowser(bool browser) -{ - this->browser = browser ; -} - - -p ConsumerInfo::getDestination() -{ - return destination ; -} - -void ConsumerInfo::setDestination(p destination) -{ - this->destination = destination ; -} - - -int ConsumerInfo::getPrefetchSize() -{ - return prefetchSize ; -} - -void ConsumerInfo::setPrefetchSize(int prefetchSize) -{ - this->prefetchSize = prefetchSize ; -} - - -bool ConsumerInfo::getDispatchAsync() -{ - return dispatchAsync ; -} - -void ConsumerInfo::setDispatchAsync(bool dispatchAsync) -{ - this->dispatchAsync = dispatchAsync ; -} - - -p ConsumerInfo::getSelector() -{ - return selector ; -} - -void ConsumerInfo::setSelector(p selector) -{ - this->selector = selector ; -} - - -p ConsumerInfo::getSubcriptionName() -{ - return subcriptionName ; -} - -void ConsumerInfo::setSubcriptionName(p subcriptionName) -{ - this->subcriptionName = subcriptionName ; -} - - -bool ConsumerInfo::getNoLocal() -{ - return noLocal ; -} - -void ConsumerInfo::setNoLocal(bool noLocal) -{ - this->noLocal = noLocal ; -} - - -bool ConsumerInfo::getExclusive() -{ - return exclusive ; -} - -void ConsumerInfo::setExclusive(bool exclusive) -{ - this->exclusive = exclusive ; -} - - -bool ConsumerInfo::getRetroactive() -{ - return retroactive ; -} - -void ConsumerInfo::setRetroactive(bool retroactive) -{ - this->retroactive = retroactive ; -} - - -char ConsumerInfo::getPriority() -{ - return priority ; -} - -void ConsumerInfo::setPriority(char priority) -{ - this->priority = priority ; -} - - -array ConsumerInfo::getBrokerPath() -{ - return brokerPath ; -} - -void ConsumerInfo::setBrokerPath(array brokerPath) -{ - this->brokerPath = brokerPath ; -} - - -bool ConsumerInfo::getNetworkSubscription() -{ - return networkSubscription ; -} - -void ConsumerInfo::setNetworkSubscription(bool networkSubscription) -{ - this->networkSubscription = networkSubscription ; -} - -int ConsumerInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(consumerId, mode, writer) ; - size += marshaller->marshalBoolean(browser, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalInt(prefetchSize, mode, writer) ; - size += marshaller->marshalInt(maximumPendingMessageLimit, mode, writer) ; - size += marshaller->marshalBoolean(dispatchAsync, mode, writer) ; - size += marshaller->marshalString(selector, mode, writer) ; - size += marshaller->marshalString(subcriptionName, mode, writer) ; - size += marshaller->marshalBoolean(noLocal, mode, writer) ; - size += marshaller->marshalBoolean(exclusive, mode, writer) ; - size += marshaller->marshalBoolean(retroactive, mode, writer) ; - size += marshaller->marshalByte(priority, mode, writer) ; - size += marshaller->marshalObjectArray(brokerPath, mode, writer) ; - size += marshaller->marshalObject(additionalPredicate, mode, writer) ; - size += marshaller->marshalBoolean(networkSubscription, mode, writer) ; - return size ; -} - -void ConsumerInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - consumerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - browser = (marshaller->unmarshalBoolean(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - prefetchSize = (marshaller->unmarshalInt(mode, reader)) ; - maximumPendingMessageLimit = (marshaller->unmarshalInt(mode, reader)) ; - dispatchAsync = (marshaller->unmarshalBoolean(mode, reader)) ; - selector = p_cast(marshaller->unmarshalString(mode, reader)) ; - subcriptionName = p_cast(marshaller->unmarshalString(mode, reader)) ; - noLocal = (marshaller->unmarshalBoolean(mode, reader)) ; - exclusive = (marshaller->unmarshalBoolean(mode, reader)) ; - retroactive = (marshaller->unmarshalBoolean(mode, reader)) ; - priority = (marshaller->unmarshalByte(mode, reader)) ; - brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; - additionalPredicate = p_cast(marshaller->unmarshalObject(mode, reader)) ; - networkSubscription = (marshaller->unmarshalBoolean(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ConsumerInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ConsumerInfo::ConsumerInfo() +{ + this->consumerId = NULL ; + this->browser = false ; + this->destination = NULL ; + this->prefetchSize = 0 ; + this->maximumPendingMessageLimit = 0 ; + this->dispatchAsync = false ; + this->selector = NULL ; + this->subcriptionName = NULL ; + this->noLocal = false ; + this->exclusive = false ; + this->retroactive = false ; + this->priority = 0 ; + this->brokerPath = NULL ; + this->additionalPredicate = NULL ; + this->networkSubscription = false ; + this->optimizedAcknowledge = false ; + this->noRangeAcks = false ; +} + +ConsumerInfo::~ConsumerInfo() +{ +} + +unsigned char ConsumerInfo::getDataStructureType() +{ + return ConsumerInfo::TYPE ; +} + + +p ConsumerInfo::getConsumerId() +{ + return consumerId ; +} + +void ConsumerInfo::setConsumerId(p consumerId) +{ + this->consumerId = consumerId ; +} + + +bool ConsumerInfo::getBrowser() +{ + return browser ; +} + +void ConsumerInfo::setBrowser(bool browser) +{ + this->browser = browser ; +} + + +p ConsumerInfo::getDestination() +{ + return destination ; +} + +void ConsumerInfo::setDestination(p destination) +{ + this->destination = destination ; +} + + +int ConsumerInfo::getPrefetchSize() +{ + return prefetchSize ; +} + +void ConsumerInfo::setPrefetchSize(int prefetchSize) +{ + this->prefetchSize = prefetchSize ; +} + + +int ConsumerInfo::getMaximumPendingMessageLimit() +{ + return maximumPendingMessageLimit ; +} + +void ConsumerInfo::setMaximumPendingMessageLimit(int maximumPendingMessageLimit) +{ + this->maximumPendingMessageLimit = maximumPendingMessageLimit ; +} + + +bool ConsumerInfo::getDispatchAsync() +{ + return dispatchAsync ; +} + +void ConsumerInfo::setDispatchAsync(bool dispatchAsync) +{ + this->dispatchAsync = dispatchAsync ; +} + + +p ConsumerInfo::getSelector() +{ + return selector ; +} + +void ConsumerInfo::setSelector(p selector) +{ + this->selector = selector ; +} + + +p ConsumerInfo::getSubcriptionName() +{ + return subcriptionName ; +} + +void ConsumerInfo::setSubcriptionName(p subcriptionName) +{ + this->subcriptionName = subcriptionName ; +} + + +bool ConsumerInfo::getNoLocal() +{ + return noLocal ; +} + +void ConsumerInfo::setNoLocal(bool noLocal) +{ + this->noLocal = noLocal ; +} + + +bool ConsumerInfo::getExclusive() +{ + return exclusive ; +} + +void ConsumerInfo::setExclusive(bool exclusive) +{ + this->exclusive = exclusive ; +} + + +bool ConsumerInfo::getRetroactive() +{ + return retroactive ; +} + +void ConsumerInfo::setRetroactive(bool retroactive) +{ + this->retroactive = retroactive ; +} + + +char ConsumerInfo::getPriority() +{ + return priority ; +} + +void ConsumerInfo::setPriority(char priority) +{ + this->priority = priority ; +} + + +array ConsumerInfo::getBrokerPath() +{ + return brokerPath ; +} + +void ConsumerInfo::setBrokerPath(array brokerPath) +{ + this->brokerPath = brokerPath ; +} + + +p ConsumerInfo::getAdditionalPredicate() +{ + return additionalPredicate ; +} + +void ConsumerInfo::setAdditionalPredicate(p additionalPredicate) +{ + this->additionalPredicate = additionalPredicate ; +} + + +bool ConsumerInfo::getNetworkSubscription() +{ + return networkSubscription ; +} + +void ConsumerInfo::setNetworkSubscription(bool networkSubscription) +{ + this->networkSubscription = networkSubscription ; +} + + +bool ConsumerInfo::getOptimizedAcknowledge() +{ + return optimizedAcknowledge ; +} + +void ConsumerInfo::setOptimizedAcknowledge(bool optimizedAcknowledge) +{ + this->optimizedAcknowledge = optimizedAcknowledge ; +} + + +bool ConsumerInfo::getNoRangeAcks() +{ + return noRangeAcks ; +} + +void ConsumerInfo::setNoRangeAcks(bool noRangeAcks) +{ + this->noRangeAcks = noRangeAcks ; +} + +int ConsumerInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(consumerId, mode, ostream) ; + size += marshaller->marshalBoolean(browser, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalInt(prefetchSize, mode, ostream) ; + size += marshaller->marshalInt(maximumPendingMessageLimit, mode, ostream) ; + size += marshaller->marshalBoolean(dispatchAsync, mode, ostream) ; + size += marshaller->marshalString(selector, mode, ostream) ; + size += marshaller->marshalString(subcriptionName, mode, ostream) ; + size += marshaller->marshalBoolean(noLocal, mode, ostream) ; + size += marshaller->marshalBoolean(exclusive, mode, ostream) ; + size += marshaller->marshalBoolean(retroactive, mode, ostream) ; + size += marshaller->marshalByte(priority, mode, ostream) ; + size += marshaller->marshalObjectArray(brokerPath, mode, ostream) ; + size += marshaller->marshalObject(additionalPredicate, mode, ostream) ; + size += marshaller->marshalBoolean(networkSubscription, mode, ostream) ; + size += marshaller->marshalBoolean(optimizedAcknowledge, mode, ostream) ; + size += marshaller->marshalBoolean(noRangeAcks, mode, ostream) ; + return size ; +} + +void ConsumerInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + consumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + browser = (marshaller->unmarshalBoolean(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + prefetchSize = (marshaller->unmarshalInt(mode, istream)) ; + maximumPendingMessageLimit = (marshaller->unmarshalInt(mode, istream)) ; + dispatchAsync = (marshaller->unmarshalBoolean(mode, istream)) ; + selector = p_cast(marshaller->unmarshalString(mode, istream)) ; + subcriptionName = p_cast(marshaller->unmarshalString(mode, istream)) ; + noLocal = (marshaller->unmarshalBoolean(mode, istream)) ; + exclusive = (marshaller->unmarshalBoolean(mode, istream)) ; + retroactive = (marshaller->unmarshalBoolean(mode, istream)) ; + priority = (marshaller->unmarshalByte(mode, istream)) ; + brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; + additionalPredicate = p_cast(marshaller->unmarshalObject(mode, istream)) ; + networkSubscription = (marshaller->unmarshalBoolean(mode, istream)) ; + optimizedAcknowledge = (marshaller->unmarshalBoolean(mode, istream)) ; + noRangeAcks = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.hpp index 6e81b8918e..7c6218df44 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ConsumerInfo.hpp @@ -1,136 +1,151 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ConsumerInfo_hpp_ -#define ActiveMQ_ConsumerInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConsumerId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/command/BooleanExpression.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ConsumerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ConsumerInfo : public BaseCommand -{ -protected: - p consumerId ; - p destination ; - int prefetchSize ; - int maximumPendingMessageLimit ; - bool browser ; - bool dispatchAsync ; - p selector ; - p subcriptionName ; - bool noLocal ; - bool exclusive ; - bool retroactive ; - char priority ; - array brokerPath ; +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ConsumerInfo_hpp_ +#define ActiveMQ_ConsumerInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConsumerId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/BrokerId.hpp" +#include "activemq/command/BooleanExpression.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ConsumerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ConsumerInfo : public BaseCommand +{ +protected: + p consumerId ; + bool browser ; + p destination ; + int prefetchSize ; + int maximumPendingMessageLimit ; + bool dispatchAsync ; + p selector ; + p subcriptionName ; + bool noLocal ; + bool exclusive ; + bool retroactive ; + char priority ; + array brokerPath ; p additionalPredicate ; - bool networkSubscription ; - -public: - const static unsigned char TYPE = 5; - -public: - ConsumerInfo() ; - virtual ~ConsumerInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConsumerId() ; - virtual void setConsumerId(p consumerId) ; - - virtual bool getBrowser() ; - virtual void setBrowser(bool browser) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual int getPrefetchSize() ; - virtual void setPrefetchSize(int prefetchSize) ; - - virtual bool getDispatchAsync() ; - virtual void setDispatchAsync(bool dispatchAsync) ; - - virtual p getSelector() ; - virtual void setSelector(p selector) ; - - virtual p getSubcriptionName() ; - virtual void setSubcriptionName(p subcriptionName) ; - - virtual bool getNoLocal() ; - virtual void setNoLocal(bool noLocal) ; - - virtual bool getExclusive() ; - virtual void setExclusive(bool exclusive) ; - - virtual bool getRetroactive() ; - virtual void setRetroactive(bool retroactive) ; - - virtual char getPriority() ; - virtual void setPriority(char priority) ; - - virtual array getBrokerPath() ; - virtual void setBrokerPath(array brokerPath) ; - - virtual bool getNetworkSubscription() ; - virtual void setNetworkSubscription(bool networkSubscription) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ConsumerInfo_hpp_*/ + bool networkSubscription ; + bool optimizedAcknowledge ; + bool noRangeAcks ; + +public: + const static unsigned char TYPE = 5; + +public: + ConsumerInfo() ; + virtual ~ConsumerInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConsumerId() ; + virtual void setConsumerId(p consumerId) ; + + virtual bool getBrowser() ; + virtual void setBrowser(bool browser) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual int getPrefetchSize() ; + virtual void setPrefetchSize(int prefetchSize) ; + + virtual int getMaximumPendingMessageLimit() ; + virtual void setMaximumPendingMessageLimit(int maximumPendingMessageLimit) ; + + virtual bool getDispatchAsync() ; + virtual void setDispatchAsync(bool dispatchAsync) ; + + virtual p getSelector() ; + virtual void setSelector(p selector) ; + + virtual p getSubcriptionName() ; + virtual void setSubcriptionName(p subcriptionName) ; + + virtual bool getNoLocal() ; + virtual void setNoLocal(bool noLocal) ; + + virtual bool getExclusive() ; + virtual void setExclusive(bool exclusive) ; + + virtual bool getRetroactive() ; + virtual void setRetroactive(bool retroactive) ; + + virtual char getPriority() ; + virtual void setPriority(char priority) ; + + virtual array getBrokerPath() ; + virtual void setBrokerPath(array brokerPath) ; + + virtual p getAdditionalPredicate() ; + virtual void setAdditionalPredicate(p additionalPredicate) ; + + virtual bool getNetworkSubscription() ; + virtual void setNetworkSubscription(bool networkSubscription) ; + + virtual bool getOptimizedAcknowledge() ; + virtual void setOptimizedAcknowledge(bool optimizedAcknowledge) ; + + virtual bool getNoRangeAcks() ; + virtual void setNoRangeAcks(bool noRangeAcks) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ConsumerInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.cpp index f104317e7e..c4dd564a98 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ControlCommand.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ControlCommand - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ControlCommand::ControlCommand() -{ - this->command = NULL ; -} - -ControlCommand::~ControlCommand() -{ -} - -unsigned char ControlCommand::getDataStructureType() -{ - return ControlCommand::TYPE ; -} - - -p ControlCommand::getCommand() -{ - return command ; -} - -void ControlCommand::setCommand(p command) -{ - this->command = command ; -} - -int ControlCommand::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalString(command, mode, writer) ; - return size ; -} - -void ControlCommand::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - command = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ControlCommand.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ControlCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ControlCommand::ControlCommand() +{ + this->command = NULL ; +} + +ControlCommand::~ControlCommand() +{ +} + +unsigned char ControlCommand::getDataStructureType() +{ + return ControlCommand::TYPE ; +} + + +p ControlCommand::getCommand() +{ + return command ; +} + +void ControlCommand::setCommand(p command) +{ + this->command = command ; +} + +int ControlCommand::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(command, mode, ostream) ; + return size ; +} + +void ControlCommand::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + command = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.hpp index 4699dbf4b7..0b9509d7de 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ControlCommand.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ControlCommand_hpp_ -#define ActiveMQ_ControlCommand_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ControlCommand - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ControlCommand : public BaseCommand -{ -protected: - p command ; - -public: - const static unsigned char TYPE = 14; - -public: - ControlCommand() ; - virtual ~ControlCommand() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getCommand() ; - virtual void setCommand(p command) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ControlCommand_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ControlCommand_hpp_ +#define ActiveMQ_ControlCommand_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ControlCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ControlCommand : public BaseCommand +{ +protected: + p command ; + +public: + const static unsigned char TYPE = 14; + +public: + ControlCommand() ; + virtual ~ControlCommand() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getCommand() ; + virtual void setCommand(p command) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ControlCommand_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.cpp b/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.cpp index 6bc2455a09..e802804303 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/DataArrayResponse.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for DataArrayResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -DataArrayResponse::DataArrayResponse() -{ - this->data = NULL ; -} - -DataArrayResponse::~DataArrayResponse() -{ -} - -unsigned char DataArrayResponse::getDataStructureType() -{ - return DataArrayResponse::TYPE ; -} - - -array DataArrayResponse::getData() -{ - return data ; -} - -void DataArrayResponse::setData(array data) -{ - this->data = data ; -} - -int DataArrayResponse::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObjectArray(data, mode, writer) ; - return size ; -} - -void DataArrayResponse::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - data = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/DataArrayResponse.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for DataArrayResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +DataArrayResponse::DataArrayResponse() +{ + this->data = NULL ; +} + +DataArrayResponse::~DataArrayResponse() +{ +} + +unsigned char DataArrayResponse::getDataStructureType() +{ + return DataArrayResponse::TYPE ; +} + + +array DataArrayResponse::getData() +{ + return data ; +} + +void DataArrayResponse::setData(array data) +{ + this->data = data ; +} + +int DataArrayResponse::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += Response::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObjectArray(data, mode, ostream) ; + return size ; +} + +void DataArrayResponse::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + Response::unmarshal(marshaller, mode, istream) ; + data = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.hpp b/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.hpp index c1a89a4c2e..98b8d3345f 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DataArrayResponse.hpp @@ -1,83 +1,84 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_DataArrayResponse_hpp_ -#define ActiveMQ_DataArrayResponse_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/IDataStructure.hpp" -#include "activemq/command/Response.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for DataArrayResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class DataArrayResponse : public Response -{ -protected: - array data ; - -public: - const static unsigned char TYPE = 33; - -public: - DataArrayResponse() ; - virtual ~DataArrayResponse() ; - - virtual unsigned char getDataStructureType() ; - - virtual array getData() ; - virtual void setData(array data) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_DataArrayResponse_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_DataArrayResponse_hpp_ +#define ActiveMQ_DataArrayResponse_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/Response.hpp" +#include "activemq/IDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for DataArrayResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class DataArrayResponse : public Response +{ +protected: + array data ; + +public: + const static unsigned char TYPE = 33; + +public: + DataArrayResponse() ; + virtual ~DataArrayResponse() ; + + virtual unsigned char getDataStructureType() ; + + virtual array getData() ; + virtual void setData(array data) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_DataArrayResponse_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/DataResponse.cpp b/openwire-cpp/src/main/cpp/activemq/command/DataResponse.cpp index c6feb958bb..f0d66bf9c6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DataResponse.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DataResponse.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/DataResponse.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for DataResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -DataResponse::DataResponse() -{ - this->data = NULL ; -} - -DataResponse::~DataResponse() -{ -} - -unsigned char DataResponse::getDataStructureType() -{ - return DataResponse::TYPE ; -} - - -p DataResponse::getData() -{ - return data ; -} - -void DataResponse::setData(p data) -{ - this->data = data ; -} - -int DataResponse::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(data, mode, writer) ; - return size ; -} - -void DataResponse::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - data = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/DataResponse.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for DataResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +DataResponse::DataResponse() +{ + this->data = NULL ; +} + +DataResponse::~DataResponse() +{ +} + +unsigned char DataResponse::getDataStructureType() +{ + return DataResponse::TYPE ; +} + + +p DataResponse::getData() +{ + return data ; +} + +void DataResponse::setData(p data) +{ + this->data = data ; +} + +int DataResponse::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += Response::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(data, mode, ostream) ; + return size ; +} + +void DataResponse::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + Response::unmarshal(marshaller, mode, istream) ; + data = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/DataResponse.hpp b/openwire-cpp/src/main/cpp/activemq/command/DataResponse.hpp index a695860ced..d08c9f1bfb 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DataResponse.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DataResponse.hpp @@ -1,83 +1,84 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_DataResponse_hpp_ -#define ActiveMQ_DataResponse_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/IDataStructure.hpp" -#include "activemq/command/Response.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for DataResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class DataResponse : public Response -{ -protected: - p data ; - -public: - const static unsigned char TYPE = 32; - -public: - DataResponse() ; - virtual ~DataResponse() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getData() ; - virtual void setData(p data) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_DataResponse_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_DataResponse_hpp_ +#define ActiveMQ_DataResponse_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/Response.hpp" +#include "activemq/IDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for DataResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class DataResponse : public Response +{ +protected: + p data ; + +public: + const static unsigned char TYPE = 32; + +public: + DataResponse() ; + virtual ~DataResponse() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getData() ; + virtual void setData(p data) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_DataResponse_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.cpp index 2c8b9ff628..b3043e47c7 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.cpp @@ -1,127 +1,125 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/DestinationInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for DestinationInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -DestinationInfo::DestinationInfo() -{ - this->connectionId = NULL ; - this->destination = NULL ; - this->operationType = 0 ; - this->timeout = 0 ; - this->brokerPath = NULL ; -} - -DestinationInfo::~DestinationInfo() -{ -} - -unsigned char DestinationInfo::getDataStructureType() -{ - return DestinationInfo::TYPE ; -} - - -p DestinationInfo::getConnectionId() -{ - return connectionId ; -} - -void DestinationInfo::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -p DestinationInfo::getDestination() -{ - return destination ; -} - -void DestinationInfo::setDestination(p destination) -{ - this->destination = destination ; -} - - -char DestinationInfo::getOperationType() -{ - return operationType ; -} - -void DestinationInfo::setOperationType(char operationType) -{ - this->operationType = operationType ; -} - - -long long DestinationInfo::getTimeout() -{ - return timeout ; -} - -void DestinationInfo::setTimeout(long long timeout) -{ - this->timeout = timeout ; -} - - -array DestinationInfo::getBrokerPath() -{ - return brokerPath ; -} - -void DestinationInfo::setBrokerPath(array brokerPath) -{ - this->brokerPath = brokerPath ; -} - -int DestinationInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalByte(operationType, mode, writer) ; - size += marshaller->marshalLong(timeout, mode, writer) ; - size += marshaller->marshalObjectArray(brokerPath, mode, writer) ; - return size ; -} - -void DestinationInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - operationType = (marshaller->unmarshalByte(mode, reader)) ; - timeout = (marshaller->unmarshalLong(mode, reader)) ; - brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/DestinationInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for DestinationInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +DestinationInfo::DestinationInfo() +{ + this->connectionId = NULL ; + this->destination = NULL ; + this->operationType = 0 ; + this->timeout = 0 ; + this->brokerPath = NULL ; +} + +DestinationInfo::~DestinationInfo() +{ +} + +unsigned char DestinationInfo::getDataStructureType() +{ + return DestinationInfo::TYPE ; +} + + +p DestinationInfo::getConnectionId() +{ + return connectionId ; +} + +void DestinationInfo::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +p DestinationInfo::getDestination() +{ + return destination ; +} + +void DestinationInfo::setDestination(p destination) +{ + this->destination = destination ; +} + + +char DestinationInfo::getOperationType() +{ + return operationType ; +} + +void DestinationInfo::setOperationType(char operationType) +{ + this->operationType = operationType ; +} + + +long long DestinationInfo::getTimeout() +{ + return timeout ; +} + +void DestinationInfo::setTimeout(long long timeout) +{ + this->timeout = timeout ; +} + + +array DestinationInfo::getBrokerPath() +{ + return brokerPath ; +} + +void DestinationInfo::setBrokerPath(array brokerPath) +{ + this->brokerPath = brokerPath ; +} + +int DestinationInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalByte(operationType, mode, ostream) ; + size += marshaller->marshalLong(timeout, mode, ostream) ; + size += marshaller->marshalObjectArray(brokerPath, mode, ostream) ; + return size ; +} + +void DestinationInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + operationType = (marshaller->unmarshalByte(mode, istream)) ; + timeout = (marshaller->unmarshalLong(mode, istream)) ; + brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.hpp index 6e66f2abbd..e65aa14653 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DestinationInfo.hpp @@ -1,101 +1,102 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_DestinationInfo_hpp_ -#define ActiveMQ_DestinationInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for DestinationInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class DestinationInfo : public BaseCommand -{ -protected: - p connectionId ; - p destination ; - char operationType ; - long long timeout ; - array brokerPath ; - -public: - const static unsigned char TYPE = 8; - -public: - DestinationInfo() ; - virtual ~DestinationInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual char getOperationType() ; - virtual void setOperationType(char operationType) ; - - virtual long long getTimeout() ; - virtual void setTimeout(long long timeout) ; - - virtual array getBrokerPath() ; - virtual void setBrokerPath(array brokerPath) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_DestinationInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_DestinationInfo_hpp_ +#define ActiveMQ_DestinationInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConnectionId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/BrokerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for DestinationInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class DestinationInfo : public BaseCommand +{ +protected: + p connectionId ; + p destination ; + char operationType ; + long long timeout ; + array brokerPath ; + +public: + const static unsigned char TYPE = 8; + +public: + DestinationInfo() ; + virtual ~DestinationInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual char getOperationType() ; + virtual void setOperationType(char operationType) ; + + virtual long long getTimeout() ; + virtual void setTimeout(long long timeout) ; + + virtual array getBrokerPath() ; + virtual void setBrokerPath(array brokerPath) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_DestinationInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.cpp b/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.cpp index 45995d381b..1775a56518 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.cpp @@ -1,85 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/DiscoveryEvent.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for DiscoveryEvent - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -DiscoveryEvent::DiscoveryEvent() -{ - this->serviceName = NULL ; - this->brokerName = NULL ; -} - -DiscoveryEvent::~DiscoveryEvent() -{ -} - -unsigned char DiscoveryEvent::getDataStructureType() -{ - return DiscoveryEvent::TYPE ; -} - - -p DiscoveryEvent::getServiceName() -{ - return serviceName ; -} - -void DiscoveryEvent::setServiceName(p serviceName) -{ - this->serviceName = serviceName ; -} - - -p DiscoveryEvent::getBrokerName() -{ - return brokerName ; -} - -void DiscoveryEvent::setBrokerName(p brokerName) -{ - this->brokerName = brokerName ; -} - -int DiscoveryEvent::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalString(serviceName, mode, writer) ; - size += marshaller->marshalString(brokerName, mode, writer) ; - return size ; -} - -void DiscoveryEvent::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - serviceName = p_cast(marshaller->unmarshalString(mode, reader)) ; - brokerName = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/DiscoveryEvent.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for DiscoveryEvent + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +DiscoveryEvent::DiscoveryEvent() +{ + this->serviceName = NULL ; + this->brokerName = NULL ; +} + +DiscoveryEvent::~DiscoveryEvent() +{ +} + +unsigned char DiscoveryEvent::getDataStructureType() +{ + return DiscoveryEvent::TYPE ; +} + + +p DiscoveryEvent::getServiceName() +{ + return serviceName ; +} + +void DiscoveryEvent::setServiceName(p serviceName) +{ + this->serviceName = serviceName ; +} + + +p DiscoveryEvent::getBrokerName() +{ + return brokerName ; +} + +void DiscoveryEvent::setBrokerName(p brokerName) +{ + this->brokerName = brokerName ; +} + +int DiscoveryEvent::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(serviceName, mode, ostream) ; + size += marshaller->marshalString(brokerName, mode, ostream) ; + return size ; +} + +void DiscoveryEvent::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + serviceName = p_cast(marshaller->unmarshalString(mode, istream)) ; + brokerName = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.hpp b/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.hpp index 55ffb955f5..0e60c28ed6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/DiscoveryEvent.hpp @@ -1,86 +1,87 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_DiscoveryEvent_hpp_ -#define ActiveMQ_DiscoveryEvent_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for DiscoveryEvent - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class DiscoveryEvent : public AbstractCommand -{ -protected: - p serviceName ; - p brokerName ; - -public: - const static unsigned char TYPE = 40; - -public: - DiscoveryEvent() ; - virtual ~DiscoveryEvent() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getServiceName() ; - virtual void setServiceName(p serviceName) ; - - virtual p getBrokerName() ; - virtual void setBrokerName(p brokerName) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_DiscoveryEvent_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_DiscoveryEvent_hpp_ +#define ActiveMQ_DiscoveryEvent_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for DiscoveryEvent + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class DiscoveryEvent : public BaseDataStructure +{ +protected: + p serviceName ; + p brokerName ; + +public: + const static unsigned char TYPE = 40; + +public: + DiscoveryEvent() ; + virtual ~DiscoveryEvent() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getServiceName() ; + virtual void setServiceName(p serviceName) ; + + virtual p getBrokerName() ; + virtual void setBrokerName(p brokerName) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_DiscoveryEvent_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.cpp b/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.cpp index 726801e657..3ba495f04d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ExceptionResponse.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ExceptionResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ExceptionResponse::ExceptionResponse() -{ - this->exception = NULL ; -} - -ExceptionResponse::~ExceptionResponse() -{ -} - -unsigned char ExceptionResponse::getDataStructureType() -{ - return ExceptionResponse::TYPE ; -} - - -p ExceptionResponse::getException() -{ - return exception ; -} - -void ExceptionResponse::setException(p exception) -{ - this->exception = exception ; -} - -int ExceptionResponse::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(exception, mode, writer) ; - return size ; -} - -void ExceptionResponse::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - exception = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ExceptionResponse.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ExceptionResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ExceptionResponse::ExceptionResponse() +{ + this->exception = NULL ; +} + +ExceptionResponse::~ExceptionResponse() +{ +} + +unsigned char ExceptionResponse::getDataStructureType() +{ + return ExceptionResponse::TYPE ; +} + + +p ExceptionResponse::getException() +{ + return exception ; +} + +void ExceptionResponse::setException(p exception) +{ + this->exception = exception ; +} + +int ExceptionResponse::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += Response::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(exception, mode, ostream) ; + return size ; +} + +void ExceptionResponse::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + Response::unmarshal(marshaller, mode, istream) ; + exception = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.hpp b/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.hpp index a9efbf568a..f5600ccc86 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ExceptionResponse.hpp @@ -1,83 +1,84 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ExceptionResponse_hpp_ -#define ActiveMQ_ExceptionResponse_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/Response.hpp" -#include "activemq/command/BrokerError.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ExceptionResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ExceptionResponse : public Response -{ -protected: - p exception ; - -public: - const static unsigned char TYPE = 31; - -public: - ExceptionResponse() ; - virtual ~ExceptionResponse() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getException() ; - virtual void setException(p exception) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ExceptionResponse_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ExceptionResponse_hpp_ +#define ActiveMQ_ExceptionResponse_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/Response.hpp" +#include "activemq/command/BrokerError.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ExceptionResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ExceptionResponse : public Response +{ +protected: + p exception ; + +public: + const static unsigned char TYPE = 31; + +public: + ExceptionResponse() ; + virtual ~ExceptionResponse() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getException() ; + virtual void setException(p exception) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ExceptionResponse_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.cpp index 1aa58168ee..a12369684a 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.cpp @@ -1,57 +1,55 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/FlushCommand.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for FlushCommand - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -FlushCommand::FlushCommand() -{ -} - -FlushCommand::~FlushCommand() -{ -} - -unsigned char FlushCommand::getDataStructureType() -{ - return FlushCommand::TYPE ; -} - -int FlushCommand::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - return size ; -} - -void FlushCommand::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/FlushCommand.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for FlushCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +FlushCommand::FlushCommand() +{ +} + +FlushCommand::~FlushCommand() +{ +} + +unsigned char FlushCommand::getDataStructureType() +{ + return FlushCommand::TYPE ; +} + +int FlushCommand::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + return size ; +} + +void FlushCommand::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.hpp index 66017afb60..e232a6c251 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/FlushCommand.hpp @@ -1,78 +1,79 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_FlushCommand_hpp_ -#define ActiveMQ_FlushCommand_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for FlushCommand - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class FlushCommand : public BaseCommand -{ -protected: - -public: - const static unsigned char TYPE = 15; - -public: - FlushCommand() ; - virtual ~FlushCommand() ; - - virtual unsigned char getDataStructureType() ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_FlushCommand_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_FlushCommand_hpp_ +#define ActiveMQ_FlushCommand_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for FlushCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class FlushCommand : public BaseCommand +{ +protected: + +public: + const static unsigned char TYPE = 15; + +public: + FlushCommand() ; + virtual ~FlushCommand() ; + + virtual unsigned char getDataStructureType() ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_FlushCommand_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.cpp b/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.cpp index 12e9222a6e..ba51feb32c 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/IntegerResponse.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for IntegerResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -IntegerResponse::IntegerResponse() -{ - this->result = 0 ; -} - -IntegerResponse::~IntegerResponse() -{ -} - -unsigned char IntegerResponse::getDataStructureType() -{ - return IntegerResponse::TYPE ; -} - - -int IntegerResponse::getResult() -{ - return result ; -} - -void IntegerResponse::setResult(int result) -{ - this->result = result ; -} - -int IntegerResponse::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalInt(result, mode, writer) ; - return size ; -} - -void IntegerResponse::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - result = (marshaller->unmarshalInt(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/IntegerResponse.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for IntegerResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +IntegerResponse::IntegerResponse() +{ + this->result = 0 ; +} + +IntegerResponse::~IntegerResponse() +{ +} + +unsigned char IntegerResponse::getDataStructureType() +{ + return IntegerResponse::TYPE ; +} + + +int IntegerResponse::getResult() +{ + return result ; +} + +void IntegerResponse::setResult(int result) +{ + this->result = result ; +} + +int IntegerResponse::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += Response::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(result, mode, ostream) ; + return size ; +} + +void IntegerResponse::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + Response::unmarshal(marshaller, mode, istream) ; + result = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.hpp b/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.hpp index b4a8aa44dd..a5c0b863ca 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/IntegerResponse.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_IntegerResponse_hpp_ -#define ActiveMQ_IntegerResponse_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/Response.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for IntegerResponse - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class IntegerResponse : public Response -{ -protected: - int result ; - -public: - const static unsigned char TYPE = 34; - -public: - IntegerResponse() ; - virtual ~IntegerResponse() ; - - virtual unsigned char getDataStructureType() ; - - virtual int getResult() ; - virtual void setResult(int result) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_IntegerResponse_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_IntegerResponse_hpp_ +#define ActiveMQ_IntegerResponse_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/Response.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for IntegerResponse + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class IntegerResponse : public Response +{ +protected: + int result ; + +public: + const static unsigned char TYPE = 34; + +public: + IntegerResponse() ; + virtual ~IntegerResponse() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getResult() ; + virtual void setResult(int result) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_IntegerResponse_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.cpp b/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.cpp index 0e36b45e66..7e82f29423 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.cpp @@ -1,85 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/JournalQueueAck.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for JournalQueueAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -JournalQueueAck::JournalQueueAck() -{ - this->destination = NULL ; - this->messageAck = NULL ; -} - -JournalQueueAck::~JournalQueueAck() -{ -} - -unsigned char JournalQueueAck::getDataStructureType() -{ - return JournalQueueAck::TYPE ; -} - - -p JournalQueueAck::getDestination() -{ - return destination ; -} - -void JournalQueueAck::setDestination(p destination) -{ - this->destination = destination ; -} - - -p JournalQueueAck::getMessageAck() -{ - return messageAck ; -} - -void JournalQueueAck::setMessageAck(p messageAck) -{ - this->messageAck = messageAck ; -} - -int JournalQueueAck::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObject(messageAck, mode, writer) ; - return size ; -} - -void JournalQueueAck::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - messageAck = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/JournalQueueAck.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for JournalQueueAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +JournalQueueAck::JournalQueueAck() +{ + this->destination = NULL ; + this->messageAck = NULL ; +} + +JournalQueueAck::~JournalQueueAck() +{ +} + +unsigned char JournalQueueAck::getDataStructureType() +{ + return JournalQueueAck::TYPE ; +} + + +p JournalQueueAck::getDestination() +{ + return destination ; +} + +void JournalQueueAck::setDestination(p destination) +{ + this->destination = destination ; +} + + +p JournalQueueAck::getMessageAck() +{ + return messageAck ; +} + +void JournalQueueAck::setMessageAck(p messageAck) +{ + this->messageAck = messageAck ; +} + +int JournalQueueAck::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObject(messageAck, mode, ostream) ; + return size ; +} + +void JournalQueueAck::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + messageAck = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.hpp b/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.hpp index b18868387d..0ee569edb0 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalQueueAck.hpp @@ -1,88 +1,89 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_JournalQueueAck_hpp_ -#define ActiveMQ_JournalQueueAck_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/MessageAck.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for JournalQueueAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class JournalQueueAck : public AbstractCommand -{ -protected: - p destination ; - p messageAck ; - -public: - const static unsigned char TYPE = 52; - -public: - JournalQueueAck() ; - virtual ~JournalQueueAck() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getMessageAck() ; - virtual void setMessageAck(p messageAck) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_JournalQueueAck_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_JournalQueueAck_hpp_ +#define ActiveMQ_JournalQueueAck_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/MessageAck.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for JournalQueueAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class JournalQueueAck : public BaseDataStructure +{ +protected: + p destination ; + p messageAck ; + +public: + const static unsigned char TYPE = 52; + +public: + JournalQueueAck() ; + virtual ~JournalQueueAck() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getMessageAck() ; + virtual void setMessageAck(p messageAck) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_JournalQueueAck_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.cpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.cpp index 3b09210509..8326aea02b 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.cpp @@ -1,141 +1,139 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/JournalTopicAck.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for JournalTopicAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -JournalTopicAck::JournalTopicAck() -{ - this->destination = NULL ; - this->messageId = NULL ; - this->messageSequenceId = 0 ; - this->subscritionName = NULL ; - this->clientId = NULL ; - this->transactionId = NULL ; -} - -JournalTopicAck::~JournalTopicAck() -{ -} - -unsigned char JournalTopicAck::getDataStructureType() -{ - return JournalTopicAck::TYPE ; -} - - -p JournalTopicAck::getDestination() -{ - return destination ; -} - -void JournalTopicAck::setDestination(p destination) -{ - this->destination = destination ; -} - - -p JournalTopicAck::getMessageId() -{ - return messageId ; -} - -void JournalTopicAck::setMessageId(p messageId) -{ - this->messageId = messageId ; -} - - -long long JournalTopicAck::getMessageSequenceId() -{ - return messageSequenceId ; -} - -void JournalTopicAck::setMessageSequenceId(long long messageSequenceId) -{ - this->messageSequenceId = messageSequenceId ; -} - - -p JournalTopicAck::getSubscritionName() -{ - return subscritionName ; -} - -void JournalTopicAck::setSubscritionName(p subscritionName) -{ - this->subscritionName = subscritionName ; -} - - -p JournalTopicAck::getClientId() -{ - return clientId ; -} - -void JournalTopicAck::setClientId(p clientId) -{ - this->clientId = clientId ; -} - - -p JournalTopicAck::getTransactionId() -{ - return transactionId ; -} - -void JournalTopicAck::setTransactionId(p transactionId) -{ - this->transactionId = transactionId ; -} - -int JournalTopicAck::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObject(messageId, mode, writer) ; - size += marshaller->marshalLong(messageSequenceId, mode, writer) ; - size += marshaller->marshalString(subscritionName, mode, writer) ; - size += marshaller->marshalString(clientId, mode, writer) ; - size += marshaller->marshalObject(transactionId, mode, writer) ; - return size ; -} - -void JournalTopicAck::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - messageId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - messageSequenceId = (marshaller->unmarshalLong(mode, reader)) ; - subscritionName = p_cast(marshaller->unmarshalString(mode, reader)) ; - clientId = p_cast(marshaller->unmarshalString(mode, reader)) ; - transactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/JournalTopicAck.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for JournalTopicAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +JournalTopicAck::JournalTopicAck() +{ + this->destination = NULL ; + this->messageId = NULL ; + this->messageSequenceId = 0 ; + this->subscritionName = NULL ; + this->clientId = NULL ; + this->transactionId = NULL ; +} + +JournalTopicAck::~JournalTopicAck() +{ +} + +unsigned char JournalTopicAck::getDataStructureType() +{ + return JournalTopicAck::TYPE ; +} + + +p JournalTopicAck::getDestination() +{ + return destination ; +} + +void JournalTopicAck::setDestination(p destination) +{ + this->destination = destination ; +} + + +p JournalTopicAck::getMessageId() +{ + return messageId ; +} + +void JournalTopicAck::setMessageId(p messageId) +{ + this->messageId = messageId ; +} + + +long long JournalTopicAck::getMessageSequenceId() +{ + return messageSequenceId ; +} + +void JournalTopicAck::setMessageSequenceId(long long messageSequenceId) +{ + this->messageSequenceId = messageSequenceId ; +} + + +p JournalTopicAck::getSubscritionName() +{ + return subscritionName ; +} + +void JournalTopicAck::setSubscritionName(p subscritionName) +{ + this->subscritionName = subscritionName ; +} + + +p JournalTopicAck::getClientId() +{ + return clientId ; +} + +void JournalTopicAck::setClientId(p clientId) +{ + this->clientId = clientId ; +} + + +p JournalTopicAck::getTransactionId() +{ + return transactionId ; +} + +void JournalTopicAck::setTransactionId(p transactionId) +{ + this->transactionId = transactionId ; +} + +int JournalTopicAck::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObject(messageId, mode, ostream) ; + size += marshaller->marshalLong(messageSequenceId, mode, ostream) ; + size += marshaller->marshalString(subscritionName, mode, ostream) ; + size += marshaller->marshalString(clientId, mode, ostream) ; + size += marshaller->marshalObject(transactionId, mode, ostream) ; + return size ; +} + +void JournalTopicAck::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + messageId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + messageSequenceId = (marshaller->unmarshalLong(mode, istream)) ; + subscritionName = p_cast(marshaller->unmarshalString(mode, istream)) ; + clientId = p_cast(marshaller->unmarshalString(mode, istream)) ; + transactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.hpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.hpp index 4059cd6933..f885bad978 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTopicAck.hpp @@ -1,105 +1,106 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_JournalTopicAck_hpp_ -#define ActiveMQ_JournalTopicAck_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/MessageId.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for JournalTopicAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class JournalTopicAck : public AbstractCommand -{ -protected: - p destination ; - p messageId ; - long long messageSequenceId ; - p subscritionName ; - p clientId ; - p transactionId ; - -public: - const static unsigned char TYPE = 50; - -public: - JournalTopicAck() ; - virtual ~JournalTopicAck() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getMessageId() ; - virtual void setMessageId(p messageId) ; - - virtual long long getMessageSequenceId() ; - virtual void setMessageSequenceId(long long messageSequenceId) ; - - virtual p getSubscritionName() ; - virtual void setSubscritionName(p subscritionName) ; - - virtual p getClientId() ; - virtual void setClientId(p clientId) ; - - virtual p getTransactionId() ; - virtual void setTransactionId(p transactionId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_JournalTopicAck_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_JournalTopicAck_hpp_ +#define ActiveMQ_JournalTopicAck_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/MessageId.hpp" +#include "activemq/command/TransactionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for JournalTopicAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class JournalTopicAck : public BaseDataStructure +{ +protected: + p destination ; + p messageId ; + long long messageSequenceId ; + p subscritionName ; + p clientId ; + p transactionId ; + +public: + const static unsigned char TYPE = 50; + +public: + JournalTopicAck() ; + virtual ~JournalTopicAck() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getMessageId() ; + virtual void setMessageId(p messageId) ; + + virtual long long getMessageSequenceId() ; + virtual void setMessageSequenceId(long long messageSequenceId) ; + + virtual p getSubscritionName() ; + virtual void setSubscritionName(p subscritionName) ; + + virtual p getClientId() ; + virtual void setClientId(p clientId) ; + + virtual p getTransactionId() ; + virtual void setTransactionId(p transactionId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_JournalTopicAck_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.cpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.cpp index d19e10f343..5dc3154992 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/JournalTrace.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for JournalTrace - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -JournalTrace::JournalTrace() -{ - this->message = NULL ; -} - -JournalTrace::~JournalTrace() -{ -} - -unsigned char JournalTrace::getDataStructureType() -{ - return JournalTrace::TYPE ; -} - - -p JournalTrace::getMessage() -{ - return message ; -} - -void JournalTrace::setMessage(p message) -{ - this->message = message ; -} - -int JournalTrace::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalString(message, mode, writer) ; - return size ; -} - -void JournalTrace::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - message = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/JournalTrace.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for JournalTrace + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +JournalTrace::JournalTrace() +{ + this->message = NULL ; +} + +JournalTrace::~JournalTrace() +{ +} + +unsigned char JournalTrace::getDataStructureType() +{ + return JournalTrace::TYPE ; +} + + +p JournalTrace::getMessage() +{ + return message ; +} + +void JournalTrace::setMessage(p message) +{ + this->message = message ; +} + +int JournalTrace::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(message, mode, ostream) ; + return size ; +} + +void JournalTrace::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + message = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.hpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.hpp index 8c7eb308bd..ca3a648363 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTrace.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_JournalTrace_hpp_ -#define ActiveMQ_JournalTrace_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for JournalTrace - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class JournalTrace : public AbstractCommand -{ -protected: - p message ; - -public: - const static unsigned char TYPE = 53; - -public: - JournalTrace() ; - virtual ~JournalTrace() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getMessage() ; - virtual void setMessage(p message) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_JournalTrace_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_JournalTrace_hpp_ +#define ActiveMQ_JournalTrace_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for JournalTrace + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class JournalTrace : public BaseDataStructure +{ +protected: + p message ; + +public: + const static unsigned char TYPE = 53; + +public: + JournalTrace() ; + virtual ~JournalTrace() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getMessage() ; + virtual void setMessage(p message) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_JournalTrace_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.cpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.cpp index 367b38cb0f..a50860524d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.cpp @@ -1,99 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/JournalTransaction.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for JournalTransaction - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -JournalTransaction::JournalTransaction() -{ - this->transactionId = NULL ; - this->type = 0 ; - this->wasPrepared = false ; -} - -JournalTransaction::~JournalTransaction() -{ -} - -unsigned char JournalTransaction::getDataStructureType() -{ - return JournalTransaction::TYPE ; -} - - -p JournalTransaction::getTransactionId() -{ - return transactionId ; -} - -void JournalTransaction::setTransactionId(p transactionId) -{ - this->transactionId = transactionId ; -} - - -char JournalTransaction::getType() -{ - return type ; -} - -void JournalTransaction::setType(char type) -{ - this->type = type ; -} - - -bool JournalTransaction::getWasPrepared() -{ - return wasPrepared ; -} - -void JournalTransaction::setWasPrepared(bool wasPrepared) -{ - this->wasPrepared = wasPrepared ; -} - -int JournalTransaction::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(transactionId, mode, writer) ; - size += marshaller->marshalByte(type, mode, writer) ; - size += marshaller->marshalBoolean(wasPrepared, mode, writer) ; - return size ; -} - -void JournalTransaction::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - transactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - type = (marshaller->unmarshalByte(mode, reader)) ; - wasPrepared = (marshaller->unmarshalBoolean(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/JournalTransaction.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for JournalTransaction + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +JournalTransaction::JournalTransaction() +{ + this->transactionId = NULL ; + this->type = 0 ; + this->wasPrepared = false ; +} + +JournalTransaction::~JournalTransaction() +{ +} + +unsigned char JournalTransaction::getDataStructureType() +{ + return JournalTransaction::TYPE ; +} + + +p JournalTransaction::getTransactionId() +{ + return transactionId ; +} + +void JournalTransaction::setTransactionId(p transactionId) +{ + this->transactionId = transactionId ; +} + + +char JournalTransaction::getType() +{ + return type ; +} + +void JournalTransaction::setType(char type) +{ + this->type = type ; +} + + +bool JournalTransaction::getWasPrepared() +{ + return wasPrepared ; +} + +void JournalTransaction::setWasPrepared(bool wasPrepared) +{ + this->wasPrepared = wasPrepared ; +} + +int JournalTransaction::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(transactionId, mode, ostream) ; + size += marshaller->marshalByte(type, mode, ostream) ; + size += marshaller->marshalBoolean(wasPrepared, mode, ostream) ; + return size ; +} + +void JournalTransaction::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + transactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + type = (marshaller->unmarshalByte(mode, istream)) ; + wasPrepared = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.hpp b/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.hpp index 996632fcd4..2e8de85a56 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/JournalTransaction.hpp @@ -1,91 +1,92 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_JournalTransaction_hpp_ -#define ActiveMQ_JournalTransaction_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for JournalTransaction - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class JournalTransaction : public AbstractCommand -{ -protected: - p transactionId ; - char type ; - bool wasPrepared ; - -public: - const static unsigned char TYPE = 54; - -public: - JournalTransaction() ; - virtual ~JournalTransaction() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getTransactionId() ; - virtual void setTransactionId(p transactionId) ; - - virtual char getType() ; - virtual void setType(char type) ; - - virtual bool getWasPrepared() ; - virtual void setWasPrepared(bool wasPrepared) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_JournalTransaction_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_JournalTransaction_hpp_ +#define ActiveMQ_JournalTransaction_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/TransactionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for JournalTransaction + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class JournalTransaction : public BaseDataStructure +{ +protected: + p transactionId ; + char type ; + bool wasPrepared ; + +public: + const static unsigned char TYPE = 54; + +public: + JournalTransaction() ; + virtual ~JournalTransaction() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getTransactionId() ; + virtual void setTransactionId(p transactionId) ; + + virtual char getType() ; + virtual void setType(char type) ; + + virtual bool getWasPrepared() ; + virtual void setWasPrepared(bool wasPrepared) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_JournalTransaction_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.cpp index 543cbc2e44..80533e4865 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.cpp @@ -1,57 +1,55 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/KeepAliveInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for KeepAliveInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -KeepAliveInfo::KeepAliveInfo() -{ -} - -KeepAliveInfo::~KeepAliveInfo() -{ -} - -unsigned char KeepAliveInfo::getDataStructureType() -{ - return KeepAliveInfo::TYPE ; -} - -int KeepAliveInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - return size ; -} - -void KeepAliveInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/KeepAliveInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for KeepAliveInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +KeepAliveInfo::KeepAliveInfo() +{ +} + +KeepAliveInfo::~KeepAliveInfo() +{ +} + +unsigned char KeepAliveInfo::getDataStructureType() +{ + return KeepAliveInfo::TYPE ; +} + +int KeepAliveInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + return size ; +} + +void KeepAliveInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.hpp index 85fa7ea57d..485c3c103b 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/KeepAliveInfo.hpp @@ -1,78 +1,79 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_KeepAliveInfo_hpp_ -#define ActiveMQ_KeepAliveInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for KeepAliveInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class KeepAliveInfo : public AbstractCommand -{ -protected: - -public: - const static unsigned char TYPE = 10; - -public: - KeepAliveInfo() ; - virtual ~KeepAliveInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_KeepAliveInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_KeepAliveInfo_hpp_ +#define ActiveMQ_KeepAliveInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for KeepAliveInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class KeepAliveInfo : public BaseCommand +{ +protected: + +public: + const static unsigned char TYPE = 10; + +public: + KeepAliveInfo() ; + virtual ~KeepAliveInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_KeepAliveInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.cpp new file mode 100644 index 0000000000..05616f1f82 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.cpp @@ -0,0 +1,55 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/LastPartialCommand.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for LastPartialCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +LastPartialCommand::LastPartialCommand() +{ +} + +LastPartialCommand::~LastPartialCommand() +{ +} + +unsigned char LastPartialCommand::getDataStructureType() +{ + return LastPartialCommand::TYPE ; +} + +int LastPartialCommand::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += PartialCommand::marshal(marshaller, mode, ostream) ; + return size ; +} + +void LastPartialCommand::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + PartialCommand::unmarshal(marshaller, mode, istream) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.hpp new file mode 100644 index 0000000000..4355421026 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/LastPartialCommand.hpp @@ -0,0 +1,79 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_LastPartialCommand_hpp_ +#define ActiveMQ_LastPartialCommand_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/PartialCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for LastPartialCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class LastPartialCommand : public PartialCommand +{ +protected: + +public: + const static unsigned char TYPE = 61; + +public: + LastPartialCommand() ; + virtual ~LastPartialCommand() ; + + virtual unsigned char getDataStructureType() ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_LastPartialCommand_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.cpp b/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.cpp index 99eb90a0b0..db834fda11 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.cpp @@ -1,81 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/LocalTransactionId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for LocalTransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -LocalTransactionId::LocalTransactionId() -{ - this->value = 0 ; - this->connectionId = NULL ; -} - -LocalTransactionId::~LocalTransactionId() -{ -} - -unsigned char LocalTransactionId::getDataStructureType() -{ - return LocalTransactionId::TYPE ; -} - - -long long LocalTransactionId::getValue() -{ - return value ; -} - -void LocalTransactionId::setValue(long long value) -{ - this->value = value ; -} - - -p LocalTransactionId::getConnectionId() -{ - return connectionId ; -} - -void LocalTransactionId::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - -int LocalTransactionId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalLong(value, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - return size ; -} - -void LocalTransactionId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - value = (marshaller->unmarshalLong(mode, reader)) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/LocalTransactionId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for LocalTransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +LocalTransactionId::LocalTransactionId() +{ + this->value = 0 ; + this->connectionId = NULL ; +} + +LocalTransactionId::~LocalTransactionId() +{ +} + +unsigned char LocalTransactionId::getDataStructureType() +{ + return LocalTransactionId::TYPE ; +} + + +long long LocalTransactionId::getValue() +{ + return value ; +} + +void LocalTransactionId::setValue(long long value) +{ + this->value = value ; +} + + +p LocalTransactionId::getConnectionId() +{ + return connectionId ; +} + +void LocalTransactionId::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + +int LocalTransactionId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += TransactionId::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalLong(value, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + return size ; +} + +void LocalTransactionId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + TransactionId::unmarshal(marshaller, mode, istream) ; + value = (marshaller->unmarshalLong(mode, istream)) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.hpp b/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.hpp index 06b2dfaf9a..ce51ba0275 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/LocalTransactionId.hpp @@ -1,87 +1,88 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_LocalTransactionId_hpp_ -#define ActiveMQ_LocalTransactionId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/TransactionId.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for LocalTransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class LocalTransactionId : public TransactionId -{ -protected: - long long value ; - p connectionId ; - -public: - const static unsigned char TYPE = 111; - -public: - LocalTransactionId() ; - virtual ~LocalTransactionId() ; - - virtual unsigned char getDataStructureType() ; - - virtual long long getValue() ; - virtual void setValue(long long value) ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_LocalTransactionId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_LocalTransactionId_hpp_ +#define ActiveMQ_LocalTransactionId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/TransactionId.hpp" +#include "activemq/command/ConnectionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for LocalTransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class LocalTransactionId : public TransactionId +{ +protected: + long long value ; + p connectionId ; + +public: + const static unsigned char TYPE = 111; + +public: + LocalTransactionId() ; + virtual ~LocalTransactionId() ; + + virtual unsigned char getDataStructureType() ; + + virtual long long getValue() ; + virtual void setValue(long long value) ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_LocalTransactionId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/Message.cpp b/openwire-cpp/src/main/cpp/activemq/command/Message.cpp index f9910035eb..3eecc64a6d 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/Message.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/Message.cpp @@ -1,407 +1,405 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/Message.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for Message - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -Message::Message() -{ - this->producerId = NULL ; - this->destination = NULL ; - this->transactionId = NULL ; - this->originalDestination = NULL ; - this->messageId = NULL ; - this->originalTransactionId = NULL ; - this->groupID = NULL ; - this->groupSequence = 0 ; - this->correlationId = NULL ; - this->persistent = false ; - this->expiration = 0 ; - this->priority = 0 ; - this->replyTo = NULL ; - this->timestamp = 0 ; - this->type = NULL ; - this->content = NULL ; - this->marshalledProperties = NULL ; - this->dataStructure = NULL ; - this->targetConsumerId = NULL ; - this->compressed = false ; - this->redeliveryCounter = 0 ; - this->brokerPath = NULL ; - this->arrival = 0 ; - this->userID = NULL ; - this->recievedByDFBridge = false ; -} - -Message::~Message() -{ -} - -unsigned char Message::getDataStructureType() -{ - return Message::TYPE ; -} - - -p Message::getProducerId() -{ - return producerId ; -} - -void Message::setProducerId(p producerId) -{ - this->producerId = producerId ; -} - - -p Message::getDestination() -{ - return destination ; -} - -void Message::setDestination(p destination) -{ - this->destination = destination ; -} - - -p Message::getTransactionId() -{ - return transactionId ; -} - -void Message::setTransactionId(p transactionId) -{ - this->transactionId = transactionId ; -} - - -p Message::getOriginalDestination() -{ - return originalDestination ; -} - -void Message::setOriginalDestination(p originalDestination) -{ - this->originalDestination = originalDestination ; -} - - -p Message::getMessageId() -{ - return messageId ; -} - -void Message::setMessageId(p messageId) -{ - this->messageId = messageId ; -} - - -p Message::getOriginalTransactionId() -{ - return originalTransactionId ; -} - -void Message::setOriginalTransactionId(p originalTransactionId) -{ - this->originalTransactionId = originalTransactionId ; -} - - -p Message::getGroupID() -{ - return groupID ; -} - -void Message::setGroupID(p groupID) -{ - this->groupID = groupID ; -} - - -int Message::getGroupSequence() -{ - return groupSequence ; -} - -void Message::setGroupSequence(int groupSequence) -{ - this->groupSequence = groupSequence ; -} - - -p Message::getCorrelationId() -{ - return correlationId ; -} - -void Message::setCorrelationId(p correlationId) -{ - this->correlationId = correlationId ; -} - - -bool Message::getPersistent() -{ - return persistent ; -} - -void Message::setPersistent(bool persistent) -{ - this->persistent = persistent ; -} - - -long long Message::getExpiration() -{ - return expiration ; -} - -void Message::setExpiration(long long expiration) -{ - this->expiration = expiration ; -} - - -char Message::getPriority() -{ - return priority ; -} - -void Message::setPriority(char priority) -{ - this->priority = priority ; -} - - -p Message::getReplyTo() -{ - return replyTo ; -} - -void Message::setReplyTo(p replyTo) -{ - this->replyTo = replyTo ; -} - - -long long Message::getTimestamp() -{ - return timestamp ; -} - -void Message::setTimestamp(long long timestamp) -{ - this->timestamp = timestamp ; -} - - -p Message::getType() -{ - return type ; -} - -void Message::setType(p type) -{ - this->type = type ; -} - - -array Message::getContent() -{ - return content ; -} - -void Message::setContent(array content) -{ - this->content = content ; -} - - -array Message::getMarshalledProperties() -{ - return marshalledProperties ; -} - -void Message::setMarshalledProperties(array marshalledProperties) -{ - this->marshalledProperties = marshalledProperties ; -} - - -p Message::getDataStructure() -{ - return dataStructure ; -} - -void Message::setDataStructure(p dataStructure) -{ - this->dataStructure = dataStructure ; -} - - -p Message::getTargetConsumerId() -{ - return targetConsumerId ; -} - -void Message::setTargetConsumerId(p targetConsumerId) -{ - this->targetConsumerId = targetConsumerId ; -} - - -bool Message::getCompressed() -{ - return compressed ; -} - -void Message::setCompressed(bool compressed) -{ - this->compressed = compressed ; -} - - -int Message::getRedeliveryCounter() -{ - return redeliveryCounter ; -} - -void Message::setRedeliveryCounter(int redeliveryCounter) -{ - this->redeliveryCounter = redeliveryCounter ; -} - - -array Message::getBrokerPath() -{ - return brokerPath ; -} - -void Message::setBrokerPath(array brokerPath) -{ - this->brokerPath = brokerPath ; -} - - -long long Message::getArrival() -{ - return arrival ; -} - -void Message::setArrival(long long arrival) -{ - this->arrival = arrival ; -} - - -p Message::getUserID() -{ - return userID ; -} - -void Message::setUserID(p userID) -{ - this->userID = userID ; -} - - -bool Message::getRecievedByDFBridge() -{ - return recievedByDFBridge ; -} - -void Message::setRecievedByDFBridge(bool recievedByDFBridge) -{ - this->recievedByDFBridge = recievedByDFBridge ; -} - -int Message::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(producerId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObject(transactionId, mode, writer) ; - size += marshaller->marshalObject(originalDestination, mode, writer) ; - size += marshaller->marshalObject(messageId, mode, writer) ; - size += marshaller->marshalObject(originalTransactionId, mode, writer) ; - size += marshaller->marshalString(groupID, mode, writer) ; - size += marshaller->marshalInt(groupSequence, mode, writer) ; - size += marshaller->marshalString(correlationId, mode, writer) ; - size += marshaller->marshalBoolean(persistent, mode, writer) ; - size += marshaller->marshalLong(expiration, mode, writer) ; - size += marshaller->marshalByte(priority, mode, writer) ; - size += marshaller->marshalObject(replyTo, mode, writer) ; - size += marshaller->marshalLong(timestamp, mode, writer) ; - size += marshaller->marshalString(type, mode, writer) ; - size += marshaller->marshalByteArray(content, mode, writer) ; - size += marshaller->marshalByteArray(marshalledProperties, mode, writer) ; - size += marshaller->marshalObject(dataStructure, mode, writer) ; - size += marshaller->marshalObject(targetConsumerId, mode, writer) ; - size += marshaller->marshalBoolean(compressed, mode, writer) ; - size += marshaller->marshalInt(redeliveryCounter, mode, writer) ; - size += marshaller->marshalObjectArray(brokerPath, mode, writer) ; - size += marshaller->marshalLong(arrival, mode, writer) ; - size += marshaller->marshalString(userID, mode, writer) ; - size += marshaller->marshalBoolean(recievedByDFBridge, mode, writer) ; - return size ; -} - -void Message::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - producerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - transactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - originalDestination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - messageId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - originalTransactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - groupID = p_cast(marshaller->unmarshalString(mode, reader)) ; - groupSequence = (marshaller->unmarshalInt(mode, reader)) ; - correlationId = p_cast(marshaller->unmarshalString(mode, reader)) ; - persistent = (marshaller->unmarshalBoolean(mode, reader)) ; - expiration = (marshaller->unmarshalLong(mode, reader)) ; - priority = (marshaller->unmarshalByte(mode, reader)) ; - replyTo = p_cast(marshaller->unmarshalObject(mode, reader)) ; - timestamp = (marshaller->unmarshalLong(mode, reader)) ; - type = p_cast(marshaller->unmarshalString(mode, reader)) ; - content = (marshaller->unmarshalByteArray(mode, reader)) ; - marshalledProperties = (marshaller->unmarshalByteArray(mode, reader)) ; - dataStructure = p_cast(marshaller->unmarshalObject(mode, reader)) ; - targetConsumerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - compressed = (marshaller->unmarshalBoolean(mode, reader)) ; - redeliveryCounter = (marshaller->unmarshalInt(mode, reader)) ; - brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; - arrival = (marshaller->unmarshalLong(mode, reader)) ; - userID = p_cast(marshaller->unmarshalString(mode, reader)) ; - recievedByDFBridge = (marshaller->unmarshalBoolean(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/Message.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for Message + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +Message::Message() +{ + this->producerId = NULL ; + this->destination = NULL ; + this->transactionId = NULL ; + this->originalDestination = NULL ; + this->messageId = NULL ; + this->originalTransactionId = NULL ; + this->groupID = NULL ; + this->groupSequence = 0 ; + this->correlationId = NULL ; + this->persistent = false ; + this->expiration = 0 ; + this->priority = 0 ; + this->replyTo = NULL ; + this->timestamp = 0 ; + this->type = NULL ; + this->content = NULL ; + this->marshalledProperties = NULL ; + this->dataStructure = NULL ; + this->targetConsumerId = NULL ; + this->compressed = false ; + this->redeliveryCounter = 0 ; + this->brokerPath = NULL ; + this->arrival = 0 ; + this->userID = NULL ; + this->recievedByDFBridge = false ; +} + +Message::~Message() +{ +} + +unsigned char Message::getDataStructureType() +{ + return Message::TYPE ; +} + + +p Message::getProducerId() +{ + return producerId ; +} + +void Message::setProducerId(p producerId) +{ + this->producerId = producerId ; +} + + +p Message::getDestination() +{ + return destination ; +} + +void Message::setDestination(p destination) +{ + this->destination = destination ; +} + + +p Message::getTransactionId() +{ + return transactionId ; +} + +void Message::setTransactionId(p transactionId) +{ + this->transactionId = transactionId ; +} + + +p Message::getOriginalDestination() +{ + return originalDestination ; +} + +void Message::setOriginalDestination(p originalDestination) +{ + this->originalDestination = originalDestination ; +} + + +p Message::getMessageId() +{ + return messageId ; +} + +void Message::setMessageId(p messageId) +{ + this->messageId = messageId ; +} + + +p Message::getOriginalTransactionId() +{ + return originalTransactionId ; +} + +void Message::setOriginalTransactionId(p originalTransactionId) +{ + this->originalTransactionId = originalTransactionId ; +} + + +p Message::getGroupID() +{ + return groupID ; +} + +void Message::setGroupID(p groupID) +{ + this->groupID = groupID ; +} + + +int Message::getGroupSequence() +{ + return groupSequence ; +} + +void Message::setGroupSequence(int groupSequence) +{ + this->groupSequence = groupSequence ; +} + + +p Message::getCorrelationId() +{ + return correlationId ; +} + +void Message::setCorrelationId(p correlationId) +{ + this->correlationId = correlationId ; +} + + +bool Message::getPersistent() +{ + return persistent ; +} + +void Message::setPersistent(bool persistent) +{ + this->persistent = persistent ; +} + + +long long Message::getExpiration() +{ + return expiration ; +} + +void Message::setExpiration(long long expiration) +{ + this->expiration = expiration ; +} + + +char Message::getPriority() +{ + return priority ; +} + +void Message::setPriority(char priority) +{ + this->priority = priority ; +} + + +p Message::getReplyTo() +{ + return replyTo ; +} + +void Message::setReplyTo(p replyTo) +{ + this->replyTo = replyTo ; +} + + +long long Message::getTimestamp() +{ + return timestamp ; +} + +void Message::setTimestamp(long long timestamp) +{ + this->timestamp = timestamp ; +} + + +p Message::getType() +{ + return type ; +} + +void Message::setType(p type) +{ + this->type = type ; +} + + +array Message::getContent() +{ + return content ; +} + +void Message::setContent(array content) +{ + this->content = content ; +} + + +array Message::getMarshalledProperties() +{ + return marshalledProperties ; +} + +void Message::setMarshalledProperties(array marshalledProperties) +{ + this->marshalledProperties = marshalledProperties ; +} + + +p Message::getDataStructure() +{ + return dataStructure ; +} + +void Message::setDataStructure(p dataStructure) +{ + this->dataStructure = dataStructure ; +} + + +p Message::getTargetConsumerId() +{ + return targetConsumerId ; +} + +void Message::setTargetConsumerId(p targetConsumerId) +{ + this->targetConsumerId = targetConsumerId ; +} + + +bool Message::getCompressed() +{ + return compressed ; +} + +void Message::setCompressed(bool compressed) +{ + this->compressed = compressed ; +} + + +int Message::getRedeliveryCounter() +{ + return redeliveryCounter ; +} + +void Message::setRedeliveryCounter(int redeliveryCounter) +{ + this->redeliveryCounter = redeliveryCounter ; +} + + +array Message::getBrokerPath() +{ + return brokerPath ; +} + +void Message::setBrokerPath(array brokerPath) +{ + this->brokerPath = brokerPath ; +} + + +long long Message::getArrival() +{ + return arrival ; +} + +void Message::setArrival(long long arrival) +{ + this->arrival = arrival ; +} + + +p Message::getUserID() +{ + return userID ; +} + +void Message::setUserID(p userID) +{ + this->userID = userID ; +} + + +bool Message::getRecievedByDFBridge() +{ + return recievedByDFBridge ; +} + +void Message::setRecievedByDFBridge(bool recievedByDFBridge) +{ + this->recievedByDFBridge = recievedByDFBridge ; +} + +int Message::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(producerId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObject(transactionId, mode, ostream) ; + size += marshaller->marshalObject(originalDestination, mode, ostream) ; + size += marshaller->marshalObject(messageId, mode, ostream) ; + size += marshaller->marshalObject(originalTransactionId, mode, ostream) ; + size += marshaller->marshalString(groupID, mode, ostream) ; + size += marshaller->marshalInt(groupSequence, mode, ostream) ; + size += marshaller->marshalString(correlationId, mode, ostream) ; + size += marshaller->marshalBoolean(persistent, mode, ostream) ; + size += marshaller->marshalLong(expiration, mode, ostream) ; + size += marshaller->marshalByte(priority, mode, ostream) ; + size += marshaller->marshalObject(replyTo, mode, ostream) ; + size += marshaller->marshalLong(timestamp, mode, ostream) ; + size += marshaller->marshalString(type, mode, ostream) ; + size += marshaller->marshalByteArray(content, mode, ostream) ; + size += marshaller->marshalByteArray(marshalledProperties, mode, ostream) ; + size += marshaller->marshalObject(dataStructure, mode, ostream) ; + size += marshaller->marshalObject(targetConsumerId, mode, ostream) ; + size += marshaller->marshalBoolean(compressed, mode, ostream) ; + size += marshaller->marshalInt(redeliveryCounter, mode, ostream) ; + size += marshaller->marshalObjectArray(brokerPath, mode, ostream) ; + size += marshaller->marshalLong(arrival, mode, ostream) ; + size += marshaller->marshalString(userID, mode, ostream) ; + size += marshaller->marshalBoolean(recievedByDFBridge, mode, ostream) ; + return size ; +} + +void Message::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + producerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + transactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + originalDestination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + messageId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + originalTransactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + groupID = p_cast(marshaller->unmarshalString(mode, istream)) ; + groupSequence = (marshaller->unmarshalInt(mode, istream)) ; + correlationId = p_cast(marshaller->unmarshalString(mode, istream)) ; + persistent = (marshaller->unmarshalBoolean(mode, istream)) ; + expiration = (marshaller->unmarshalLong(mode, istream)) ; + priority = (marshaller->unmarshalByte(mode, istream)) ; + replyTo = p_cast(marshaller->unmarshalObject(mode, istream)) ; + timestamp = (marshaller->unmarshalLong(mode, istream)) ; + type = p_cast(marshaller->unmarshalString(mode, istream)) ; + content = (marshaller->unmarshalByteArray(mode, istream)) ; + marshalledProperties = (marshaller->unmarshalByteArray(mode, istream)) ; + dataStructure = p_cast(marshaller->unmarshalObject(mode, istream)) ; + targetConsumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + compressed = (marshaller->unmarshalBoolean(mode, istream)) ; + redeliveryCounter = (marshaller->unmarshalInt(mode, istream)) ; + brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; + arrival = (marshaller->unmarshalLong(mode, istream)) ; + userID = p_cast(marshaller->unmarshalString(mode, istream)) ; + recievedByDFBridge = (marshaller->unmarshalBoolean(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/Message.hpp b/openwire-cpp/src/main/cpp/activemq/command/Message.hpp index c5cc2ec527..85bca7af07 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/Message.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/Message.hpp @@ -1,188 +1,189 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_Message_hpp_ -#define ActiveMQ_Message_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/IDataStructure.hpp" -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ProducerId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/MessageId.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/ConsumerId.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for Message - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class Message : public BaseCommand -{ -protected: - p producerId ; - p destination ; - p transactionId ; - p originalDestination ; - p messageId ; - p originalTransactionId ; - p groupID ; - int groupSequence ; - p correlationId ; - bool persistent ; - long long expiration ; - char priority ; - p replyTo ; - long long timestamp ; - p type ; - array content ; - array marshalledProperties ; - p dataStructure ; - p targetConsumerId ; - bool compressed ; - int redeliveryCounter ; - array brokerPath ; - long long arrival ; - p userID ; - bool recievedByDFBridge ; - -public: - const static unsigned char TYPE = 0; - -public: - Message() ; - virtual ~Message() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getProducerId() ; - virtual void setProducerId(p producerId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getTransactionId() ; - virtual void setTransactionId(p transactionId) ; - - virtual p getOriginalDestination() ; - virtual void setOriginalDestination(p originalDestination) ; - - virtual p getMessageId() ; - virtual void setMessageId(p messageId) ; - - virtual p getOriginalTransactionId() ; - virtual void setOriginalTransactionId(p originalTransactionId) ; - - virtual p getGroupID() ; - virtual void setGroupID(p groupID) ; - - virtual int getGroupSequence() ; - virtual void setGroupSequence(int groupSequence) ; - - virtual p getCorrelationId() ; - virtual void setCorrelationId(p correlationId) ; - - virtual bool getPersistent() ; - virtual void setPersistent(bool persistent) ; - - virtual long long getExpiration() ; - virtual void setExpiration(long long expiration) ; - - virtual char getPriority() ; - virtual void setPriority(char priority) ; - - virtual p getReplyTo() ; - virtual void setReplyTo(p replyTo) ; - - virtual long long getTimestamp() ; - virtual void setTimestamp(long long timestamp) ; - - virtual p getType() ; - virtual void setType(p type) ; - - virtual array getContent() ; - virtual void setContent(array content) ; - - virtual array getMarshalledProperties() ; - virtual void setMarshalledProperties(array marshalledProperties) ; - - virtual p getDataStructure() ; - virtual void setDataStructure(p dataStructure) ; - - virtual p getTargetConsumerId() ; - virtual void setTargetConsumerId(p targetConsumerId) ; - - virtual bool getCompressed() ; - virtual void setCompressed(bool compressed) ; - - virtual int getRedeliveryCounter() ; - virtual void setRedeliveryCounter(int redeliveryCounter) ; - - virtual array getBrokerPath() ; - virtual void setBrokerPath(array brokerPath) ; - - virtual long long getArrival() ; - virtual void setArrival(long long arrival) ; - - virtual p getUserID() ; - virtual void setUserID(p userID) ; - - virtual bool getRecievedByDFBridge() ; - virtual void setRecievedByDFBridge(bool recievedByDFBridge) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_Message_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_Message_hpp_ +#define ActiveMQ_Message_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ProducerId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/TransactionId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/MessageId.hpp" +#include "activemq/command/TransactionId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/IDataStructure.hpp" +#include "activemq/command/ConsumerId.hpp" +#include "activemq/command/BrokerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for Message + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class Message : public BaseCommand +{ +protected: + p producerId ; + p destination ; + p transactionId ; + p originalDestination ; + p messageId ; + p originalTransactionId ; + p groupID ; + int groupSequence ; + p correlationId ; + bool persistent ; + long long expiration ; + char priority ; + p replyTo ; + long long timestamp ; + p type ; + array content ; + array marshalledProperties ; + p dataStructure ; + p targetConsumerId ; + bool compressed ; + int redeliveryCounter ; + array brokerPath ; + long long arrival ; + p userID ; + bool recievedByDFBridge ; + +public: + const static unsigned char TYPE = 0; + +public: + Message() ; + virtual ~Message() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getProducerId() ; + virtual void setProducerId(p producerId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getTransactionId() ; + virtual void setTransactionId(p transactionId) ; + + virtual p getOriginalDestination() ; + virtual void setOriginalDestination(p originalDestination) ; + + virtual p getMessageId() ; + virtual void setMessageId(p messageId) ; + + virtual p getOriginalTransactionId() ; + virtual void setOriginalTransactionId(p originalTransactionId) ; + + virtual p getGroupID() ; + virtual void setGroupID(p groupID) ; + + virtual int getGroupSequence() ; + virtual void setGroupSequence(int groupSequence) ; + + virtual p getCorrelationId() ; + virtual void setCorrelationId(p correlationId) ; + + virtual bool getPersistent() ; + virtual void setPersistent(bool persistent) ; + + virtual long long getExpiration() ; + virtual void setExpiration(long long expiration) ; + + virtual char getPriority() ; + virtual void setPriority(char priority) ; + + virtual p getReplyTo() ; + virtual void setReplyTo(p replyTo) ; + + virtual long long getTimestamp() ; + virtual void setTimestamp(long long timestamp) ; + + virtual p getType() ; + virtual void setType(p type) ; + + virtual array getContent() ; + virtual void setContent(array content) ; + + virtual array getMarshalledProperties() ; + virtual void setMarshalledProperties(array marshalledProperties) ; + + virtual p getDataStructure() ; + virtual void setDataStructure(p dataStructure) ; + + virtual p getTargetConsumerId() ; + virtual void setTargetConsumerId(p targetConsumerId) ; + + virtual bool getCompressed() ; + virtual void setCompressed(bool compressed) ; + + virtual int getRedeliveryCounter() ; + virtual void setRedeliveryCounter(int redeliveryCounter) ; + + virtual array getBrokerPath() ; + virtual void setBrokerPath(array brokerPath) ; + + virtual long long getArrival() ; + virtual void setArrival(long long arrival) ; + + virtual p getUserID() ; + virtual void setUserID(p userID) ; + + virtual bool getRecievedByDFBridge() ; + virtual void setRecievedByDFBridge(bool recievedByDFBridge) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_Message_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageAck.cpp b/openwire-cpp/src/main/cpp/activemq/command/MessageAck.cpp index 0af9fdef10..1a95f9354a 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageAck.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageAck.cpp @@ -1,155 +1,153 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/MessageAck.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for MessageAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -MessageAck::MessageAck() -{ - this->destination = NULL ; - this->transactionId = NULL ; - this->consumerId = NULL ; - this->ackType = 0 ; - this->firstMessageId = NULL ; - this->lastMessageId = NULL ; - this->messageCount = 0 ; -} - -MessageAck::~MessageAck() -{ -} - -unsigned char MessageAck::getDataStructureType() -{ - return MessageAck::TYPE ; -} - - -p MessageAck::getDestination() -{ - return destination ; -} - -void MessageAck::setDestination(p destination) -{ - this->destination = destination ; -} - - -p MessageAck::getTransactionId() -{ - return transactionId ; -} - -void MessageAck::setTransactionId(p transactionId) -{ - this->transactionId = transactionId ; -} - - -p MessageAck::getConsumerId() -{ - return consumerId ; -} - -void MessageAck::setConsumerId(p consumerId) -{ - this->consumerId = consumerId ; -} - - -char MessageAck::getAckType() -{ - return ackType ; -} - -void MessageAck::setAckType(char ackType) -{ - this->ackType = ackType ; -} - - -p MessageAck::getFirstMessageId() -{ - return firstMessageId ; -} - -void MessageAck::setFirstMessageId(p firstMessageId) -{ - this->firstMessageId = firstMessageId ; -} - - -p MessageAck::getLastMessageId() -{ - return lastMessageId ; -} - -void MessageAck::setLastMessageId(p lastMessageId) -{ - this->lastMessageId = lastMessageId ; -} - - -int MessageAck::getMessageCount() -{ - return messageCount ; -} - -void MessageAck::setMessageCount(int messageCount) -{ - this->messageCount = messageCount ; -} - -int MessageAck::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObject(transactionId, mode, writer) ; - size += marshaller->marshalObject(consumerId, mode, writer) ; - size += marshaller->marshalByte(ackType, mode, writer) ; - size += marshaller->marshalObject(firstMessageId, mode, writer) ; - size += marshaller->marshalObject(lastMessageId, mode, writer) ; - size += marshaller->marshalInt(messageCount, mode, writer) ; - return size ; -} - -void MessageAck::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - transactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - consumerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - ackType = (marshaller->unmarshalByte(mode, reader)) ; - firstMessageId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - lastMessageId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - messageCount = (marshaller->unmarshalInt(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/MessageAck.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for MessageAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +MessageAck::MessageAck() +{ + this->destination = NULL ; + this->transactionId = NULL ; + this->consumerId = NULL ; + this->ackType = 0 ; + this->firstMessageId = NULL ; + this->lastMessageId = NULL ; + this->messageCount = 0 ; +} + +MessageAck::~MessageAck() +{ +} + +unsigned char MessageAck::getDataStructureType() +{ + return MessageAck::TYPE ; +} + + +p MessageAck::getDestination() +{ + return destination ; +} + +void MessageAck::setDestination(p destination) +{ + this->destination = destination ; +} + + +p MessageAck::getTransactionId() +{ + return transactionId ; +} + +void MessageAck::setTransactionId(p transactionId) +{ + this->transactionId = transactionId ; +} + + +p MessageAck::getConsumerId() +{ + return consumerId ; +} + +void MessageAck::setConsumerId(p consumerId) +{ + this->consumerId = consumerId ; +} + + +char MessageAck::getAckType() +{ + return ackType ; +} + +void MessageAck::setAckType(char ackType) +{ + this->ackType = ackType ; +} + + +p MessageAck::getFirstMessageId() +{ + return firstMessageId ; +} + +void MessageAck::setFirstMessageId(p firstMessageId) +{ + this->firstMessageId = firstMessageId ; +} + + +p MessageAck::getLastMessageId() +{ + return lastMessageId ; +} + +void MessageAck::setLastMessageId(p lastMessageId) +{ + this->lastMessageId = lastMessageId ; +} + + +int MessageAck::getMessageCount() +{ + return messageCount ; +} + +void MessageAck::setMessageCount(int messageCount) +{ + this->messageCount = messageCount ; +} + +int MessageAck::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObject(transactionId, mode, ostream) ; + size += marshaller->marshalObject(consumerId, mode, ostream) ; + size += marshaller->marshalByte(ackType, mode, ostream) ; + size += marshaller->marshalObject(firstMessageId, mode, ostream) ; + size += marshaller->marshalObject(lastMessageId, mode, ostream) ; + size += marshaller->marshalInt(messageCount, mode, ostream) ; + return size ; +} + +void MessageAck::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + transactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + consumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + ackType = (marshaller->unmarshalByte(mode, istream)) ; + firstMessageId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + lastMessageId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + messageCount = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageAck.hpp b/openwire-cpp/src/main/cpp/activemq/command/MessageAck.hpp index a8e977a97a..01afc99647 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageAck.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageAck.hpp @@ -1,111 +1,112 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_MessageAck_hpp_ -#define ActiveMQ_MessageAck_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/command/ConsumerId.hpp" -#include "activemq/command/MessageId.hpp" -#include "activemq/command/MessageId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for MessageAck - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class MessageAck : public BaseCommand -{ -protected: - p destination ; - p transactionId ; - p consumerId ; - char ackType ; - p firstMessageId ; - p lastMessageId ; - int messageCount ; - -public: - const static unsigned char TYPE = 22; - -public: - MessageAck() ; - virtual ~MessageAck() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getTransactionId() ; - virtual void setTransactionId(p transactionId) ; - - virtual p getConsumerId() ; - virtual void setConsumerId(p consumerId) ; - - virtual char getAckType() ; - virtual void setAckType(char ackType) ; - - virtual p getFirstMessageId() ; - virtual void setFirstMessageId(p firstMessageId) ; - - virtual p getLastMessageId() ; - virtual void setLastMessageId(p lastMessageId) ; - - virtual int getMessageCount() ; - virtual void setMessageCount(int messageCount) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_MessageAck_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_MessageAck_hpp_ +#define ActiveMQ_MessageAck_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/TransactionId.hpp" +#include "activemq/command/ConsumerId.hpp" +#include "activemq/command/MessageId.hpp" +#include "activemq/command/MessageId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for MessageAck + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class MessageAck : public BaseCommand +{ +protected: + p destination ; + p transactionId ; + p consumerId ; + char ackType ; + p firstMessageId ; + p lastMessageId ; + int messageCount ; + +public: + const static unsigned char TYPE = 22; + +public: + MessageAck() ; + virtual ~MessageAck() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getTransactionId() ; + virtual void setTransactionId(p transactionId) ; + + virtual p getConsumerId() ; + virtual void setConsumerId(p consumerId) ; + + virtual char getAckType() ; + virtual void setAckType(char ackType) ; + + virtual p getFirstMessageId() ; + virtual void setFirstMessageId(p firstMessageId) ; + + virtual p getLastMessageId() ; + virtual void setLastMessageId(p lastMessageId) ; + + virtual int getMessageCount() ; + virtual void setMessageCount(int messageCount) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_MessageAck_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.cpp b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.cpp index 96bc5be467..b9591b313c 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.cpp @@ -1,113 +1,111 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/MessageDispatch.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for MessageDispatch - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -MessageDispatch::MessageDispatch() -{ - this->consumerId = NULL ; - this->destination = NULL ; - this->message = NULL ; - this->redeliveryCounter = 0 ; -} - -MessageDispatch::~MessageDispatch() -{ -} - -unsigned char MessageDispatch::getDataStructureType() -{ - return MessageDispatch::TYPE ; -} - - -p MessageDispatch::getConsumerId() -{ - return consumerId ; -} - -void MessageDispatch::setConsumerId(p consumerId) -{ - this->consumerId = consumerId ; -} - - -p MessageDispatch::getDestination() -{ - return destination ; -} - -void MessageDispatch::setDestination(p destination) -{ - this->destination = destination ; -} - - -p MessageDispatch::getMessage() -{ - return message ; -} - -void MessageDispatch::setMessage(p message) -{ - this->message = message ; -} - - -int MessageDispatch::getRedeliveryCounter() -{ - return redeliveryCounter ; -} - -void MessageDispatch::setRedeliveryCounter(int redeliveryCounter) -{ - this->redeliveryCounter = redeliveryCounter ; -} - -int MessageDispatch::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(consumerId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObject(message, mode, writer) ; - size += marshaller->marshalInt(redeliveryCounter, mode, writer) ; - return size ; -} - -void MessageDispatch::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - consumerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - message = p_cast(marshaller->unmarshalObject(mode, reader)) ; - redeliveryCounter = (marshaller->unmarshalInt(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/MessageDispatch.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for MessageDispatch + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +MessageDispatch::MessageDispatch() +{ + this->consumerId = NULL ; + this->destination = NULL ; + this->message = NULL ; + this->redeliveryCounter = 0 ; +} + +MessageDispatch::~MessageDispatch() +{ +} + +unsigned char MessageDispatch::getDataStructureType() +{ + return MessageDispatch::TYPE ; +} + + +p MessageDispatch::getConsumerId() +{ + return consumerId ; +} + +void MessageDispatch::setConsumerId(p consumerId) +{ + this->consumerId = consumerId ; +} + + +p MessageDispatch::getDestination() +{ + return destination ; +} + +void MessageDispatch::setDestination(p destination) +{ + this->destination = destination ; +} + + +p MessageDispatch::getMessage() +{ + return message ; +} + +void MessageDispatch::setMessage(p message) +{ + this->message = message ; +} + + +int MessageDispatch::getRedeliveryCounter() +{ + return redeliveryCounter ; +} + +void MessageDispatch::setRedeliveryCounter(int redeliveryCounter) +{ + this->redeliveryCounter = redeliveryCounter ; +} + +int MessageDispatch::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(consumerId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObject(message, mode, ostream) ; + size += marshaller->marshalInt(redeliveryCounter, mode, ostream) ; + return size ; +} + +void MessageDispatch::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + consumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + message = p_cast(marshaller->unmarshalObject(mode, istream)) ; + redeliveryCounter = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.hpp b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.hpp index de4b566dbd..62d178ca31 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatch.hpp @@ -1,97 +1,98 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_MessageDispatch_hpp_ -#define ActiveMQ_MessageDispatch_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConsumerId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/Message.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for MessageDispatch - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class MessageDispatch : public BaseCommand -{ -protected: - p consumerId ; - p destination ; - p message ; - int redeliveryCounter ; - -public: - const static unsigned char TYPE = 21; - -public: - MessageDispatch() ; - virtual ~MessageDispatch() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConsumerId() ; - virtual void setConsumerId(p consumerId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getMessage() ; - virtual void setMessage(p message) ; - - virtual int getRedeliveryCounter() ; - virtual void setRedeliveryCounter(int redeliveryCounter) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_MessageDispatch_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_MessageDispatch_hpp_ +#define ActiveMQ_MessageDispatch_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConsumerId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/Message.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for MessageDispatch + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class MessageDispatch : public BaseCommand +{ +protected: + p consumerId ; + p destination ; + p message ; + int redeliveryCounter ; + +public: + const static unsigned char TYPE = 21; + +public: + MessageDispatch() ; + virtual ~MessageDispatch() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConsumerId() ; + virtual void setConsumerId(p consumerId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getMessage() ; + virtual void setMessage(p message) ; + + virtual int getRedeliveryCounter() ; + virtual void setRedeliveryCounter(int redeliveryCounter) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_MessageDispatch_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.cpp b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.cpp index 3de761f319..3534978f8e 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.cpp @@ -1,113 +1,111 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/MessageDispatchNotification.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for MessageDispatchNotification - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -MessageDispatchNotification::MessageDispatchNotification() -{ - this->consumerId = NULL ; - this->destination = NULL ; - this->deliverySequenceId = 0 ; - this->messageId = NULL ; -} - -MessageDispatchNotification::~MessageDispatchNotification() -{ -} - -unsigned char MessageDispatchNotification::getDataStructureType() -{ - return MessageDispatchNotification::TYPE ; -} - - -p MessageDispatchNotification::getConsumerId() -{ - return consumerId ; -} - -void MessageDispatchNotification::setConsumerId(p consumerId) -{ - this->consumerId = consumerId ; -} - - -p MessageDispatchNotification::getDestination() -{ - return destination ; -} - -void MessageDispatchNotification::setDestination(p destination) -{ - this->destination = destination ; -} - - -long long MessageDispatchNotification::getDeliverySequenceId() -{ - return deliverySequenceId ; -} - -void MessageDispatchNotification::setDeliverySequenceId(long long deliverySequenceId) -{ - this->deliverySequenceId = deliverySequenceId ; -} - - -p MessageDispatchNotification::getMessageId() -{ - return messageId ; -} - -void MessageDispatchNotification::setMessageId(p messageId) -{ - this->messageId = messageId ; -} - -int MessageDispatchNotification::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(consumerId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalLong(deliverySequenceId, mode, writer) ; - size += marshaller->marshalObject(messageId, mode, writer) ; - return size ; -} - -void MessageDispatchNotification::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - consumerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - deliverySequenceId = (marshaller->unmarshalLong(mode, reader)) ; - messageId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/MessageDispatchNotification.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for MessageDispatchNotification + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +MessageDispatchNotification::MessageDispatchNotification() +{ + this->consumerId = NULL ; + this->destination = NULL ; + this->deliverySequenceId = 0 ; + this->messageId = NULL ; +} + +MessageDispatchNotification::~MessageDispatchNotification() +{ +} + +unsigned char MessageDispatchNotification::getDataStructureType() +{ + return MessageDispatchNotification::TYPE ; +} + + +p MessageDispatchNotification::getConsumerId() +{ + return consumerId ; +} + +void MessageDispatchNotification::setConsumerId(p consumerId) +{ + this->consumerId = consumerId ; +} + + +p MessageDispatchNotification::getDestination() +{ + return destination ; +} + +void MessageDispatchNotification::setDestination(p destination) +{ + this->destination = destination ; +} + + +long long MessageDispatchNotification::getDeliverySequenceId() +{ + return deliverySequenceId ; +} + +void MessageDispatchNotification::setDeliverySequenceId(long long deliverySequenceId) +{ + this->deliverySequenceId = deliverySequenceId ; +} + + +p MessageDispatchNotification::getMessageId() +{ + return messageId ; +} + +void MessageDispatchNotification::setMessageId(p messageId) +{ + this->messageId = messageId ; +} + +int MessageDispatchNotification::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(consumerId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalLong(deliverySequenceId, mode, ostream) ; + size += marshaller->marshalObject(messageId, mode, ostream) ; + return size ; +} + +void MessageDispatchNotification::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + consumerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + deliverySequenceId = (marshaller->unmarshalLong(mode, istream)) ; + messageId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.hpp b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.hpp index 74a577854c..2deb1beb83 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageDispatchNotification.hpp @@ -1,97 +1,98 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_MessageDispatchNotification_hpp_ -#define ActiveMQ_MessageDispatchNotification_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConsumerId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/MessageId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for MessageDispatchNotification - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class MessageDispatchNotification : public BaseCommand -{ -protected: - p consumerId ; - p destination ; - long long deliverySequenceId ; - p messageId ; - -public: - const static unsigned char TYPE = 90; - -public: - MessageDispatchNotification() ; - virtual ~MessageDispatchNotification() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConsumerId() ; - virtual void setConsumerId(p consumerId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual long long getDeliverySequenceId() ; - virtual void setDeliverySequenceId(long long deliverySequenceId) ; - - virtual p getMessageId() ; - virtual void setMessageId(p messageId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_MessageDispatchNotification_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_MessageDispatchNotification_hpp_ +#define ActiveMQ_MessageDispatchNotification_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConsumerId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/MessageId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for MessageDispatchNotification + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class MessageDispatchNotification : public BaseCommand +{ +protected: + p consumerId ; + p destination ; + long long deliverySequenceId ; + p messageId ; + +public: + const static unsigned char TYPE = 90; + +public: + MessageDispatchNotification() ; + virtual ~MessageDispatchNotification() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConsumerId() ; + virtual void setConsumerId(p consumerId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual long long getDeliverySequenceId() ; + virtual void setDeliverySequenceId(long long deliverySequenceId) ; + + virtual p getMessageId() ; + virtual void setMessageId(p messageId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_MessageDispatchNotification_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageId.cpp b/openwire-cpp/src/main/cpp/activemq/command/MessageId.cpp index e6eb5a01f9..003bb447a4 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageId.cpp @@ -1,95 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/MessageId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for MessageId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -MessageId::MessageId() -{ - this->producerId = NULL ; - this->producerSequenceId = 0 ; - this->brokerSequenceId = 0 ; -} - -MessageId::~MessageId() -{ -} - -unsigned char MessageId::getDataStructureType() -{ - return MessageId::TYPE ; -} - - -p MessageId::getProducerId() -{ - return producerId ; -} - -void MessageId::setProducerId(p producerId) -{ - this->producerId = producerId ; -} - - -long long MessageId::getProducerSequenceId() -{ - return producerSequenceId ; -} - -void MessageId::setProducerSequenceId(long long producerSequenceId) -{ - this->producerSequenceId = producerSequenceId ; -} - - -long long MessageId::getBrokerSequenceId() -{ - return brokerSequenceId ; -} - -void MessageId::setBrokerSequenceId(long long brokerSequenceId) -{ - this->brokerSequenceId = brokerSequenceId ; -} - -int MessageId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalObject(producerId, mode, writer) ; - size += marshaller->marshalLong(producerSequenceId, mode, writer) ; - size += marshaller->marshalLong(brokerSequenceId, mode, writer) ; - return size ; -} - -void MessageId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - producerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - producerSequenceId = (marshaller->unmarshalLong(mode, reader)) ; - brokerSequenceId = (marshaller->unmarshalLong(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/MessageId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for MessageId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +MessageId::MessageId() +{ + this->producerId = NULL ; + this->producerSequenceId = 0 ; + this->brokerSequenceId = 0 ; +} + +MessageId::~MessageId() +{ +} + +unsigned char MessageId::getDataStructureType() +{ + return MessageId::TYPE ; +} + + +p MessageId::getProducerId() +{ + return producerId ; +} + +void MessageId::setProducerId(p producerId) +{ + this->producerId = producerId ; +} + + +long long MessageId::getProducerSequenceId() +{ + return producerSequenceId ; +} + +void MessageId::setProducerSequenceId(long long producerSequenceId) +{ + this->producerSequenceId = producerSequenceId ; +} + + +long long MessageId::getBrokerSequenceId() +{ + return brokerSequenceId ; +} + +void MessageId::setBrokerSequenceId(long long brokerSequenceId) +{ + this->brokerSequenceId = brokerSequenceId ; +} + +int MessageId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(producerId, mode, ostream) ; + size += marshaller->marshalLong(producerSequenceId, mode, ostream) ; + size += marshaller->marshalLong(brokerSequenceId, mode, ostream) ; + return size ; +} + +void MessageId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + producerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + producerSequenceId = (marshaller->unmarshalLong(mode, istream)) ; + brokerSequenceId = (marshaller->unmarshalLong(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/MessageId.hpp b/openwire-cpp/src/main/cpp/activemq/command/MessageId.hpp index 787ed491a9..b09b9c16f6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/MessageId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/MessageId.hpp @@ -1,91 +1,92 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_MessageId_hpp_ -#define ActiveMQ_MessageId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/command/ProducerId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for MessageId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class MessageId : public AbstractCommand -{ -protected: - p producerId ; - long long producerSequenceId ; - long long brokerSequenceId ; - -public: - const static unsigned char TYPE = 110; - -public: - MessageId() ; - virtual ~MessageId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getProducerId() ; - virtual void setProducerId(p producerId) ; - - virtual long long getProducerSequenceId() ; - virtual void setProducerSequenceId(long long producerSequenceId) ; - - virtual long long getBrokerSequenceId() ; - virtual void setBrokerSequenceId(long long brokerSequenceId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_MessageId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_MessageId_hpp_ +#define ActiveMQ_MessageId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/ProducerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for MessageId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class MessageId : public BaseDataStructure +{ +protected: + p producerId ; + long long producerSequenceId ; + long long brokerSequenceId ; + +public: + const static unsigned char TYPE = 110; + +public: + MessageId() ; + virtual ~MessageId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getProducerId() ; + virtual void setProducerId(p producerId) ; + + virtual long long getProducerSequenceId() ; + virtual void setProducerSequenceId(long long producerSequenceId) ; + + virtual long long getBrokerSequenceId() ; + virtual void setBrokerSequenceId(long long brokerSequenceId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_MessageId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.cpp b/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.cpp new file mode 100644 index 0000000000..22a7bdcb68 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.cpp @@ -0,0 +1,83 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/NetworkBridgeFilter.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for NetworkBridgeFilter + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +NetworkBridgeFilter::NetworkBridgeFilter() +{ + this->networkTTL = 0 ; + this->networkBrokerId = NULL ; +} + +NetworkBridgeFilter::~NetworkBridgeFilter() +{ +} + +unsigned char NetworkBridgeFilter::getDataStructureType() +{ + return NetworkBridgeFilter::TYPE ; +} + + +int NetworkBridgeFilter::getNetworkTTL() +{ + return networkTTL ; +} + +void NetworkBridgeFilter::setNetworkTTL(int networkTTL) +{ + this->networkTTL = networkTTL ; +} + + +p NetworkBridgeFilter::getNetworkBrokerId() +{ + return networkBrokerId ; +} + +void NetworkBridgeFilter::setNetworkBrokerId(p networkBrokerId) +{ + this->networkBrokerId = networkBrokerId ; +} + +int NetworkBridgeFilter::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(networkTTL, mode, ostream) ; + size += marshaller->marshalObject(networkBrokerId, mode, ostream) ; + return size ; +} + +void NetworkBridgeFilter::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + networkTTL = (marshaller->unmarshalInt(mode, istream)) ; + networkBrokerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.hpp b/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.hpp new file mode 100644 index 0000000000..e2fd8d5c66 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/NetworkBridgeFilter.hpp @@ -0,0 +1,88 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_NetworkBridgeFilter_hpp_ +#define ActiveMQ_NetworkBridgeFilter_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/BrokerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for NetworkBridgeFilter + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class NetworkBridgeFilter : public BaseDataStructure +{ +protected: + int networkTTL ; + p networkBrokerId ; + +public: + const static unsigned char TYPE = 91; + +public: + NetworkBridgeFilter() ; + virtual ~NetworkBridgeFilter() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getNetworkTTL() ; + virtual void setNetworkTTL(int networkTTL) ; + + virtual p getNetworkBrokerId() ; + virtual void setNetworkBrokerId(p networkBrokerId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_NetworkBridgeFilter_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.cpp new file mode 100644 index 0000000000..9c9d954deb --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.cpp @@ -0,0 +1,83 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/PartialCommand.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for PartialCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +PartialCommand::PartialCommand() +{ + this->commandId = 0 ; + this->data = NULL ; +} + +PartialCommand::~PartialCommand() +{ +} + +unsigned char PartialCommand::getDataStructureType() +{ + return PartialCommand::TYPE ; +} + + +int PartialCommand::getCommandId() +{ + return commandId ; +} + +void PartialCommand::setCommandId(int commandId) +{ + this->commandId = commandId ; +} + + +array PartialCommand::getData() +{ + return data ; +} + +void PartialCommand::setData(array data) +{ + this->data = data ; +} + +int PartialCommand::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(commandId, mode, ostream) ; + size += marshaller->marshalByteArray(data, mode, ostream) ; + return size ; +} + +void PartialCommand::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + commandId = (marshaller->unmarshalInt(mode, istream)) ; + data = (marshaller->unmarshalByteArray(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.hpp new file mode 100644 index 0000000000..ed686e6173 --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/PartialCommand.hpp @@ -0,0 +1,87 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_PartialCommand_hpp_ +#define ActiveMQ_PartialCommand_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for PartialCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class PartialCommand : public BaseDataStructure +{ +protected: + int commandId ; + array data ; + +public: + const static unsigned char TYPE = 60; + +public: + PartialCommand() ; + virtual ~PartialCommand() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getCommandId() ; + virtual void setCommandId(int commandId) ; + + virtual array getData() ; + virtual void setData(array data) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_PartialCommand_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ProducerId.cpp b/openwire-cpp/src/main/cpp/activemq/command/ProducerId.cpp index 8f92f7be86..708e91222b 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ProducerId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ProducerId.cpp @@ -1,95 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ProducerId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ProducerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ProducerId::ProducerId() -{ - this->connectionId = NULL ; - this->value = 0 ; - this->sessionId = 0 ; -} - -ProducerId::~ProducerId() -{ -} - -unsigned char ProducerId::getDataStructureType() -{ - return ProducerId::TYPE ; -} - - -p ProducerId::getConnectionId() -{ - return connectionId ; -} - -void ProducerId::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -long long ProducerId::getValue() -{ - return value ; -} - -void ProducerId::setValue(long long value) -{ - this->value = value ; -} - - -long long ProducerId::getSessionId() -{ - return sessionId ; -} - -void ProducerId::setSessionId(long long sessionId) -{ - this->sessionId = sessionId ; -} - -int ProducerId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalString(connectionId, mode, writer) ; - size += marshaller->marshalLong(value, mode, writer) ; - size += marshaller->marshalLong(sessionId, mode, writer) ; - return size ; -} - -void ProducerId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - connectionId = p_cast(marshaller->unmarshalString(mode, reader)) ; - value = (marshaller->unmarshalLong(mode, reader)) ; - sessionId = (marshaller->unmarshalLong(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ProducerId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ProducerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ProducerId::ProducerId() +{ + this->connectionId = NULL ; + this->value = 0 ; + this->sessionId = 0 ; +} + +ProducerId::~ProducerId() +{ +} + +unsigned char ProducerId::getDataStructureType() +{ + return ProducerId::TYPE ; +} + + +p ProducerId::getConnectionId() +{ + return connectionId ; +} + +void ProducerId::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +long long ProducerId::getValue() +{ + return value ; +} + +void ProducerId::setValue(long long value) +{ + this->value = value ; +} + + +long long ProducerId::getSessionId() +{ + return sessionId ; +} + +void ProducerId::setSessionId(long long sessionId) +{ + this->sessionId = sessionId ; +} + +int ProducerId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(connectionId, mode, ostream) ; + size += marshaller->marshalLong(value, mode, ostream) ; + size += marshaller->marshalLong(sessionId, mode, ostream) ; + return size ; +} + +void ProducerId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalString(mode, istream)) ; + value = (marshaller->unmarshalLong(mode, istream)) ; + sessionId = (marshaller->unmarshalLong(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ProducerId.hpp b/openwire-cpp/src/main/cpp/activemq/command/ProducerId.hpp index 5901e15a30..2975f736b8 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ProducerId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ProducerId.hpp @@ -1,90 +1,91 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ProducerId_hpp_ -#define ActiveMQ_ProducerId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ProducerId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ProducerId : public AbstractCommand -{ -protected: - p connectionId ; - long long value ; - long long sessionId ; - -public: - const static unsigned char TYPE = 123; - -public: - ProducerId() ; - virtual ~ProducerId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual long long getValue() ; - virtual void setValue(long long value) ; - - virtual long long getSessionId() ; - virtual void setSessionId(long long sessionId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ProducerId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ProducerId_hpp_ +#define ActiveMQ_ProducerId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ProducerId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ProducerId : public BaseDataStructure +{ +protected: + p connectionId ; + long long value ; + long long sessionId ; + +public: + const static unsigned char TYPE = 123; + +public: + ProducerId() ; + virtual ~ProducerId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual long long getValue() ; + virtual void setValue(long long value) ; + + virtual long long getSessionId() ; + virtual void setSessionId(long long sessionId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ProducerId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.cpp index 2c27dce3b2..a5e434f2e0 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.cpp @@ -1,99 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ProducerInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ProducerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ProducerInfo::ProducerInfo() -{ - this->producerId = NULL ; - this->destination = NULL ; - this->brokerPath = NULL ; -} - -ProducerInfo::~ProducerInfo() -{ -} - -unsigned char ProducerInfo::getDataStructureType() -{ - return ProducerInfo::TYPE ; -} - - -p ProducerInfo::getProducerId() -{ - return producerId ; -} - -void ProducerInfo::setProducerId(p producerId) -{ - this->producerId = producerId ; -} - - -p ProducerInfo::getDestination() -{ - return destination ; -} - -void ProducerInfo::setDestination(p destination) -{ - this->destination = destination ; -} - - -array ProducerInfo::getBrokerPath() -{ - return brokerPath ; -} - -void ProducerInfo::setBrokerPath(array brokerPath) -{ - this->brokerPath = brokerPath ; -} - -int ProducerInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(producerId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalObjectArray(brokerPath, mode, writer) ; - return size ; -} - -void ProducerInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - producerId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ProducerInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ProducerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ProducerInfo::ProducerInfo() +{ + this->producerId = NULL ; + this->destination = NULL ; + this->brokerPath = NULL ; +} + +ProducerInfo::~ProducerInfo() +{ +} + +unsigned char ProducerInfo::getDataStructureType() +{ + return ProducerInfo::TYPE ; +} + + +p ProducerInfo::getProducerId() +{ + return producerId ; +} + +void ProducerInfo::setProducerId(p producerId) +{ + this->producerId = producerId ; +} + + +p ProducerInfo::getDestination() +{ + return destination ; +} + +void ProducerInfo::setDestination(p destination) +{ + this->destination = destination ; +} + + +array ProducerInfo::getBrokerPath() +{ + return brokerPath ; +} + +void ProducerInfo::setBrokerPath(array brokerPath) +{ + this->brokerPath = brokerPath ; +} + +int ProducerInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(producerId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalObjectArray(brokerPath, mode, ostream) ; + return size ; +} + +void ProducerInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + producerId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + brokerPath = array_cast(marshaller->unmarshalObjectArray(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.hpp index 8f79153014..477c5673a6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ProducerInfo.hpp @@ -1,93 +1,94 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ProducerInfo_hpp_ -#define ActiveMQ_ProducerInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ProducerId.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/command/BrokerId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ProducerInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ProducerInfo : public BaseCommand -{ -protected: - p producerId ; - p destination ; - array brokerPath ; - -public: - const static unsigned char TYPE = 6; - -public: - ProducerInfo() ; - virtual ~ProducerInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getProducerId() ; - virtual void setProducerId(p producerId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual array getBrokerPath() ; - virtual void setBrokerPath(array brokerPath) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ProducerInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ProducerInfo_hpp_ +#define ActiveMQ_ProducerInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ProducerId.hpp" +#include "activemq/command/ActiveMQDestination.hpp" +#include "activemq/command/BrokerId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ProducerInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ProducerInfo : public BaseCommand +{ +protected: + p producerId ; + p destination ; + array brokerPath ; + +public: + const static unsigned char TYPE = 6; + +public: + ProducerInfo() ; + virtual ~ProducerInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getProducerId() ; + virtual void setProducerId(p producerId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual array getBrokerPath() ; + virtual void setBrokerPath(array brokerPath) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ProducerInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.cpp index 075e961aa8..69d800a957 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.cpp @@ -1,71 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/RemoveInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for RemoveInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -RemoveInfo::RemoveInfo() -{ - this->objectId = NULL ; -} - -RemoveInfo::~RemoveInfo() -{ -} - -unsigned char RemoveInfo::getDataStructureType() -{ - return RemoveInfo::TYPE ; -} - - -p RemoveInfo::getObjectId() -{ - return objectId ; -} - -void RemoveInfo::setObjectId(p objectId) -{ - this->objectId = objectId ; -} - -int RemoveInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(objectId, mode, writer) ; - return size ; -} - -void RemoveInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - objectId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/RemoveInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for RemoveInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +RemoveInfo::RemoveInfo() +{ + this->objectId = NULL ; +} + +RemoveInfo::~RemoveInfo() +{ +} + +unsigned char RemoveInfo::getDataStructureType() +{ + return RemoveInfo::TYPE ; +} + + +p RemoveInfo::getObjectId() +{ + return objectId ; +} + +void RemoveInfo::setObjectId(p objectId) +{ + this->objectId = objectId ; +} + +int RemoveInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(objectId, mode, ostream) ; + return size ; +} + +void RemoveInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + objectId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.hpp index fc19702fab..5a0119a18e 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/RemoveInfo.hpp @@ -1,83 +1,84 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_RemoveInfo_hpp_ -#define ActiveMQ_RemoveInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/IDataStructure.hpp" -#include "activemq/command/BaseCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for RemoveInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class RemoveInfo : public BaseCommand -{ -protected: - p objectId ; - -public: - const static unsigned char TYPE = 12; - -public: - RemoveInfo() ; - virtual ~RemoveInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getObjectId() ; - virtual void setObjectId(p objectId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_RemoveInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_RemoveInfo_hpp_ +#define ActiveMQ_RemoveInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/IDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for RemoveInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class RemoveInfo : public BaseCommand +{ +protected: + p objectId ; + +public: + const static unsigned char TYPE = 12; + +public: + RemoveInfo() ; + virtual ~RemoveInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getObjectId() ; + virtual void setObjectId(p objectId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_RemoveInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.cpp index 5f31c98c13..6b20542bda 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.cpp @@ -1,99 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/RemoveSubscriptionInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for RemoveSubscriptionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -RemoveSubscriptionInfo::RemoveSubscriptionInfo() -{ - this->connectionId = NULL ; - this->subcriptionName = NULL ; - this->clientId = NULL ; -} - -RemoveSubscriptionInfo::~RemoveSubscriptionInfo() -{ -} - -unsigned char RemoveSubscriptionInfo::getDataStructureType() -{ - return RemoveSubscriptionInfo::TYPE ; -} - - -p RemoveSubscriptionInfo::getConnectionId() -{ - return connectionId ; -} - -void RemoveSubscriptionInfo::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -p RemoveSubscriptionInfo::getSubcriptionName() -{ - return subcriptionName ; -} - -void RemoveSubscriptionInfo::setSubcriptionName(p subcriptionName) -{ - this->subcriptionName = subcriptionName ; -} - - -p RemoveSubscriptionInfo::getClientId() -{ - return clientId ; -} - -void RemoveSubscriptionInfo::setClientId(p clientId) -{ - this->clientId = clientId ; -} - -int RemoveSubscriptionInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - size += marshaller->marshalString(subcriptionName, mode, writer) ; - size += marshaller->marshalString(clientId, mode, writer) ; - return size ; -} - -void RemoveSubscriptionInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - subcriptionName = p_cast(marshaller->unmarshalString(mode, reader)) ; - clientId = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/RemoveSubscriptionInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for RemoveSubscriptionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +RemoveSubscriptionInfo::RemoveSubscriptionInfo() +{ + this->connectionId = NULL ; + this->subcriptionName = NULL ; + this->clientId = NULL ; +} + +RemoveSubscriptionInfo::~RemoveSubscriptionInfo() +{ +} + +unsigned char RemoveSubscriptionInfo::getDataStructureType() +{ + return RemoveSubscriptionInfo::TYPE ; +} + + +p RemoveSubscriptionInfo::getConnectionId() +{ + return connectionId ; +} + +void RemoveSubscriptionInfo::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +p RemoveSubscriptionInfo::getSubcriptionName() +{ + return subcriptionName ; +} + +void RemoveSubscriptionInfo::setSubcriptionName(p subcriptionName) +{ + this->subcriptionName = subcriptionName ; +} + + +p RemoveSubscriptionInfo::getClientId() +{ + return clientId ; +} + +void RemoveSubscriptionInfo::setClientId(p clientId) +{ + this->clientId = clientId ; +} + +int RemoveSubscriptionInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + size += marshaller->marshalString(subcriptionName, mode, ostream) ; + size += marshaller->marshalString(clientId, mode, ostream) ; + return size ; +} + +void RemoveSubscriptionInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + subcriptionName = p_cast(marshaller->unmarshalString(mode, istream)) ; + clientId = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.hpp index e78fa967eb..57cfa050c8 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/RemoveSubscriptionInfo.hpp @@ -1,91 +1,92 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_RemoveSubscriptionInfo_hpp_ -#define ActiveMQ_RemoveSubscriptionInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for RemoveSubscriptionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class RemoveSubscriptionInfo : public BaseCommand -{ -protected: - p connectionId ; - p subcriptionName ; - p clientId ; - -public: - const static unsigned char TYPE = 0; - -public: - RemoveSubscriptionInfo() ; - virtual ~RemoveSubscriptionInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual p getSubcriptionName() ; - virtual void setSubcriptionName(p subcriptionName) ; - - virtual p getClientId() ; - virtual void setClientId(p clientId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_RemoveSubscriptionInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_RemoveSubscriptionInfo_hpp_ +#define ActiveMQ_RemoveSubscriptionInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConnectionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for RemoveSubscriptionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class RemoveSubscriptionInfo : public BaseCommand +{ +protected: + p connectionId ; + p subcriptionName ; + p clientId ; + +public: + const static unsigned char TYPE = 0; + +public: + RemoveSubscriptionInfo() ; + virtual ~RemoveSubscriptionInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual p getSubcriptionName() ; + virtual void setSubcriptionName(p subcriptionName) ; + + virtual p getClientId() ; + virtual void setClientId(p clientId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_RemoveSubscriptionInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.cpp b/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.cpp new file mode 100644 index 0000000000..3945440bdd --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.cpp @@ -0,0 +1,83 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ReplayCommand.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ReplayCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ReplayCommand::ReplayCommand() +{ + this->firstNakNumber = 0 ; + this->lastNakNumber = 0 ; +} + +ReplayCommand::~ReplayCommand() +{ +} + +unsigned char ReplayCommand::getDataStructureType() +{ + return ReplayCommand::TYPE ; +} + + +int ReplayCommand::getFirstNakNumber() +{ + return firstNakNumber ; +} + +void ReplayCommand::setFirstNakNumber(int firstNakNumber) +{ + this->firstNakNumber = firstNakNumber ; +} + + +int ReplayCommand::getLastNakNumber() +{ + return lastNakNumber ; +} + +void ReplayCommand::setLastNakNumber(int lastNakNumber) +{ + this->lastNakNumber = lastNakNumber ; +} + +int ReplayCommand::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(firstNakNumber, mode, ostream) ; + size += marshaller->marshalInt(lastNakNumber, mode, ostream) ; + return size ; +} + +void ReplayCommand::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + firstNakNumber = (marshaller->unmarshalInt(mode, istream)) ; + lastNakNumber = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.hpp b/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.hpp new file mode 100644 index 0000000000..a0d9364a4c --- /dev/null +++ b/openwire-cpp/src/main/cpp/activemq/command/ReplayCommand.hpp @@ -0,0 +1,87 @@ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ReplayCommand_hpp_ +#define ActiveMQ_ReplayCommand_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ReplayCommand + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ReplayCommand : public BaseCommand +{ +protected: + int firstNakNumber ; + int lastNakNumber ; + +public: + const static unsigned char TYPE = 65; + +public: + ReplayCommand() ; + virtual ~ReplayCommand() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getFirstNakNumber() ; + virtual void setFirstNakNumber(int firstNakNumber) ; + + virtual int getLastNakNumber() ; + virtual void setLastNakNumber(int lastNakNumber) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ReplayCommand_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/Response.cpp b/openwire-cpp/src/main/cpp/activemq/command/Response.cpp index e815d95c5e..cc32ed8107 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/Response.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/Response.cpp @@ -1,70 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/Response.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for Response - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -Response::Response() -{ - this->correlationId = 0 ; -} - -Response::~Response() -{ -} - -unsigned char Response::getDataStructureType() -{ - return Response::TYPE ; -} - -int Response::getCorrelationId() -{ - return correlationId ; -} - -void Response::setCorrelationId(int correlationId) -{ - this->correlationId = correlationId ; -} - -int Response::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalInt(correlationId, mode, writer) ; - return size ; -} - -void Response::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - correlationId = (marshaller->unmarshalInt(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/Response.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for Response + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +Response::Response() +{ + this->correlationId = 0 ; +} + +Response::~Response() +{ +} + +unsigned char Response::getDataStructureType() +{ + return Response::TYPE ; +} + + +int Response::getCorrelationId() +{ + return correlationId ; +} + +void Response::setCorrelationId(int correlationId) +{ + this->correlationId = correlationId ; +} + +int Response::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(correlationId, mode, ostream) ; + return size ; +} + +void Response::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + correlationId = (marshaller->unmarshalInt(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/Response.hpp b/openwire-cpp/src/main/cpp/activemq/command/Response.hpp index 1995c5b18a..045c03a3fa 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/Response.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/Response.hpp @@ -1,82 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_Response_hpp_ -#define ActiveMQ_Response_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for Response - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class Response : public BaseCommand -{ -protected: - int correlationId ; - -public: - const static unsigned char TYPE = 30; - -public: - Response() ; - virtual ~Response() ; - - virtual unsigned char getDataStructureType() ; - - virtual int getCorrelationId() ; - virtual void setCorrelationId(int correlationId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_Response_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_Response_hpp_ +#define ActiveMQ_Response_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for Response + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class Response : public BaseCommand +{ +protected: + int correlationId ; + +public: + const static unsigned char TYPE = 30; + +public: + Response() ; + virtual ~Response() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getCorrelationId() ; + virtual void setCorrelationId(int correlationId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_Response_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/SessionId.cpp b/openwire-cpp/src/main/cpp/activemq/command/SessionId.cpp index 1d8af46b2f..8a72e4e75a 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SessionId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SessionId.cpp @@ -1,81 +1,83 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/SessionId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for SessionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -SessionId::SessionId() -{ - this->connectionId = NULL ; - this->value = 0 ; -} - -SessionId::~SessionId() -{ -} - -unsigned char SessionId::getDataStructureType() -{ - return SessionId::TYPE ; -} - - -p SessionId::getConnectionId() -{ - return connectionId ; -} - -void SessionId::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -long long SessionId::getValue() -{ - return value ; -} - -void SessionId::setValue(long long value) -{ - this->value = value ; -} - -int SessionId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalString(connectionId, mode, writer) ; - size += marshaller->marshalLong(value, mode, writer) ; - return size ; -} - -void SessionId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - connectionId = p_cast(marshaller->unmarshalString(mode, reader)) ; - value = (marshaller->unmarshalLong(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/SessionId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for SessionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +SessionId::SessionId() +{ + this->connectionId = NULL ; + this->value = 0 ; +} + +SessionId::~SessionId() +{ +} + +unsigned char SessionId::getDataStructureType() +{ + return SessionId::TYPE ; +} + + +p SessionId::getConnectionId() +{ + return connectionId ; +} + +void SessionId::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +long long SessionId::getValue() +{ + return value ; +} + +void SessionId::setValue(long long value) +{ + this->value = value ; +} + +int SessionId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(connectionId, mode, ostream) ; + size += marshaller->marshalLong(value, mode, ostream) ; + return size ; +} + +void SessionId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalString(mode, istream)) ; + value = (marshaller->unmarshalLong(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp b/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp index d6dccc9b7d..56193933d0 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SessionId.hpp @@ -1,86 +1,87 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_SessionId_hpp_ -#define ActiveMQ_SessionId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for SessionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class SessionId : public AbstractCommand -{ -protected: - p connectionId ; - long long value ; - -public: - const static unsigned char TYPE = 121; - -public: - SessionId() ; - virtual ~SessionId() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual long long getValue() ; - virtual void setValue(long long value) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_SessionId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_SessionId_hpp_ +#define ActiveMQ_SessionId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for SessionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class SessionId : public BaseDataStructure +{ +protected: + p connectionId ; + long long value ; + +public: + const static unsigned char TYPE = 121; + +public: + SessionId() ; + virtual ~SessionId() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual long long getValue() ; + virtual void setValue(long long value) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_SessionId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp index 45b86ec085..4d22406831 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.cpp @@ -1,63 +1,69 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/SessionInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for SessionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ - -unsigned char SessionInfo::getDataStructureType() -{ - return SessionInfo::TYPE ; -} - - -p SessionInfo::getSessionId() -{ - return sessionId ; -} - -void SessionInfo::setSessionId(p sessionId) -{ - this->sessionId = sessionId ; -} - -int SessionInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(sessionId, mode, writer) ; - return size ; -} - -void SessionInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - sessionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/SessionInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for SessionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +SessionInfo::SessionInfo() +{ + this->sessionId = NULL ; +} + +SessionInfo::~SessionInfo() +{ +} + +unsigned char SessionInfo::getDataStructureType() +{ + return SessionInfo::TYPE ; +} + + +p SessionInfo::getSessionId() +{ + return sessionId ; +} + +void SessionInfo::setSessionId(p sessionId) +{ + this->sessionId = sessionId ; +} + +int SessionInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(sessionId, mode, ostream) ; + return size ; +} + +void SessionInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + sessionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp index eb0c880b26..641d501d26 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SessionInfo.hpp @@ -1,80 +1,84 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_SessionInfo_hpp_ -#define ActiveMQ_SessionInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/SessionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for SessionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class SessionInfo : public BaseCommand -{ -protected: - p sessionId ; - -public: - const static unsigned char TYPE = 4; - -public: - virtual unsigned char getDataStructureType() ; - - virtual p getSessionId() ; - virtual void setSessionId(p sessionId) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_SessionInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_SessionInfo_hpp_ +#define ActiveMQ_SessionInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/SessionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for SessionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class SessionInfo : public BaseCommand +{ +protected: + p sessionId ; + +public: + const static unsigned char TYPE = 4; + +public: + SessionInfo() ; + virtual ~SessionInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getSessionId() ; + virtual void setSessionId(p sessionId) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_SessionInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp index 73dc467a8b..db7b2b7bf8 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.cpp @@ -1,57 +1,55 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/ShutdownInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for ShutdownInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -ShutdownInfo::ShutdownInfo() -{ -} - -ShutdownInfo::~ShutdownInfo() -{ -} - -unsigned char ShutdownInfo::getDataStructureType() -{ - return ShutdownInfo::TYPE ; -} - -int ShutdownInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - return size ; -} - -void ShutdownInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/ShutdownInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for ShutdownInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +ShutdownInfo::ShutdownInfo() +{ +} + +ShutdownInfo::~ShutdownInfo() +{ +} + +unsigned char ShutdownInfo::getDataStructureType() +{ + return ShutdownInfo::TYPE ; +} + +int ShutdownInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + return size ; +} + +void ShutdownInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp index a204dc623f..a3ba5c6921 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/ShutdownInfo.hpp @@ -1,78 +1,79 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_ShutdownInfo_hpp_ -#define ActiveMQ_ShutdownInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for ShutdownInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class ShutdownInfo : public BaseCommand -{ -protected: - -public: - const static unsigned char TYPE = 11; - -public: - ShutdownInfo() ; - virtual ~ShutdownInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_ShutdownInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_ShutdownInfo_hpp_ +#define ActiveMQ_ShutdownInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for ShutdownInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class ShutdownInfo : public BaseCommand +{ +protected: + +public: + const static unsigned char TYPE = 11; + +public: + ShutdownInfo() ; + virtual ~ShutdownInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_ShutdownInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp index 8fa9633c57..09541d6910 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.cpp @@ -1,113 +1,111 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/SubscriptionInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for SubscriptionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -SubscriptionInfo::SubscriptionInfo() -{ - this->clientId = NULL ; - this->destination = NULL ; - this->selector = NULL ; - this->subcriptionName = NULL ; -} - -SubscriptionInfo::~SubscriptionInfo() -{ -} - -unsigned char SubscriptionInfo::getDataStructureType() -{ - return SubscriptionInfo::TYPE ; -} - - -p SubscriptionInfo::getClientId() -{ - return clientId ; -} - -void SubscriptionInfo::setClientId(p clientId) -{ - this->clientId = clientId ; -} - - -p SubscriptionInfo::getDestination() -{ - return destination ; -} - -void SubscriptionInfo::setDestination(p destination) -{ - this->destination = destination ; -} - - -p SubscriptionInfo::getSelector() -{ - return selector ; -} - -void SubscriptionInfo::setSelector(p selector) -{ - this->selector = selector ; -} - - -p SubscriptionInfo::getSubcriptionName() -{ - return subcriptionName ; -} - -void SubscriptionInfo::setSubcriptionName(p subcriptionName) -{ - this->subcriptionName = subcriptionName ; -} - -int SubscriptionInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalString(clientId, mode, writer) ; - size += marshaller->marshalObject(destination, mode, writer) ; - size += marshaller->marshalString(selector, mode, writer) ; - size += marshaller->marshalString(subcriptionName, mode, writer) ; - return size ; -} - -void SubscriptionInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - clientId = p_cast(marshaller->unmarshalString(mode, reader)) ; - destination = p_cast(marshaller->unmarshalObject(mode, reader)) ; - selector = p_cast(marshaller->unmarshalString(mode, reader)) ; - subcriptionName = p_cast(marshaller->unmarshalString(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/SubscriptionInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for SubscriptionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +SubscriptionInfo::SubscriptionInfo() +{ + this->clientId = NULL ; + this->destination = NULL ; + this->selector = NULL ; + this->subcriptionName = NULL ; +} + +SubscriptionInfo::~SubscriptionInfo() +{ +} + +unsigned char SubscriptionInfo::getDataStructureType() +{ + return SubscriptionInfo::TYPE ; +} + + +p SubscriptionInfo::getClientId() +{ + return clientId ; +} + +void SubscriptionInfo::setClientId(p clientId) +{ + this->clientId = clientId ; +} + + +p SubscriptionInfo::getDestination() +{ + return destination ; +} + +void SubscriptionInfo::setDestination(p destination) +{ + this->destination = destination ; +} + + +p SubscriptionInfo::getSelector() +{ + return selector ; +} + +void SubscriptionInfo::setSelector(p selector) +{ + this->selector = selector ; +} + + +p SubscriptionInfo::getSubcriptionName() +{ + return subcriptionName ; +} + +void SubscriptionInfo::setSubcriptionName(p subcriptionName) +{ + this->subcriptionName = subcriptionName ; +} + +int SubscriptionInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalString(clientId, mode, ostream) ; + size += marshaller->marshalObject(destination, mode, ostream) ; + size += marshaller->marshalString(selector, mode, ostream) ; + size += marshaller->marshalString(subcriptionName, mode, ostream) ; + return size ; +} + +void SubscriptionInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; + clientId = p_cast(marshaller->unmarshalString(mode, istream)) ; + destination = p_cast(marshaller->unmarshalObject(mode, istream)) ; + selector = p_cast(marshaller->unmarshalString(mode, istream)) ; + subcriptionName = p_cast(marshaller->unmarshalString(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp index a4f772dcd1..37d0c8e213 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/SubscriptionInfo.hpp @@ -1,95 +1,96 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_SubscriptionInfo_hpp_ -#define ActiveMQ_SubscriptionInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/command/ActiveMQDestination.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for SubscriptionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class SubscriptionInfo : public AbstractCommand -{ -protected: - p clientId ; - p destination ; - p selector ; - p subcriptionName ; - -public: - const static unsigned char TYPE = 55; - -public: - SubscriptionInfo() ; - virtual ~SubscriptionInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getClientId() ; - virtual void setClientId(p clientId) ; - - virtual p getDestination() ; - virtual void setDestination(p destination) ; - - virtual p getSelector() ; - virtual void setSelector(p selector) ; - - virtual p getSubcriptionName() ; - virtual void setSubcriptionName(p subcriptionName) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_SubscriptionInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_SubscriptionInfo_hpp_ +#define ActiveMQ_SubscriptionInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" +#include "activemq/command/ActiveMQDestination.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for SubscriptionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class SubscriptionInfo : public BaseDataStructure +{ +protected: + p clientId ; + p destination ; + p selector ; + p subcriptionName ; + +public: + const static unsigned char TYPE = 55; + +public: + SubscriptionInfo() ; + virtual ~SubscriptionInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getClientId() ; + virtual void setClientId(p clientId) ; + + virtual p getDestination() ; + virtual void setDestination(p destination) ; + + virtual p getSelector() ; + virtual void setSelector(p selector) ; + + virtual p getSubcriptionName() ; + virtual void setSubcriptionName(p subcriptionName) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_SubscriptionInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp b/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp index 521519118e..9d430a9d95 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/TransactionId.cpp @@ -1,53 +1,55 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/TransactionId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for TransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -TransactionId::TransactionId() -{ -} - -TransactionId::~TransactionId() -{ -} - -unsigned char TransactionId::getDataStructureType() -{ - return TransactionId::TYPE ; -} - -int TransactionId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - return size ; -} - -void TransactionId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/TransactionId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for TransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +TransactionId::TransactionId() +{ +} + +TransactionId::~TransactionId() +{ +} + +unsigned char TransactionId::getDataStructureType() +{ + return TransactionId::TYPE ; +} + +int TransactionId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseDataStructure::marshal(marshaller, mode, ostream) ; + return size ; +} + +void TransactionId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseDataStructure::unmarshal(marshaller, mode, istream) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp b/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp index 85c0a6fea0..f15ea6c74a 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/TransactionId.hpp @@ -1,78 +1,79 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_TransactionId_hpp_ -#define ActiveMQ_TransactionId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/AbstractCommand.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for TransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class TransactionId : public AbstractCommand -{ -protected: - -public: - const static unsigned char TYPE = 0; - -public: - TransactionId() ; - virtual ~TransactionId() ; - - virtual unsigned char getDataStructureType() ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_TransactionId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_TransactionId_hpp_ +#define ActiveMQ_TransactionId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseDataStructure.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for TransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class TransactionId : public BaseDataStructure +{ +protected: + +public: + const static unsigned char TYPE = 0; + +public: + TransactionId() ; + virtual ~TransactionId() ; + + virtual unsigned char getDataStructureType() ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_TransactionId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp b/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp index 4d2ef86222..6bb252ebe7 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.cpp @@ -1,99 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/TransactionInfo.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for TransactionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -TransactionInfo::TransactionInfo() -{ - this->connectionId = NULL ; - this->transactionId = NULL ; - this->type = 0 ; -} - -TransactionInfo::~TransactionInfo() -{ -} - -unsigned char TransactionInfo::getDataStructureType() -{ - return TransactionInfo::TYPE ; -} - - -p TransactionInfo::getConnectionId() -{ - return connectionId ; -} - -void TransactionInfo::setConnectionId(p connectionId) -{ - this->connectionId = connectionId ; -} - - -p TransactionInfo::getTransactionId() -{ - return transactionId ; -} - -void TransactionInfo::setTransactionId(p transactionId) -{ - this->transactionId = transactionId ; -} - - -char TransactionInfo::getType() -{ - return type ; -} - -void TransactionInfo::setType(char type) -{ - this->type = type ; -} - -int TransactionInfo::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(commandId, mode, writer) ; - size += marshaller->marshalBoolean(responseRequired, mode, writer) ; - size += marshaller->marshalObject(connectionId, mode, writer) ; - size += marshaller->marshalObject(transactionId, mode, writer) ; - size += marshaller->marshalByte(type, mode, writer) ; - return size ; -} - -void TransactionInfo::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - commandId = marshaller->unmarshalInt(mode, reader) ; - responseRequired = marshaller->unmarshalBoolean(mode, reader) ; - connectionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - transactionId = p_cast(marshaller->unmarshalObject(mode, reader)) ; - type = (marshaller->unmarshalByte(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/TransactionInfo.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for TransactionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +TransactionInfo::TransactionInfo() +{ + this->connectionId = NULL ; + this->transactionId = NULL ; + this->type = 0 ; +} + +TransactionInfo::~TransactionInfo() +{ +} + +unsigned char TransactionInfo::getDataStructureType() +{ + return TransactionInfo::TYPE ; +} + + +p TransactionInfo::getConnectionId() +{ + return connectionId ; +} + +void TransactionInfo::setConnectionId(p connectionId) +{ + this->connectionId = connectionId ; +} + + +p TransactionInfo::getTransactionId() +{ + return transactionId ; +} + +void TransactionInfo::setTransactionId(p transactionId) +{ + this->transactionId = transactionId ; +} + + +char TransactionInfo::getType() +{ + return type ; +} + +void TransactionInfo::setType(char type) +{ + this->type = type ; +} + +int TransactionInfo::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += BaseCommand::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalObject(connectionId, mode, ostream) ; + size += marshaller->marshalObject(transactionId, mode, ostream) ; + size += marshaller->marshalByte(type, mode, ostream) ; + return size ; +} + +void TransactionInfo::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + BaseCommand::unmarshal(marshaller, mode, istream) ; + connectionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + transactionId = p_cast(marshaller->unmarshalObject(mode, istream)) ; + type = (marshaller->unmarshalByte(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp index 97a2811365..bbc9fea4e6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/TransactionInfo.hpp @@ -1,92 +1,93 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_TransactionInfo_hpp_ -#define ActiveMQ_TransactionInfo_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/BaseCommand.hpp" -#include "activemq/command/ConnectionId.hpp" -#include "activemq/command/TransactionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for TransactionInfo - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class TransactionInfo : public BaseCommand -{ -protected: - p connectionId ; - p transactionId ; - char type ; - -public: - const static unsigned char TYPE = 7; - -public: - TransactionInfo() ; - virtual ~TransactionInfo() ; - - virtual unsigned char getDataStructureType() ; - - virtual p getConnectionId() ; - virtual void setConnectionId(p connectionId) ; - - virtual p getTransactionId() ; - virtual void setTransactionId(p transactionId) ; - - virtual char getType() ; - virtual void setType(char type) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_TransactionInfo_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_TransactionInfo_hpp_ +#define ActiveMQ_TransactionInfo_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/BaseCommand.hpp" +#include "activemq/command/ConnectionId.hpp" +#include "activemq/command/TransactionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for TransactionInfo + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class TransactionInfo : public BaseCommand +{ +protected: + p connectionId ; + p transactionId ; + char type ; + +public: + const static unsigned char TYPE = 7; + +public: + TransactionInfo() ; + virtual ~TransactionInfo() ; + + virtual unsigned char getDataStructureType() ; + + virtual p getConnectionId() ; + virtual void setConnectionId(p connectionId) ; + + virtual p getTransactionId() ; + virtual void setTransactionId(p transactionId) ; + + virtual char getType() ; + virtual void setType(char type) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_TransactionInfo_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp b/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp index beba79792f..f92445b6e6 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/WireFormatInfo.hpp @@ -24,7 +24,7 @@ #include #include -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/command/BaseCommand.hpp" #include "activemq/protocol/IMarshaller.hpp" #include "ppr/io/IOutputStream.hpp" #include "ppr/io/IInputStream.hpp" @@ -49,7 +49,7 @@ namespace apache /* * Marshalling code for Open Wire Format for WireFormatInfo */ -class WireFormatInfo : public AbstractCommand +class WireFormatInfo : public BaseCommand { protected: array magic ; diff --git a/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp b/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp index 8a37914b0f..e7d3549375 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp +++ b/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.cpp @@ -1,95 +1,97 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#include "activemq/command/XATransactionId.hpp" - -using namespace apache::activemq::command; - -/* - * - * Marshalling code for Open Wire Format for XATransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -XATransactionId::XATransactionId() -{ - this->formatId = 0 ; - this->globalTransactionId = NULL ; - this->branchQualifier = NULL ; -} - -XATransactionId::~XATransactionId() -{ -} - -unsigned char XATransactionId::getDataStructureType() -{ - return XATransactionId::TYPE ; -} - - -int XATransactionId::getFormatId() -{ - return formatId ; -} - -void XATransactionId::setFormatId(int formatId) -{ - this->formatId = formatId ; -} - - -array XATransactionId::getGlobalTransactionId() -{ - return globalTransactionId ; -} - -void XATransactionId::setGlobalTransactionId(array globalTransactionId) -{ - this->globalTransactionId = globalTransactionId ; -} - - -array XATransactionId::getBranchQualifier() -{ - return branchQualifier ; -} - -void XATransactionId::setBranchQualifier(array branchQualifier) -{ - this->branchQualifier = branchQualifier ; -} - -int XATransactionId::marshal(p marshaller, int mode, p writer) throw (IOException) -{ - int size = 0 ; - - size += marshaller->marshalInt(formatId, mode, writer) ; - size += marshaller->marshalByteArray(globalTransactionId, mode, writer) ; - size += marshaller->marshalByteArray(branchQualifier, mode, writer) ; - return size ; -} - -void XATransactionId::unmarshal(p marshaller, int mode, p reader) throw (IOException) -{ - formatId = (marshaller->unmarshalInt(mode, reader)) ; - globalTransactionId = (marshaller->unmarshalByteArray(mode, reader)) ; - branchQualifier = (marshaller->unmarshalByteArray(mode, reader)) ; -} +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#include "activemq/command/XATransactionId.hpp" + +using namespace apache::activemq::command; + +/* + * + * Command and marshalling code for OpenWire format for XATransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +XATransactionId::XATransactionId() +{ + this->formatId = 0 ; + this->globalTransactionId = NULL ; + this->branchQualifier = NULL ; +} + +XATransactionId::~XATransactionId() +{ +} + +unsigned char XATransactionId::getDataStructureType() +{ + return XATransactionId::TYPE ; +} + + +int XATransactionId::getFormatId() +{ + return formatId ; +} + +void XATransactionId::setFormatId(int formatId) +{ + this->formatId = formatId ; +} + + +array XATransactionId::getGlobalTransactionId() +{ + return globalTransactionId ; +} + +void XATransactionId::setGlobalTransactionId(array globalTransactionId) +{ + this->globalTransactionId = globalTransactionId ; +} + + +array XATransactionId::getBranchQualifier() +{ + return branchQualifier ; +} + +void XATransactionId::setBranchQualifier(array branchQualifier) +{ + this->branchQualifier = branchQualifier ; +} + +int XATransactionId::marshal(p marshaller, int mode, p ostream) throw (IOException) +{ + int size = 0 ; + + size += TransactionId::marshal(marshaller, mode, ostream) ; + size += marshaller->marshalInt(formatId, mode, ostream) ; + size += marshaller->marshalByteArray(globalTransactionId, mode, ostream) ; + size += marshaller->marshalByteArray(branchQualifier, mode, ostream) ; + return size ; +} + +void XATransactionId::unmarshal(p marshaller, int mode, p istream) throw (IOException) +{ + TransactionId::unmarshal(marshaller, mode, istream) ; + formatId = (marshaller->unmarshalInt(mode, istream)) ; + globalTransactionId = (marshaller->unmarshalByteArray(mode, istream)) ; + branchQualifier = (marshaller->unmarshalByteArray(mode, istream)) ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp b/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp index f2dd864e2f..39a4315cb1 100644 --- a/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp +++ b/openwire-cpp/src/main/cpp/activemq/command/XATransactionId.hpp @@ -1,90 +1,91 @@ -/* -* Copyright 2006 The Apache Software Foundation or its licensors, as -* applicable. -* -* 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. -*/ -#ifndef ActiveMQ_XATransactionId_hpp_ -#define ActiveMQ_XATransactionId_hpp_ - -// Turn off warning message for ignored exception specification -#ifdef _MSC_VER -#pragma warning( disable : 4290 ) -#endif - -#include -#include "activemq/command/TransactionId.hpp" -#include "activemq/protocol/IMarshaller.hpp" -#include "ppr/io/IOutputStream.hpp" -#include "ppr/io/IInputStream.hpp" -#include "ppr/io/IOException.hpp" -#include "ppr/util/ifr/array" -#include "ppr/util/ifr/p" - -namespace apache -{ - namespace activemq - { - namespace command - { - using namespace ifr; - using namespace std; - using namespace apache::activemq; - using namespace apache::activemq::protocol; - using namespace apache::ppr::io; - -/* - * - * Marshalling code for Open Wire Format for XATransactionId - * - * - * NOTE!: This file is autogenerated - do not modify! - * if you need to make a change, please see the Groovy scripts in the - * activemq-core module - * - */ -class XATransactionId : public TransactionId -{ -protected: - int formatId ; - array globalTransactionId ; - array branchQualifier ; - -public: - const static unsigned char TYPE = 112; - -public: - XATransactionId() ; - virtual ~XATransactionId() ; - - virtual unsigned char getDataStructureType() ; - - virtual int getFormatId() ; - virtual void setFormatId(int formatId) ; - - virtual array getGlobalTransactionId() ; - virtual void setGlobalTransactionId(array globalTransactionId) ; - - virtual array getBranchQualifier() ; - virtual void setBranchQualifier(array branchQualifier) ; - - virtual int marshal(p marshaller, int mode, p writer) throw (IOException) ; - virtual void unmarshal(p marshaller, int mode, p reader) throw (IOException) ; -} ; - -/* namespace */ - } - } -} - -#endif /*ActiveMQ_XATransactionId_hpp_*/ +/* +* Copyright 2006 The Apache Software Foundation or its licensors, as +* applicable. +* +* 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. +*/ +#ifndef ActiveMQ_XATransactionId_hpp_ +#define ActiveMQ_XATransactionId_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "activemq/command/TransactionId.hpp" + +#include "activemq/protocol/IMarshaller.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace activemq + { + namespace command + { + using namespace ifr; + using namespace std; + using namespace apache::activemq; + using namespace apache::activemq::protocol; + using namespace apache::ppr::io; + +/* + * + * Command and marshalling code for OpenWire format for XATransactionId + * + * + * NOTE!: This file is autogenerated - do not modify! + * if you need to make a change, please see the Groovy scripts in the + * activemq-core module + * + */ +class XATransactionId : public TransactionId +{ +protected: + int formatId ; + array globalTransactionId ; + array branchQualifier ; + +public: + const static unsigned char TYPE = 112; + +public: + XATransactionId() ; + virtual ~XATransactionId() ; + + virtual unsigned char getDataStructureType() ; + + virtual int getFormatId() ; + virtual void setFormatId(int formatId) ; + + virtual array getGlobalTransactionId() ; + virtual void setGlobalTransactionId(array globalTransactionId) ; + + virtual array getBranchQualifier() ; + virtual void setBranchQualifier(array branchQualifier) ; + + virtual int marshal(p marshaller, int mode, p ostream) throw (IOException) ; + virtual void unmarshal(p marshaller, int mode, p istream) throw (IOException) ; +} ; + +/* namespace */ + } + } +} + +#endif /*ActiveMQ_XATransactionId_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp b/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp index 7caf9fa48d..9736e8813d 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/IMarshaller.hpp @@ -49,31 +49,31 @@ struct IMarshaller : Interface const static int MARSHAL_WRITE = 2 ; const static int MARSHAL_READ = 3 ; - virtual int marshalBoolean(bool value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalByte(char value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalShort(short value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalInt(int value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalLong(long long value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalFloat(float value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalDouble(double value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalString(p value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalObject(p object, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalObjectArray(array object, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalByteArray(array value, int mode, p writer) throw(IOException) = 0 ; - virtual int marshalMap(p value, int mode, p writer) throw(IOException) = 0 ; + virtual int marshalBoolean(bool value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalByte(char value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalShort(short value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalInt(int value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalLong(long long value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalFloat(float value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalDouble(double value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalString(p value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalObject(p object, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalObjectArray(array object, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalByteArray(array value, int mode, p ostream) throw(IOException) = 0 ; + virtual int marshalMap(p value, int mode, p ostream) throw(IOException) = 0 ; - virtual bool unmarshalBoolean(int mode, p reader) throw(IOException) = 0 ; - virtual char unmarshalByte(int mode, p reader) throw(IOException) = 0 ; - virtual short unmarshalShort(int mode, p reader) throw(IOException) = 0 ; - virtual int unmarshalInt(int mode, p reader) throw(IOException) = 0 ; - virtual long long unmarshalLong(int mode, p reader) throw(IOException) = 0 ; - virtual float unmarshalFloat(int mode, p reader) throw(IOException) = 0 ; - virtual double unmarshalDouble(int mode, p reader) throw(IOException) = 0 ; - virtual p unmarshalString(int mode, p reader) throw(IOException) = 0 ; - virtual p unmarshalObject(int mode, p reader) throw(IOException) = 0 ; - virtual array unmarshalObjectArray(int mode, p reader) throw(IOException) = 0 ; - virtual array unmarshalByteArray(int mode, p reader) throw(IOException) = 0 ; - virtual p unmarshalMap(int mode, p reader) throw(IOException) = 0 ; + virtual bool unmarshalBoolean(int mode, p istream) throw(IOException) = 0 ; + virtual char unmarshalByte(int mode, p istream) throw(IOException) = 0 ; + virtual short unmarshalShort(int mode, p istream) throw(IOException) = 0 ; + virtual int unmarshalInt(int mode, p istream) throw(IOException) = 0 ; + virtual long long unmarshalLong(int mode, p istream) throw(IOException) = 0 ; + virtual float unmarshalFloat(int mode, p istream) throw(IOException) = 0 ; + virtual double unmarshalDouble(int mode, p istream) throw(IOException) = 0 ; + virtual p unmarshalString(int mode, p istream) throw(IOException) = 0 ; + virtual p unmarshalObject(int mode, p istream) throw(IOException) = 0 ; + virtual array unmarshalObjectArray(int mode, p istream) throw(IOException) = 0 ; + virtual array unmarshalByteArray(int mode, p istream) throw(IOException) = 0 ; + virtual p unmarshalMap(int mode, p istream) throw(IOException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp b/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp index c609e67276..b6c3ef352e 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/IProtocol.hpp @@ -41,8 +41,8 @@ namespace apache struct IProtocol : Interface { virtual void handshake(p transport) = 0 ; - virtual void marshal(p object, p writer) throw(IOException) = 0 ; - virtual p unmarshal(p reader) throw(IOException) = 0 ; + virtual void marshal(p object, p ostream) throw(IOException) = 0 ; + virtual p unmarshal(p istream) throw(IOException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp index 64d6a7d437..9df8e30d4f 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.cpp @@ -33,6 +33,7 @@ using namespace apache::activemq::protocol::openwire; OpenWireMarshaller::OpenWireMarshaller(p formatInfo) { this->formatInfo = formatInfo ; + this->encoder = CharsetEncoderRegistry::getEncoder() ; } // --- Operation methods -------------------------------------------- @@ -40,12 +41,15 @@ OpenWireMarshaller::OpenWireMarshaller(p formatInfo) /* * */ -int OpenWireMarshaller::marshalBoolean(bool value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalBoolean(bool value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeBoolean(value) ; + dos->writeBoolean(value) ; return (int)BOOLSIZE ; } @@ -59,12 +63,15 @@ int OpenWireMarshaller::marshalBoolean(bool value, int mode, p wr /* * */ -int OpenWireMarshaller::marshalByte(char value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalByte(char value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeByte(value) ; + dos->writeByte(value) ; return (int)sizeof(char) ; } @@ -78,12 +85,15 @@ int OpenWireMarshaller::marshalByte(char value, int mode, p write /* * */ -int OpenWireMarshaller::marshalShort(short value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalShort(short value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeShort(value) ; + dos->writeShort(value) ; return (int)sizeof(short) ; } @@ -97,12 +107,15 @@ int OpenWireMarshaller::marshalShort(short value, int mode, p wri /* * */ -int OpenWireMarshaller::marshalInt(int value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalInt(int value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeInt(value) ; + dos->writeInt(value) ; return (int)sizeof(int) ; } @@ -116,12 +129,15 @@ int OpenWireMarshaller::marshalInt(int value, int mode, p writer) /* * */ -int OpenWireMarshaller::marshalLong(long long value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalLong(long long value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeLong(value) ; + dos->writeLong(value) ; return (int)sizeof(long long) ; } @@ -135,12 +151,15 @@ int OpenWireMarshaller::marshalLong(long long value, int mode, p /* * */ -int OpenWireMarshaller::marshalFloat(float value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalFloat(float value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeFloat(value) ; + dos->writeFloat(value) ; return (int)sizeof(float) ; } @@ -154,12 +173,15 @@ int OpenWireMarshaller::marshalFloat(float value, int mode, p wri /* * */ -int OpenWireMarshaller::marshalDouble(double value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalDouble(double value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) - writer->writeDouble(value) ; + dos->writeDouble(value) ; return (int)sizeof(double) ; } @@ -173,14 +195,17 @@ int OpenWireMarshaller::marshalDouble(double value, int mode, p w /* * */ -int OpenWireMarshaller::marshalString(p value, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalString(p value, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { if( mode == IMarshaller::MARSHAL_WRITE ) { - writer->writeBoolean( value != NULL ) ; - writer->writeString(value) ; + dos->writeBoolean( value != NULL ) ; + dos->writeString(value) ; } int size = 0 ; @@ -191,7 +216,7 @@ int OpenWireMarshaller::marshalString(p value, int mode, plength() ; + size += ( encoder != NULL ) ? encoder->length(value) : (int)value->length() ; } return size ; } @@ -205,8 +230,11 @@ int OpenWireMarshaller::marshalString(p value, int mode, p object, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalObject(p object, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { int size = 0 ; @@ -215,11 +243,11 @@ int OpenWireMarshaller::marshalObject(p object, int mode, pwriteBoolean( object != NULL ) ; + dos->writeBoolean( object != NULL ) ; // Data structure type if( object != NULL ) - writer->writeByte( object->getDataStructureType() ) ; + dos->writeByte( object->getDataStructureType() ) ; } // Length of null marker @@ -231,7 +259,7 @@ int OpenWireMarshaller::marshalObject(p object, int mode, pmarshal(smartify(this), mode, writer) ; + size += object->marshal(smartify(this), mode, ostream) ; } return size ; } @@ -245,8 +273,11 @@ int OpenWireMarshaller::marshalObject(p object, int mode, p objects, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalObjectArray(array objects, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { int size = 0 ; @@ -255,11 +286,11 @@ int OpenWireMarshaller::marshalObjectArray(array objects, int mo if( mode == IMarshaller::MARSHAL_WRITE ) { // Null object marker - writer->writeBoolean( objects != NULL ) ; + dos->writeBoolean( objects != NULL ) ; // Check for NULL array if( objects != NULL ) - writer->writeShort( (short)objects.size() ) ; + dos->writeShort( (short)objects.size() ) ; else return BOOLSIZE ; } @@ -273,7 +304,7 @@ int OpenWireMarshaller::marshalObjectArray(array objects, int mo // Write/measure each object in array for( int i = 0; i < (int)objects.size(); i++ ) - size += objects[i]->marshal(smartify(this), mode, writer) ; + size += objects[i]->marshal(smartify(this), mode, ostream) ; return size ; } @@ -287,8 +318,11 @@ int OpenWireMarshaller::marshalObjectArray(array objects, int mo /* * */ -int OpenWireMarshaller::marshalByteArray(array values, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalByteArray(array values, int mode, p ostream) throw(IOException) { + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + if( !formatInfo->getTightEncodingEnabled() ) { int size = 0 ; @@ -297,7 +331,7 @@ int OpenWireMarshaller::marshalByteArray(array values, int mode, pwriteBoolean( values != NULL ) ; + dos->writeBoolean( values != NULL ) ; // Check for NULL array if( values != NULL ) @@ -306,8 +340,8 @@ int OpenWireMarshaller::marshalByteArray(array values, int mode, pwriteInt( length ) ; - writer->write( values.c_array(), 0, length) ; + dos->writeInt( length ) ; + dos->write( values.c_array(), 0, length) ; } } // Check for NULL array @@ -331,7 +365,7 @@ int OpenWireMarshaller::marshalByteArray(array values, int mode, p object, int mode, p writer) throw(IOException) +int OpenWireMarshaller::marshalMap(p object, int mode, p ostream) throw(IOException) { if( !formatInfo->getTightEncodingEnabled() ) { @@ -364,7 +398,7 @@ int OpenWireMarshaller::marshalMap(p object, int mode, plength( p( new string(key)) ) : (int)key.length() ; size += sizeof(unsigned char) ; // Write the map value @@ -396,7 +430,8 @@ int OpenWireMarshaller::marshalMap(p object, int mode, psize() ; + // Calculate encoded/decoded string length + size += ( encoder != NULL ) ? encoder->length(val.getString()) : (int)val.getString()->size() ; } } } @@ -404,15 +439,18 @@ int OpenWireMarshaller::marshalMap(p object, int mode, p dos = checkOutputStream(ostream) ; + // Write 'null' marker if( object == NULL ) { - writer->writeInt(-1) ; + dos->writeInt(-1) ; return size ; } // Write map item count - writer->writeInt( (int)object->size()) ; + dos->writeInt( (int)object->size()) ; // Loop through map contents for( tempIter = object->begin() ; @@ -425,66 +463,64 @@ int OpenWireMarshaller::marshalMap(p object, int mode, pfirst ; val = tempIter->second ; - // Add size for key char count, lenght of key and value type + // Add size for key char count and value type size += sizeof(short) ; - size += (int)key.length() ; size += sizeof(unsigned char) ; - // Write the map key - writer->writeString( p( new string(tempIter->first) ) ) ; + // Write the map key, add size for key length + size += dos->writeString( p( new string(tempIter->first) ) ) ; // Write the map value switch( val.getType() ) { case MapItemHolder::BOOLEAN: - writer->writeByte( TYPE_BOOLEAN ) ; - writer->writeBoolean( val.getBoolean() ) ; + dos->writeByte( TYPE_BOOLEAN ) ; + dos->writeBoolean( val.getBoolean() ) ; size += BOOLSIZE ; break ; case MapItemHolder::BYTE: - writer->writeByte( TYPE_BYTE ) ; - writer->writeByte( val.getByte() ) ; + dos->writeByte( TYPE_BYTE ) ; + dos->writeByte( val.getByte() ) ; size += sizeof(char) ; break ; case MapItemHolder::BYTEARRAY: - writer->writeByte( TYPE_BYTEARRAY ) ; + dos->writeByte( TYPE_BYTEARRAY ) ; buffer = val.getBytes() ; - writer->writeInt( (int)buffer.size() ) ; - writer->write(buffer.c_array(), 0, (int)buffer.size()) ; + dos->writeInt( (int)buffer.size() ) ; + dos->write(buffer.c_array(), 0, (int)buffer.size()) ; size += (int)buffer.size() ; break ; case MapItemHolder::DOUBLE: - writer->writeByte( TYPE_DOUBLE ) ; - writer->writeDouble( val.getDouble() ) ; + dos->writeByte( TYPE_DOUBLE ) ; + dos->writeDouble( val.getDouble() ) ; size += sizeof(double) ; break ; case MapItemHolder::FLOAT: - writer->writeByte( TYPE_FLOAT ) ; - writer->writeFloat( val.getFloat() ) ; + dos->writeByte( TYPE_FLOAT ) ; + dos->writeFloat( val.getFloat() ) ; size += sizeof(float) ; break ; case MapItemHolder::INTEGER: - writer->writeByte( TYPE_INTEGER ) ; - writer->writeInt( val.getInt() ) ; + dos->writeByte( TYPE_INTEGER ) ; + dos->writeInt( val.getInt() ) ; size += sizeof(int) ; break ; case MapItemHolder::LONG: - writer->writeByte( TYPE_LONG ) ; - writer->writeLong( val.getLong() ) ; + dos->writeByte( TYPE_LONG ) ; + dos->writeLong( val.getLong() ) ; size += sizeof(long) ; break ; case MapItemHolder::SHORT: - writer->writeByte( TYPE_SHORT ) ; - writer->writeShort( val.getShort() ) ; + dos->writeByte( TYPE_SHORT ) ; + dos->writeShort( val.getShort() ) ; size += sizeof(short) ; break ; case MapItemHolder::STRING: - writer->writeByte( TYPE_STRING ) ; - writer->writeString( val.getString() ) ; - size += (int)val.getString()->size() ; + dos->writeByte( TYPE_STRING ) ; + size += dos->writeString( val.getString() ) ; break ; default: - writer->writeByte( TYPE_NULL ) ; + dos->writeByte( TYPE_NULL ) ; } } } @@ -500,11 +536,14 @@ int OpenWireMarshaller::marshalMap(p object, int mode, p reader) throw(IOException) +bool OpenWireMarshaller::unmarshalBoolean(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readBoolean() ; + return dis->readBoolean() ; } else { @@ -516,11 +555,14 @@ bool OpenWireMarshaller::unmarshalBoolean(int mode, p reader) thro /* * */ -char OpenWireMarshaller::unmarshalByte(int mode, p reader) throw(IOException) +char OpenWireMarshaller::unmarshalByte(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readByte() ; + return dis->readByte() ; } else { @@ -531,11 +573,14 @@ char OpenWireMarshaller::unmarshalByte(int mode, p reader) throw(I /* * */ -short OpenWireMarshaller::unmarshalShort(int mode, p reader) throw(IOException) +short OpenWireMarshaller::unmarshalShort(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readShort() ; + return dis->readShort() ; } else { @@ -547,11 +592,14 @@ short OpenWireMarshaller::unmarshalShort(int mode, p reader) throw /* * */ -int OpenWireMarshaller::unmarshalInt(int mode, p reader) throw(IOException) +int OpenWireMarshaller::unmarshalInt(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readInt() ; + return dis->readInt() ; } else { @@ -563,11 +611,14 @@ int OpenWireMarshaller::unmarshalInt(int mode, p reader) throw(IOE /* * */ -long long OpenWireMarshaller::unmarshalLong(int mode, p reader) throw(IOException) +long long OpenWireMarshaller::unmarshalLong(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readLong() ; + return dis->readLong() ; } else { @@ -579,11 +630,14 @@ long long OpenWireMarshaller::unmarshalLong(int mode, p reader) th /* * */ -float OpenWireMarshaller::unmarshalFloat(int mode, p reader) throw(IOException) +float OpenWireMarshaller::unmarshalFloat(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readFloat() ; + return dis->readFloat() ; } else { @@ -595,11 +649,14 @@ float OpenWireMarshaller::unmarshalFloat(int mode, p reader) throw /* * */ -double OpenWireMarshaller::unmarshalDouble(int mode, p reader) throw(IOException) +double OpenWireMarshaller::unmarshalDouble(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - return reader->readFloat() ; + return dis->readFloat() ; } else { @@ -611,12 +668,15 @@ double OpenWireMarshaller::unmarshalDouble(int mode, p reader) thr /* * */ -p OpenWireMarshaller::unmarshalString(int mode, p reader) throw(IOException) +p OpenWireMarshaller::unmarshalString(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { - if( reader->readBoolean() ) - return reader->readString() ; + if( dis->readBoolean() ) + return dis->readString() ; else return NULL ; } @@ -630,24 +690,27 @@ p OpenWireMarshaller::unmarshalString(int mode, p reader) /* * */ -p OpenWireMarshaller::unmarshalObject(int mode, p reader) throw(IOException) +p OpenWireMarshaller::unmarshalObject(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { // Null marker - if( !reader->readBoolean() ) + if( !dis->readBoolean() ) return NULL ; // Read data structure - unsigned char dataType = reader->readByte() ; + unsigned char dataType = dis->readByte() ; // Create command object - p object = AbstractCommand::createObject(dataType) ; + p object = BaseDataStructure::createObject(dataType) ; if( object == NULL ) throw IOException("Unmarshal failed; unknown data structure type %d, at %s line %d", dataType, __FILE__, __LINE__) ; // Finally, unmarshal command body - object->unmarshal(smartify(this), IMarshaller::MARSHAL_READ, reader) ; + object->unmarshal(smartify(this), IMarshaller::MARSHAL_READ, istream) ; return object ; } else @@ -660,15 +723,18 @@ p OpenWireMarshaller::unmarshalObject(int mode, p /* * */ -array OpenWireMarshaller::unmarshalObjectArray(int mode, p reader) throw(IOException) +array OpenWireMarshaller::unmarshalObjectArray(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { // Null marker - if( !reader->readBoolean() ) + if( !dis->readBoolean() ) return NULL ; - int length = reader->readShort() ; + int length = dis->readShort() ; // Check for NULL array if( length == 0 ) @@ -681,7 +747,7 @@ array OpenWireMarshaller::unmarshalObjectArray(int mode, p OpenWireMarshaller::unmarshalObjectArray(int mode, p OpenWireMarshaller::unmarshalByteArray(int mode, p reader) throw(IOException) +array OpenWireMarshaller::unmarshalByteArray(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { // Null marker - if( !reader->readBoolean() ) + if( !dis->readBoolean() ) return NULL ; - int length = reader->readInt() ; + int length = dis->readInt() ; // Check for NULL array if( length == 0 ) @@ -713,7 +782,7 @@ array OpenWireMarshaller::unmarshalByteArray(int mode, p rea array value (length); // Unmarshal all bytes in array - reader->read(value.c_array(), 0, length) ; + dis->read(value.c_array(), 0, length) ; return value ; } @@ -727,12 +796,15 @@ array OpenWireMarshaller::unmarshalByteArray(int mode, p rea /* * */ -p OpenWireMarshaller::unmarshalMap(int mode, p reader) throw(IOException) +p OpenWireMarshaller::unmarshalMap(int mode, p istream) throw(IOException) { + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + if( !formatInfo->getTightEncodingEnabled() ) { // Get size of map - int size = reader->readInt() ; + int size = dis->readInt() ; // Check for NULL map if( size < 0 ) @@ -750,43 +822,43 @@ p OpenWireMarshaller::unmarshalMap(int mode, p reader for( int i = 0 ; i < size ; i++ ) { // Get next key - key = reader->readString() ; + key = dis->readString() ; // Get the primitive type - type = reader->readByte() ; + type = dis->readByte() ; // Depending on type read next value switch( type ) { case TYPE_BOOLEAN: - val = MapItemHolder( reader->readBoolean() ) ; + val = MapItemHolder( dis->readBoolean() ) ; break ; case TYPE_BYTE: - val = MapItemHolder( reader->readByte() ) ; + val = MapItemHolder( dis->readByte() ) ; break ; case TYPE_BYTEARRAY: - length = reader->readInt() ; + length = dis->readInt() ; buffer = array (length) ; - reader->read(buffer.c_array(), 0, length) ; + dis->read(buffer.c_array(), 0, length) ; val = MapItemHolder( buffer ) ; break ; case TYPE_DOUBLE: - val = MapItemHolder( reader->readDouble() ) ; + val = MapItemHolder( dis->readDouble() ) ; break ; case TYPE_FLOAT: - val = MapItemHolder( reader->readFloat() ) ; + val = MapItemHolder( dis->readFloat() ) ; break ; case TYPE_INTEGER: - val = MapItemHolder( reader->readInt() ) ; + val = MapItemHolder( dis->readInt() ) ; break ; case TYPE_LONG: - val = MapItemHolder( reader->readLong() ) ; + val = MapItemHolder( dis->readLong() ) ; break ; case TYPE_SHORT: - val = MapItemHolder( reader->readShort() ) ; + val = MapItemHolder( dis->readShort() ) ; break ; case TYPE_STRING: - val = MapItemHolder( reader->readString() ) ; + val = MapItemHolder( dis->readString() ) ; break ; default: val = MapItemHolder() ; @@ -802,3 +874,29 @@ p OpenWireMarshaller::unmarshalMap(int mode, p reader } return NULL; } + +/* + * + */ +p OpenWireMarshaller::checkOutputStream(p ostream) throw (IOException) +{ + // Assert that supplied output stream is a data output stream + p dos = p_dyncast (ostream) ; + if( dos == NULL ) + throw IOException("OpenWireMarshaller requires a DataOutputStream") ; + + return dos ; +} + +/* + * + */ +p OpenWireMarshaller::checkInputStream(p istream) throw (IOException) +{ + // Assert that supplied output stream is a data output stream + p dis = p_dyncast (istream) ; + if( dis == NULL ) + throw IOException("OpenWireMarshaller requires a DataInputStream") ; + + return dis ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp index 35c07faa80..aa5ade9950 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireMarshaller.hpp @@ -25,13 +25,15 @@ #include #include #include "activemq/IDataStructure.hpp" -#include "activemq/command/AbstractCommand.hpp" +#include "activemq/command/BaseDataStructure.hpp" #include "activemq/command/WireFormatInfo.hpp" #include "activemq/protocol/IMarshaller.hpp" #include "activemq/protocol/openwire/OpenWireProtocol.hpp" #include "ppr/io/DataOutputStream.hpp" #include "ppr/io/DataInputStream.hpp" #include "ppr/io/IOException.hpp" +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" +#include "ppr/io/encoding/ICharsetEncoder.hpp" #include "ppr/util/MapItemHolder.hpp" #include "ppr/util/ifr/array" #include "ppr/util/ifr/p" @@ -49,6 +51,7 @@ namespace apache using namespace apache::activemq::command; using namespace apache::activemq::protocol; using namespace apache::ppr::io; + using namespace apache::ppr::io::encoding; using namespace apache::ppr::util; /* @@ -57,7 +60,8 @@ namespace apache class OpenWireMarshaller : public IMarshaller { private: - p formatInfo ; + p formatInfo ; + p encoder ; public: // Primitive types @@ -76,31 +80,35 @@ public: public: OpenWireMarshaller(p formatInfo) ; - virtual int marshalBoolean(bool value, int mode, p writer) throw(IOException) ; - virtual int marshalByte(char value, int mode, p writer) throw(IOException) ; - virtual int marshalShort(short value, int mode, p writer) throw(IOException) ; - virtual int marshalInt(int value, int mode, p writer) throw(IOException) ; - virtual int marshalLong(long long value, int mode, p writer) throw(IOException) ; - virtual int marshalFloat(float value, int mode, p writer) throw(IOException) ; - virtual int marshalDouble(double value, int mode, p writer) throw(IOException) ; - virtual int marshalString(p value, int mode, p writer) throw(IOException) ; - virtual int marshalObject(p object, int mode, p writer) throw(IOException) ; - virtual int marshalObjectArray(array object, int mode, p writer) throw(IOException) ; - virtual int marshalByteArray(array value, int mode, p writer) throw(IOException) ; - virtual int marshalMap(p value, int mode, p writer) throw(IOException) ; + virtual int marshalBoolean(bool value, int mode, p ostream) throw(IOException) ; + virtual int marshalByte(char value, int mode, p ostream) throw(IOException) ; + virtual int marshalShort(short value, int mode, p ostream) throw(IOException) ; + virtual int marshalInt(int value, int mode, p ostream) throw(IOException) ; + virtual int marshalLong(long long value, int mode, p ostream) throw(IOException) ; + virtual int marshalFloat(float value, int mode, p ostream) throw(IOException) ; + virtual int marshalDouble(double value, int mode, p ostream) throw(IOException) ; + virtual int marshalString(p value, int mode, p ostream) throw(IOException) ; + virtual int marshalObject(p object, int mode, p ostream) throw(IOException) ; + virtual int marshalObjectArray(array object, int mode, p ostream) throw(IOException) ; + virtual int marshalByteArray(array value, int mode, p ostream) throw(IOException) ; + virtual int marshalMap(p value, int mode, p ostream) throw(IOException) ; - virtual bool unmarshalBoolean(int mode, p reader) throw(IOException) ; - virtual char unmarshalByte(int mode, p reader) throw(IOException) ; - virtual short unmarshalShort(int mode, p reader) throw(IOException) ; - virtual int unmarshalInt(int mode, p reader) throw(IOException) ; - virtual long long unmarshalLong(int mode, p reader) throw(IOException) ; - virtual float unmarshalFloat(int mode, p reader) throw(IOException) ; - virtual double unmarshalDouble(int mode, p reader) throw(IOException) ; - virtual p unmarshalString(int mode, p reader) throw(IOException) ; - virtual p unmarshalObject(int mode, p reader) throw(IOException) ; - virtual array unmarshalObjectArray(int mode, p reader) throw(IOException) ; - virtual array unmarshalByteArray(int mode, p reader) throw(IOException) ; - virtual p unmarshalMap(int mode, p reader) throw(IOException) ; + virtual bool unmarshalBoolean(int mode, p istream) throw(IOException) ; + virtual char unmarshalByte(int mode, p istream) throw(IOException) ; + virtual short unmarshalShort(int mode, p istream) throw(IOException) ; + virtual int unmarshalInt(int mode, p istream) throw(IOException) ; + virtual long long unmarshalLong(int mode, p istream) throw(IOException) ; + virtual float unmarshalFloat(int mode, p istream) throw(IOException) ; + virtual double unmarshalDouble(int mode, p istream) throw(IOException) ; + virtual p unmarshalString(int mode, p istream) throw(IOException) ; + virtual p unmarshalObject(int mode, p istream) throw(IOException) ; + virtual array unmarshalObjectArray(int mode, p istream) throw(IOException) ; + virtual array unmarshalByteArray(int mode, p istream) throw(IOException) ; + virtual p unmarshalMap(int mode, p istream) throw(IOException) ; + +protected: + p checkOutputStream(p ostream) throw (IOException) ; + p checkInputStream(p istream) throw (IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp index 3165118bf9..51f12d9976 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.cpp @@ -75,9 +75,11 @@ void OpenWireProtocol::handshake(p transport) /* * */ -void OpenWireProtocol::marshal(p object, p writer) throw(IOException) +void OpenWireProtocol::marshal(p object, p ostream) throw(IOException) { - int size = 0 ; + // Assert that supplied output stream is a data output stream + p dos = checkOutputStream(ostream) ; + int size = 0 ; // Was a non-NULL object supplied if( object != NULL ) @@ -88,14 +90,14 @@ void OpenWireProtocol::marshal(p object, p writer if( !wireFormatInfo->getSizePrefixDisabled() ) { size = 1 ; // data structure type - size += object->marshal(wireMarshaller, IMarshaller::MARSHAL_SIZE, writer) ; + size += object->marshal(wireMarshaller, IMarshaller::MARSHAL_SIZE, ostream) ; // Write size header - writer->writeInt(size) ; + dos->writeInt(size) ; } // Finally, write command type and body - writer->writeByte(dataType) ; - object->marshal(wireMarshaller, IMarshaller::MARSHAL_WRITE, writer) ; + dos->writeByte(dataType) ; + object->marshal(wireMarshaller, IMarshaller::MARSHAL_WRITE, ostream) ; } else // ...NULL object { @@ -106,37 +108,65 @@ void OpenWireProtocol::marshal(p object, p writer size = 1 ; // data structure type // Write size header - writer->writeInt(size) ; + dos->writeInt(size) ; } // Write NULL command type and empty body - writer->writeByte(NULL_TYPE) ; + dos->writeByte(NULL_TYPE) ; } } /* * */ -p OpenWireProtocol::unmarshal(p reader) throw(IOException) +p OpenWireProtocol::unmarshal(p istream) throw(IOException) { - int size = 0 ; + // Assert that supplied input stream is a data input stream + p dis = checkInputStream(istream) ; + int size = 0 ; // Read packet size if configured if( !wireFormatInfo->getSizePrefixDisabled() ) - size = reader->readInt() ; + size = dis->readInt() ; // First byte is the data structure type - unsigned char dataType = reader->readByte() ; + unsigned char dataType = dis->readByte() ; // Check for NULL type if( dataType == NULL_TYPE ) return NULL ; // Create command object - p object = AbstractCommand::createObject(dataType) ; + p object = BaseDataStructure::createObject(dataType) ; if( object == NULL ) throw IOException("Unmarshal failed; unknown data structure type %d, at %s line %d", dataType, __FILE__, __LINE__) ; // Finally, unmarshal command body - object->unmarshal(wireMarshaller, IMarshaller::MARSHAL_READ, reader) ; + object->unmarshal(wireMarshaller, IMarshaller::MARSHAL_READ, istream) ; return object ; } + +/* + * + */ +p OpenWireProtocol::checkOutputStream(p ostream) throw (IOException) +{ + // Assert that supplied output stream is a data output stream + p dos = p_dyncast (ostream) ; + if( dos == NULL ) + throw IOException("OpenWireProtocol requires a DataOutputStream") ; + + return dos ; +} + +/* + * + */ +p OpenWireProtocol::checkInputStream(p istream) throw (IOException) +{ + // Assert that supplied output stream is a data output stream + p dis = p_dyncast (istream) ; + if( dis == NULL ) + throw IOException("OpenWireProtocol requires a DataInputStream") ; + + return dis ; +} diff --git a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.hpp b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.hpp index d71f2a46ab..aef020d9b1 100644 --- a/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.hpp +++ b/openwire-cpp/src/main/cpp/activemq/protocol/openwire/OpenWireProtocol.hpp @@ -27,6 +27,8 @@ #include "activemq/protocol/IProtocol.hpp" #include "ppr/io/IOutputStream.hpp" #include "ppr/io/IInputStream.hpp" +#include "ppr/io/DataInputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" #include "ppr/io/IOException.hpp" #include "ppr/util/ifr/array" #include "ppr/util/ifr/p" @@ -68,8 +70,12 @@ public: virtual bool getStackTraceEnabled() ; virtual void handshake(p transport) ; - virtual void marshal(p object, p writer) throw(IOException) ; - virtual p unmarshal(p reader) throw(IOException) ; + virtual void marshal(p object, p ostream) throw(IOException) ; + virtual p unmarshal(p istream) throw(IOException) ; + +protected: + p checkOutputStream(p ostream) throw (IOException) ; + p checkInputStream(p istream) throw (IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.cpp b/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.cpp index 7d310003bf..fcc1845bf5 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.cpp @@ -37,7 +37,7 @@ CorrelatorFilter::CorrelatorFilter(p next) : /* * */ -void CorrelatorFilter::oneway(p command) +void CorrelatorFilter::oneway(p command) { // Set command id and that no response is required command->setCommandId( getNextCommandId() ) ; @@ -49,7 +49,7 @@ void CorrelatorFilter::oneway(p command) /* * */ -p CorrelatorFilter::asyncRequest(p command) +p CorrelatorFilter::asyncRequest(p command) { // Set command id and that a response is required command->setCommandId( getNextCommandId() ) ; @@ -68,7 +68,7 @@ p CorrelatorFilter::asyncRequest(p command) /* * */ -p CorrelatorFilter::request(p command) +p CorrelatorFilter::request(p command) { p future = asyncRequest(command) ; p response = future->getResponse() ; @@ -94,9 +94,10 @@ p CorrelatorFilter::request(p command) /* * */ -void CorrelatorFilter::onCommand(p transport, p command) +void CorrelatorFilter::onCommand(p transport, p command) { - if( command->getDataStructureType() == Response::TYPE ) + if( command->getDataStructureType() == Response::TYPE || + command->getDataStructureType() == ExceptionResponse::TYPE ) { p response = p_cast(command) ; p future = requestMap[response->getCorrelationId()] ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.hpp b/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.hpp index eac15afcf9..ed4d3c6f41 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/CorrelatorFilter.hpp @@ -48,11 +48,11 @@ public: CorrelatorFilter(p next) ; virtual ~CorrelatorFilter() {} - virtual void oneway(p command) ; - virtual p asyncRequest(p command) ; - virtual p request(p command) ; + virtual void oneway(p command) ; + virtual p asyncRequest(p command) ; + virtual p request(p command) ; - virtual void onCommand(p transport, p command) ; + virtual void onCommand(p transport, p command) ; protected: virtual int getNextCommandId() ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/ICommandListener.hpp b/openwire-cpp/src/main/cpp/activemq/transport/ICommandListener.hpp index fd1db9f8f4..4e6925014b 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/ICommandListener.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/ICommandListener.hpp @@ -18,7 +18,7 @@ #define ActiveMQ_ICommandListener_hpp_ #include -#include "activemq/ICommand.hpp" +#include "activemq/command/BaseCommand.hpp" #include "ppr/util/ifr/p" namespace apache @@ -29,7 +29,6 @@ namespace apache { using namespace ifr; using namespace std; - using namespace apache::activemq; using namespace apache::activemq::command; using namespace apache::cms; struct ITransport; @@ -39,7 +38,7 @@ namespace apache */ struct ICommandListener : Interface { - virtual void onCommand(p transport, p command) = 0 ; + virtual void onCommand(p transport, p command) = 0 ; virtual void onError(p transport, exception& error) = 0 ; } ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/ITransport.hpp b/openwire-cpp/src/main/cpp/activemq/transport/ITransport.hpp index 5b251c2c12..18d8284ad6 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/ITransport.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/ITransport.hpp @@ -18,7 +18,7 @@ #define ActiveMQ_ITransport_hpp_ #include "cms/IStartable.hpp" -#include "activemq/ICommand.hpp" +#include "activemq/command/BaseCommand.hpp" #include "activemq/command/Response.hpp" #include "activemq/transport/FutureResponse.hpp" #include "activemq/transport/ICommandListener.hpp" @@ -43,9 +43,9 @@ struct ITransport : IStartable virtual void setCommandListener(p listener) = 0 ; virtual p getCommandListener() = 0 ; - virtual void oneway(p command) = 0 ; - virtual p asyncRequest(p command) = 0 ; - virtual p request(p command) = 0 ; + virtual void oneway(p command) = 0 ; + virtual p asyncRequest(p command) = 0 ; + virtual p request(p command) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.cpp b/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.cpp index 081f4d2197..ffecab48b5 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.cpp @@ -36,7 +36,7 @@ LoggingFilter::LoggingFilter(p next) : /* * */ -void LoggingFilter::oneway(p command) +void LoggingFilter::oneway(p command) { int cmdid = command->getCommandId(), corrid = -1 ; @@ -48,13 +48,7 @@ void LoggingFilter::oneway(p command) // Dump log entry printf("Sending command: cmd.id = %d, corr.id = %d, type = %s\n", cmdid, corrid, - AbstractCommand::getDataStructureTypeAsString(command->getDataStructureType())->c_str() ) ; - -/* cout << "Sending command: id = " << - command->getCommandId() << - ", type = " << - AbstractCommand::getDataStructureTypeAsString(command->getDataStructureType())->c_str() << - endl ;*/ + BaseDataStructure::getDataStructureTypeAsString(command->getDataStructureType())->c_str() ) ; this->next->oneway(command) ; } @@ -65,7 +59,7 @@ void LoggingFilter::oneway(p command) /* * */ -void LoggingFilter::onCommand(p transport, p command) +void LoggingFilter::onCommand(p transport, p command) { if( command == NULL ) cout << "Received NULL command" << endl ; @@ -81,13 +75,7 @@ void LoggingFilter::onCommand(p transport, p command) // Dump log entry printf("Received command: cmd.id = %d, corr.id = %d, type = %s\n", cmdid, corrid, - AbstractCommand::getDataStructureTypeAsString(command->getDataStructureType())->c_str() ) ; - -/* cout << "Recived command: id = " << - command->getCommandId() << - ", type = " << - AbstractCommand::getDataStructureTypeAsString(command->getDataStructureType())->c_str() << - endl ;*/ + BaseDataStructure::getDataStructureTypeAsString(command->getDataStructureType())->c_str() ) ; } // Forward incoming command to "real" listener diff --git a/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.hpp b/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.hpp index 4fb9d1e0e1..30935fe983 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/LoggingFilter.hpp @@ -43,9 +43,9 @@ public: LoggingFilter(p next) ; virtual ~LoggingFilter() {} - virtual void oneway(p command) ; + virtual void oneway(p command) ; - virtual void onCommand(p transport, p command) ; + virtual void onCommand(p transport, p command) ; virtual void onError(p transport, exception& error) ; } ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.cpp b/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.cpp index 47ad866830..ecb5c0747d 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.cpp @@ -44,7 +44,7 @@ MutexFilter::~MutexFilter() /* * */ -void MutexFilter::oneway(p command) +void MutexFilter::oneway(p command) { // Wait for transmission lock and then transmit command LOCKED_SCOPE (mutex) ; @@ -54,7 +54,7 @@ void MutexFilter::oneway(p command) /* * */ -p MutexFilter::asyncRequest(p command) +p MutexFilter::asyncRequest(p command) { // Wait for transmission lock and then transmit command LOCKED_SCOPE (mutex) ; @@ -64,7 +64,7 @@ p MutexFilter::asyncRequest(p command) /* * */ -p MutexFilter::request(p command) +p MutexFilter::request(p command) { // Wait for transmission lock and then transmit command LOCKED_SCOPE (mutex) ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.hpp b/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.hpp index 7eead6d012..99be41741b 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/MutexFilter.hpp @@ -43,9 +43,9 @@ public: MutexFilter(p next) ; virtual ~MutexFilter() ; - virtual void oneway(p command) ; - virtual p asyncRequest(p command) ; - virtual p request(p command) ; + virtual void oneway(p command) ; + virtual p asyncRequest(p command) ; + virtual p request(p command) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.cpp b/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.cpp index 2736e3aabd..57329d4d9a 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.cpp @@ -53,10 +53,16 @@ p TransportFactory::createTransport(p location) throw (SocketEx socket = connect(location->host().c_str(), location->port()) ; // Create wire protocol depending on specified query parameter - if( uriString.find("protocol=openwire") != string::npos ) - protocol = new OpenWireProtocol() ; + if( uriString.find("protocol=stomp") != string::npos ) + throw IllegalArgumentException("The STOMP protocol is not yet implemented") ; else - throw IllegalArgumentException("Unknown or unspecified wire protocol") ; + protocol = new OpenWireProtocol() ; + + // Configure character encoding depending on specified query parameter + if( uriString.find("encoding=none") != string::npos ) + CharsetEncoderRegistry::DEFAULT = NULL ; + else + CharsetEncoderRegistry::DEFAULT = AsciiToUTF8Encoder::NAME ; // Create transport depending on specified URI scheme if( uriString.find("tcp://") != string::npos ) diff --git a/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.hpp b/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.hpp index b3c775271c..0fce24a156 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/TransportFactory.hpp @@ -32,6 +32,8 @@ #include "activemq/transport/CorrelatorFilter.hpp" #include "activemq/transport/tcp/TcpTransport.hpp" #include "ppr/IllegalArgumentException.hpp" +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" +#include "ppr/io/encoding/AsciiToUTF8Encoder.hpp" #include "ppr/net/ISocket.hpp" #include "ppr/net/Socket.hpp" #include "ppr/net/SocketException.hpp" @@ -50,6 +52,7 @@ namespace apache using namespace apache::activemq::protocol; using namespace apache::activemq::protocol::openwire; using namespace apache::activemq::transport::tcp; + using namespace apache::ppr::io::encoding; using namespace apache::ppr::net; /* diff --git a/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.cpp b/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.cpp index 8be914e9ca..5a4b39f1fb 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.cpp @@ -70,7 +70,7 @@ void TransportFilter::start() /* * */ -void TransportFilter::oneway(p command) +void TransportFilter::oneway(p command) { this->next->oneway(command) ; } @@ -78,7 +78,7 @@ void TransportFilter::oneway(p command) /* * */ -p TransportFilter::asyncRequest(p command) +p TransportFilter::asyncRequest(p command) { return this->next->asyncRequest(command) ; } @@ -86,7 +86,7 @@ p TransportFilter::asyncRequest(p command) /* * */ -p TransportFilter::request(p command) +p TransportFilter::request(p command) { return this->next->request(command) ; } @@ -96,7 +96,7 @@ p TransportFilter::request(p command) /* * */ -void TransportFilter::onCommand(p transport, p command) +void TransportFilter::onCommand(p transport, p command) { // Forward incoming command to "real" listener this->listener->onCommand(transport, command) ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.hpp b/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.hpp index 88c3f212c2..5b6433cef9 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/TransportFilter.hpp @@ -18,6 +18,7 @@ #define ActiveMQ_TransportFilter_hpp_ #include +#include "activemq/command/BaseCommand.hpp" #include "activemq/command/Response.hpp" #include "activemq/transport/ITransport.hpp" #include "ppr/InvalidOperationException.hpp" @@ -50,11 +51,11 @@ public: virtual p getCommandListener() ; virtual void start() ; - virtual void oneway(p command) ; - virtual p asyncRequest(p command) ; - virtual p request(p command) ; + virtual void oneway(p command) ; + virtual p asyncRequest(p command) ; + virtual p request(p command) ; - virtual void onCommand(p transport, p command) ; + virtual void onCommand(p transport, p command) ; virtual void onError(p transport, exception& error) ; } ; diff --git a/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.cpp b/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.cpp index b8ffb6cdd4..d0b63005cb 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.cpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.cpp @@ -30,8 +30,8 @@ TcpTransport::TcpTransport(p socket, p wireProtocol) // Initialize members this->socket = socket ; this->protocol = wireProtocol ; - this->reader = NULL ; - this->writer = NULL ; + this->istream = NULL ; + this->ostream = NULL ; this->listener = NULL ; this->readThread = NULL ; this->started = false ; @@ -45,8 +45,8 @@ TcpTransport::~TcpTransport() { closed = true ; readThread->join() ; - reader->close() ; - socket->close() ; + istream->close() ; + ostream->close() ; } @@ -85,8 +85,8 @@ void TcpTransport::start() started = true ; // Create the I/O streams - writer = new SocketOutputStream(socket) ; - reader = new SocketInputStream(socket) ; + ostream = new DataOutputStream( new BufferedOutputStream( new SocketOutputStream(socket) ) ) ; + istream = new DataInputStream( new BufferedInputStream( new SocketInputStream(socket) ) ) ; // Create and start the background read thread readThread = new ReadThread(this) ; @@ -100,16 +100,16 @@ void TcpTransport::start() /* * */ -void TcpTransport::oneway(p command) +void TcpTransport::oneway(p command) { - protocol->marshal(command, writer) ; - writer->flush() ; + protocol->marshal(command, ostream) ; + ostream->flush() ; } /* * */ -p TcpTransport::asyncRequest(p command) +p TcpTransport::asyncRequest(p command) { throw InvalidOperationException("Use a CorrelatorFilter if you want to issue asynchrounous request calls.") ; } @@ -117,7 +117,7 @@ p TcpTransport::asyncRequest(p command) /* * */ -p TcpTransport::request(p command) +p TcpTransport::request(p command) { throw InvalidOperationException("Use a CorrelatorFilter if you want to issue request calls.") ; } @@ -133,12 +133,12 @@ void TcpTransport::readLoop() // Continue loop until closed or aborted while( !closed ) { - p command = NULL ; + p command = NULL ; try { // Read next command - command = p_cast (protocol->unmarshal(reader)) ; + command = p_cast (protocol->unmarshal(istream)) ; // Forward to command listener diff --git a/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.hpp b/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.hpp index 719d32a827..cbab462898 100644 --- a/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.hpp +++ b/openwire-cpp/src/main/cpp/activemq/transport/tcp/TcpTransport.hpp @@ -26,7 +26,6 @@ #include #include "cms/CmsException.hpp" #include "activemq/BrokerException.hpp" -#include "activemq/ICommand.hpp" #include "activemq/command/BaseCommand.hpp" #include "activemq/command/Response.hpp" #include "activemq/command/ExceptionResponse.hpp" @@ -35,6 +34,10 @@ #include "activemq/transport/ITransport.hpp" #include "activemq/transport/ICommandListener.hpp" #include "ppr/InvalidOperationException.hpp" +#include "ppr/io/DataInputStream.hpp" +#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/BufferedInputStream.hpp" +#include "ppr/io/BufferedOutputStream.hpp" #include "ppr/io/SocketInputStream.hpp" #include "ppr/io/SocketOutputStream.hpp" #include "ppr/net/ISocket.hpp" @@ -73,14 +76,14 @@ namespace apache class TcpTransport : public ITransport { private: - p protocol ; - p reader ; - p writer ; - p listener ; - p readThread ; - p socket ; - bool closed, - started ; + p protocol ; + p istream ; + p ostream ; + p listener ; + p readThread ; + p socket ; + bool closed, + started ; public: TcpTransport(p socket, p wireProtocol) ; @@ -90,9 +93,9 @@ public: virtual p getCommandListener() ; virtual void start() ; - virtual void oneway(p command) ; - virtual p asyncRequest(p command) ; - virtual p request(p command) ; + virtual void oneway(p command) ; + virtual p asyncRequest(p command) ; + virtual p request(p command) ; public: void readLoop() ; diff --git a/openwire-cpp/src/main/cpp/cms/IBytesMessage.hpp b/openwire-cpp/src/main/cpp/cms/IBytesMessage.hpp index d726cd8718..1cdb31c791 100644 --- a/openwire-cpp/src/main/cpp/cms/IBytesMessage.hpp +++ b/openwire-cpp/src/main/cpp/cms/IBytesMessage.hpp @@ -51,7 +51,7 @@ struct IBytesMessage : IMessage virtual int readInt() throw (MessageNotReadableException, MessageEOFException) = 0 ; virtual long long readLong() throw (MessageNotReadableException, MessageEOFException) = 0 ; virtual short readShort() throw (MessageNotReadableException, MessageEOFException) = 0 ; - virtual p readUTF() throw (MessageNotReadableException, MessageEOFException) = 0 ; + virtual p readString() throw (MessageNotReadableException, MessageEOFException) = 0 ; virtual void writeBoolean(bool value) throw (MessageNotWritableException) = 0 ; virtual void writeByte(char value) throw (MessageNotWritableException) = 0 ; virtual void writeBytes(char* value, int index, int length) throw (MessageNotWritableException) = 0 ; @@ -60,7 +60,7 @@ struct IBytesMessage : IMessage virtual void writeInt(int value) throw (MessageNotWritableException) = 0 ; virtual void writeLong(long long value) throw (MessageNotWritableException) = 0 ; virtual void writeShort(short value) throw (MessageNotWritableException) = 0 ; - virtual void writeUTF(const char* value) throw (MessageNotWritableException) = 0 ; + virtual void writeString(const char* value) throw (MessageNotWritableException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/cms/IMapMessage.hpp b/openwire-cpp/src/main/cpp/cms/IMapMessage.hpp index 5e4e464a80..ee7b94724a 100644 --- a/openwire-cpp/src/main/cpp/cms/IMapMessage.hpp +++ b/openwire-cpp/src/main/cpp/cms/IMapMessage.hpp @@ -23,6 +23,8 @@ #endif #include "cms/IMessage.hpp" +#include "cms/MessageFormatException.hpp" +#include "ppr/IllegalArgumentException.hpp" #include "ppr/util/MapItemHolder.hpp" #include "ppr/util/ifr/p" @@ -30,6 +32,7 @@ namespace apache { namespace cms { + using namespace apache::ppr; using namespace apache::ppr::util; using namespace ifr; @@ -39,6 +42,24 @@ namespace apache struct IMapMessage : IMessage { virtual p getBody() = 0 ; + virtual bool getBoolean(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setBoolean(const char* name, bool value) throw (IllegalArgumentException) = 0 ; + virtual char getByte(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setByte(const char* name, char value) throw (IllegalArgumentException) = 0 ; + virtual array getBytes(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setBytes(const char* name, array value) throw (IllegalArgumentException) = 0 ; + virtual double getDouble(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setDouble(const char* name, double value) throw (IllegalArgumentException) = 0 ; + virtual float getFloat(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setFloat(const char* name, float value) throw (IllegalArgumentException) = 0 ; + virtual int getInt(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setInt(const char* name, int value) throw (IllegalArgumentException) = 0 ; + virtual long long getLong(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setLong(const char* name, long long value) throw (IllegalArgumentException) = 0 ; + virtual short getShort(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setShort(const char* name, short value) throw (IllegalArgumentException) = 0 ; + virtual p getString(const char* name) throw (MessageFormatException, IllegalArgumentException) = 0 ; + virtual void setString(const char* name, const char* value) throw (IllegalArgumentException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.cpp new file mode 100644 index 0000000000..8a1edc4d54 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.cpp @@ -0,0 +1,132 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "ppr/io/BufferedInputStream.hpp" + +using namespace apache::ppr::io; + +/* + * + */ +BufferedInputStream::BufferedInputStream(p istream) +{ + this->istream = istream ; + this->size = DEFAULT_SIZE ; + buffer = new char[size] ; + position = 0 ; + treshold = 0 ; +} + +/* + * + */ +BufferedInputStream::BufferedInputStream(p istream, int size) +{ + this->istream = istream ; + this->size = size ; + buffer = new char[size] ; + position = 0 ; + treshold = 0 ; +} + +/* + * Close stream. + */ +void BufferedInputStream::close() throw(IOException) +{ + // Cascade close request to underlying stream + if( istream != NULL ) + { + istream->close() ; + istream = NULL ; + buffer = NULL ; + } +} + +/* + * + */ +int BufferedInputStream::read(char* buf, int offset, int length) throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Assert parameters + if( buf == NULL || offset < 0 || offset > length || length < 0 ) + throw IllegalArgumentException() ; + + // Skip read if length is invalid + if( length == 0 ) + return 0 ; + + // Have we reached end-of-buffer? + if( isEOB() ) + { + // Skip buffering should request be larger than internal buffer + if( length >= size ) + return istream->read(buf, offset, length) ; + + // Load internal buffer with new data + loadBuffer() ; + } + // Any data available? + if( isEOB() ) + return -1 ; + + // Copy requested bytes up to max buffer size + int bytesRead = min(length, treshold - position) ; + + // Copy read bytes into supplied buffer + memcpy(&buf[offset], &buffer[position], bytesRead) ; + + // Adjust array position + position += bytesRead ; + + return bytesRead ; +} + +/* + * Load the input buffer with new data. + */ +void BufferedInputStream::loadBuffer() throw(IOException) +{ + // Try to load the whole buffer + int bytesRead = istream->read(buffer, 0, size) ; + + // Reset counters if any data was loaded + if( bytesRead > 0 ) + { + treshold = bytesRead ; + position = 0 ; + } +} + +/* + * Check if stream has been closed. + */ +void BufferedInputStream::checkClosed() throw(IOException) +{ + if( istream == NULL ) + throw IOException("Input stream closed") ; +} + +/* + * Check is end-of-buffer has been reached. + */ +bool BufferedInputStream::isEOB() +{ + return ( position >= treshold ) ? true : false ; +} diff --git a/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.hpp new file mode 100644 index 0000000000..593e33d890 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/BufferedInputStream.hpp @@ -0,0 +1,74 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef Ppr_BufferedInputStream_hpp_ +#define Ppr_BufferedInputStream_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "ppr/IllegalArgumentException.hpp" +#include "ppr/io/IInputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/thread/SimpleMutex.hpp" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace ppr + { + namespace io + { + using namespace ifr ; + using namespace apache::ppr ; + using namespace apache::ppr::thread ; + +/* + * Buffers bytes to provide more efficient reading from an + * input stream. + */ +class BufferedInputStream : public IInputStream +{ +private: + p istream ; + char* buffer ; + int size, position, treshold ; + + // Default buffer size + static const int DEFAULT_SIZE = 10240 ; + +public: + BufferedInputStream(p istream) ; + BufferedInputStream(p istream, int size) ; + + virtual void close() throw(IOException) ; + virtual int read(char* buf, int offset, int length) throw(IOException) ; + +private: + void checkClosed() throw(IOException) ; + void loadBuffer() throw(IOException) ; + bool isEOB() ; +} ; + +/* namespace */ + } + } +} + +#endif /*Ppr_BufferedInputStream_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.cpp new file mode 100644 index 0000000000..88fb598438 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.cpp @@ -0,0 +1,142 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "ppr/io/BufferedOutputStream.hpp" + +using namespace apache::ppr::io; + +/* + * + */ +BufferedOutputStream::BufferedOutputStream(p ostream) +{ + this->ostream = ostream ; + this->size = DEFAULT_SIZE ; + buffer = new char[size] ; + position = 0 ; + treshold = size ; +} + +/* + * + */ +BufferedOutputStream::BufferedOutputStream(p ostream, int size) +{ + this->ostream = ostream ; + this->size = size ; + buffer = new char[size] ; + position = 0 ; + treshold = size ; +} + +/* + * Close stream. + */ +void BufferedOutputStream::close() throw(IOException) +{ + // Cascade close request to internal stream + if( ostream != NULL ) + { + // Flush any remaining bytes + flush0() ; + + // Shut down + ostream->close() ; + ostream = NULL ; + buffer = NULL ; + } +} + +/* + * + */ +int BufferedOutputStream::write(const char* buf, int offset, int length) throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Assert parameters + if( buf == NULL || offset < 0 || offset > length || length < 0 ) + throw IllegalArgumentException() ; + + // Skip write if length is invalid + if( length == 0 ) + return 0 ; + + // Skip buffering should request be larger than internal buffer + if( length >= size ) + { + flush0() ; + return ostream->write(buf, offset, length) ; + } + int start = offset, end = offset + length ; + + while( start < end ) + { + int delta = min(treshold - position, end - start) ; + memcpy(&buffer[position], &buf[start], delta) ; + start += delta ; + position += delta ; + + // Have we reached end-of-buffer? + if( isEOB() ) + flush0() ; + } + return length ; +} + +/* + * Flush stream, i.e. buffer. + */ +void BufferedOutputStream::flush() throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + flush0() ; +} + +/* + * Flush buffer. + */ +void BufferedOutputStream::flush0() throw(IOException) +{ + // Check if there is anything to flush + if( position > 0 ) + { + ostream->write(buffer, 0, position) ; + position = 0 ; + } + // Flush underlying stream + ostream->flush() ; +} + +/* + * Check if stream has been closed. + */ +void BufferedOutputStream::checkClosed() throw(IOException) +{ + if( ostream == NULL ) + throw IOException("Output stream closed") ; +} + +/* + * Check is end-of-buffer has been reached. + */ +bool BufferedOutputStream::isEOB() +{ + return ( position >= treshold ) ? true : false ; +} diff --git a/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.hpp new file mode 100644 index 0000000000..f66e0cf2bf --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/BufferedOutputStream.hpp @@ -0,0 +1,75 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef Ppr_BufferedOutputStream_hpp_ +#define Ppr_BufferedOutputStream_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include "ppr/IllegalArgumentException.hpp" +#include "ppr/io/IOutputStream.hpp" +#include "ppr/io/IOException.hpp" +#include "ppr/thread/SimpleMutex.hpp" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace ppr + { + namespace io + { + using namespace ifr ; + using namespace apache::ppr ; + using namespace apache::ppr::thread ; + +/* + * Buffers bytes to provide more efficient writing to an + * output stream. + */ +class BufferedOutputStream : public IOutputStream +{ +private: + p ostream ; + char* buffer ; + int size, position, treshold ; + + // Default buffer size + static const int DEFAULT_SIZE = 10240 ; + +public: + BufferedOutputStream(p ostream) ; + BufferedOutputStream(p ostream, int size) ; + + virtual void close() throw(IOException) ; + virtual void flush() throw(IOException) ; + virtual int write(const char* buf, int offset, int length) throw(IOException) ; + +private: + void checkClosed() throw(IOException) ; + void flush0() throw(IOException) ; + bool isEOB() ; +} ; + +/* namespace */ + } + } +} + +#endif /*Ppr_BufferedOutputStream_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/ppr/io/ByteArrayInputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/ByteArrayInputStream.hpp index f50bc52a35..2bd71b7eb1 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/ByteArrayInputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/ByteArrayInputStream.hpp @@ -17,7 +17,7 @@ #ifndef Ppr_ByteArrayInputStream_hpp_ #define Ppr_ByteArrayInputStream_hpp_ -#include "ppr/io/DataInputStream.hpp" +#include "ppr/io/IInputStream.hpp" #include "ppr/io/EOFException.hpp" #include "ppr/util/ifr/array" #include "ppr/util/ifr/p" @@ -34,7 +34,7 @@ namespace apache * ByteArrayInputStream reads primitive C++ data types from an * in-memory byte array. */ -class ByteArrayInputStream : public DataInputStream +class ByteArrayInputStream : public IInputStream { private: array body ; diff --git a/openwire-cpp/src/main/cpp/ppr/io/ByteArrayOutputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/ByteArrayOutputStream.hpp index 2fe21cfdef..feea4d93e4 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/ByteArrayOutputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/ByteArrayOutputStream.hpp @@ -17,7 +17,7 @@ #ifndef Ppr_ByteArrayOutputStream_hpp_ #define Ppr_ByteArrayOutputStream_hpp_ -#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/IOutputStream.hpp" #include "ppr/util/ifr/array" #include "ppr/util/ifr/p" @@ -33,7 +33,7 @@ namespace apache * ByteArrayOutputStream writes primitive C++ data types to a * in memory byte array. */ -class ByteArrayOutputStream : public DataOutputStream +class ByteArrayOutputStream : public IOutputStream { private: array body ; diff --git a/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.cpp index a992ec12f8..2ecffbd0f5 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.cpp +++ b/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.cpp @@ -21,9 +21,19 @@ using namespace apache::ppr::io; /* * */ -DataInputStream::DataInputStream() +DataInputStream::DataInputStream(p istream) { - // no-op + this->istream = istream ; + this->encoder = CharsetEncoderRegistry::getEncoder() ; +} + +/* + * + */ +DataInputStream::DataInputStream(p istream, const char* encname) +{ + this->istream = istream ; + this->encoder = CharsetEncoderRegistry::getEncoder(encname) ; } /* @@ -34,6 +44,31 @@ DataInputStream::~DataInputStream() // no-op } +/* + * + */ +void DataInputStream::close() throw(IOException) +{ + // Cascade close request to underlying stream + if( istream != NULL ) + { + istream->close() ; + istream = NULL ; + } +} + +/* + * + */ +int DataInputStream::read(char* buffer, int offset, int length) throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Read buffer + return istream->read(buffer, offset, length) ; +} + /* * */ @@ -41,8 +76,11 @@ char DataInputStream::readByte() throw(IOException) { char value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read a single byte - read(&value, 0, sizeof(char)) ; + istream->read(&value, 0, sizeof(char)) ; return value ; } @@ -62,8 +100,11 @@ double DataInputStream::readDouble() throw(IOException) { double value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read a double and convert from big endian to little endian if necessary - read((char*)&value, 0, sizeof(double) ) ; + istream->read((char*)&value, 0, sizeof(double) ) ; return ntohd(value) ; } @@ -74,8 +115,11 @@ float DataInputStream::readFloat() throw(IOException) { float value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read a float and convert from big endian to little endian if necessary - read((char*)&value, 0, sizeof(float)) ; + istream->read((char*)&value, 0, sizeof(float)) ; return ntohf(value) ; } @@ -86,8 +130,11 @@ short DataInputStream::readShort() throw(IOException) { short value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read a short and convert from big endian to little endian if necessary - read((char*)&value, 0, sizeof(short)) ; + istream->read((char*)&value, 0, sizeof(short)) ; return ntohs(value) ; } @@ -98,8 +145,11 @@ int DataInputStream::readInt() throw(IOException) { int value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read an int and convert from big endian to little endian if necessary - read((char*)&value, 0, sizeof(int)) ; + istream->read((char*)&value, 0, sizeof(int)) ; return ntohi(value) ; } @@ -110,8 +160,11 @@ long long DataInputStream::readLong() throw(IOException) { long long value ; + // Check if underlying stream has been closed + checkClosed() ; + // Read a long long and convert from big endian to little endian if necessary - read((char*)&value, 0, sizeof(long long)) ; + istream->read((char*)&value, 0, sizeof(long long)) ; return ntohll(value) ; } @@ -121,26 +174,42 @@ long long DataInputStream::readLong() throw(IOException) p DataInputStream::readString() throw(IOException) { p value ; - char* buffer ; short length ; + // Check if underlying stream has been closed + checkClosed() ; + // Read length of string length = readShort() ; - if (length < 0) { - throw IOException ("Negative length of string"); - } else if (length > 0) { - buffer = new char[length+1] ; + if (length < 0) + throw IOException ("Negative length of string") ; + else if (length > 0) + { + array buffer = array (length+1) ; // Read string bytes - read(buffer, 0, length) ; - *(buffer+length) = '\0' ; + istream->read(&buffer[0], 0, length) ; + buffer[length] = '\0' ; - // Create string class + // Create string value = new string() ; - value->assign(buffer) ; + value->assign( buffer.c_array() ) ; - return value ; - } else { - return new string (""); + // Decode string if charset encoder has been configured + if( encoder != NULL ) + value = encoder->decode(value) ; } + else // ...empty string + value = new string("") ; + + return value ; +} + +/* + * Check if stream has been closed. + */ +void DataInputStream::checkClosed() throw(IOException) +{ + if( istream == NULL ) + throw IOException("Input stream closed") ; } diff --git a/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.hpp index 4fd833ed56..a203f919d9 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/DataInputStream.hpp @@ -18,6 +18,8 @@ #define Ppr_DataInputStream_hpp_ #include "ppr/io/IInputStream.hpp" +#include "ppr/io/encoding/ICharsetEncoder.hpp" +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" #include "ppr/util/Endian.hpp" #include "ppr/util/ifr/p" @@ -27,13 +29,14 @@ namespace apache { namespace io { - using namespace apache::ppr::util; //htonx and ntohx functions. using namespace ifr; + using namespace apache::ppr::util; //htonx and ntohx functions. + using namespace apache::ppr::io::encoding; /* * The DataInputStream class reads primitive C++ data types from an * underlying input stream in a Java compatible way. Strings are - * read as raw bytes, no character decoding is performed. + * read as raw bytes or decoded should encoding have been configured. * * All numeric data types are assumed to be available in big * endian (network byte order) and are converted automatically @@ -43,12 +46,17 @@ namespace apache */ class DataInputStream : public IInputStream { +private: + p istream ; + p encoder ; + public: - DataInputStream() ; + DataInputStream(p istream) ; + DataInputStream(p istream, const char* encname) ; virtual ~DataInputStream() ; - virtual void close() throw(IOException) = 0 ; - virtual int read(char* buffer, int index, int count) throw(IOException) = 0 ; + virtual void close() throw(IOException) ; + virtual int read(char* buffer, int offset, int length) throw(IOException) ; virtual char readByte() throw(IOException) ; virtual bool readBoolean() throw(IOException) ; virtual double readDouble() throw(IOException) ; @@ -57,6 +65,9 @@ public: virtual int readInt() throw(IOException) ; virtual long long readLong() throw(IOException) ; virtual p readString() throw(IOException) ; + +protected: + void checkClosed() throw(IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.cpp index a5d4a5c844..e5042c3a7e 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.cpp +++ b/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.cpp @@ -18,65 +18,194 @@ using namespace apache::ppr::io; -void DataOutputStream::writeByte(char value) throw(IOException) +/* + * + */ +DataOutputStream::DataOutputStream(p ostream) { - // Write a single byte - write((char*)&value, 0, sizeof(char)) ; + this->ostream = ostream ; + this->encoder = CharsetEncoderRegistry::getEncoder() ; } +/* + * + */ +DataOutputStream::DataOutputStream(p ostream, const char* encname) +{ + this->ostream = ostream ; + this->encoder = CharsetEncoderRegistry::getEncoder(encname) ; +} + +/* + * + */ +DataOutputStream::~DataOutputStream() +{ + // no-op +} + +/* + * + */ +void DataOutputStream::close() throw(IOException) +{ + // Cascade close request to underlying stream + if( ostream != NULL ) + { + ostream->close() ; + ostream = NULL ; + } +} + +/* + * + */ +void DataOutputStream::flush() throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Flush stream + ostream->flush() ; +} + +/* + * + */ +int DataOutputStream::write(const char* buffer, int offset, int length) throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Write buffer + return ostream->write(buffer, offset, length) ; +} + +/* + * + */ +void DataOutputStream::writeByte(char value) throw(IOException) +{ + // Check if underlying stream has been closed + checkClosed() ; + + // Write a single byte + ostream->write((char*)&value, 0, sizeof(char)) ; +} + +/* + * + */ void DataOutputStream::writeBoolean(bool value) throw(IOException) { // Write a boolean ( value ) ? writeByte(0x01) : writeByte(0x00) ; } +/* + * + */ void DataOutputStream::writeDouble(double v) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Write a double, convert from little endian to big endian if necessary double value = htond(v) ; - write((char*)&value, 0, sizeof(double)) ; + ostream->write((char*)&value, 0, sizeof(double)) ; } +/* + * + */ void DataOutputStream::writeFloat(float v) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Write a float, convert from little endian to big endian if necessary float value = htonf(v) ; - write((char*)&value, 0, sizeof(float)) ; + ostream->write((char*)&value, 0, sizeof(float)) ; } +/* + * + */ void DataOutputStream::writeShort(short v) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Write a short, convert from little endian to big endian if necessary short value = htons(v) ; - write((char*)&value, 0, sizeof(short)) ; + ostream->write((char*)&value, 0, sizeof(short)) ; } +/* + * + */ void DataOutputStream::writeInt(int v) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Write an int, convert from little endian to big endian if necessary int value = htoni(v) ; - write((char*)&value, 0, sizeof(int)) ; + ostream->write((char*)&value, 0, sizeof(int)) ; } +/* + * + */ void DataOutputStream::writeLong(long long v) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Write a long long, convert from little endian to big endian if necessary long long value = htonll(v) ; - write((char*)&value, 0, sizeof(long long)) ; + ostream->write((char*)&value, 0, sizeof(long long)) ; } -void DataOutputStream::writeString(p value) throw(IOException) +/* + * + */ +int DataOutputStream::writeString(p value) throw(IOException) { + // Check if underlying stream has been closed + checkClosed() ; + // Assert argument if( value == NULL ) - return ; - if( value->length() > USHRT_MAX ) + return 0 ; + + p data ; + int length = (int)value->length() ; + + // Encode string if an charset encoder has been configured + if( encoder != NULL ) + data = encoder->encode(value, &length) ; + else + data = value ; + + // Assert string length + if( length > USHRT_MAX ) throw IOException("String length exceeds maximum length") ; // Write length of string - short length = (short)value->length() ; - writeShort( length ) ; + writeShort( (short)length ) ; // Write string contents - write((char*)value->c_str(), 0, length) ; + ostream->write((char*)data->c_str(), 0, length) ; + + return length ; +} + +/* + * Check if stream has been closed. + */ +void DataOutputStream::checkClosed() throw(IOException) +{ + if( ostream == NULL ) + throw IOException("Output stream closed") ; } diff --git a/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.hpp index d59bf9cb1d..bda3e3c6ff 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/DataOutputStream.hpp @@ -18,6 +18,8 @@ #define Ppr_DataOutputStream_hpp_ #include "ppr/io/IOutputStream.hpp" +#include "ppr/io/encoding/ICharsetEncoder.hpp" +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" #include "ppr/util/Endian.hpp" #include "ppr/util/ifr/p" @@ -27,13 +29,15 @@ namespace apache { namespace io { - using namespace apache::ppr::util; // htonx and ntohx functions. using namespace ifr; + using namespace apache::ppr::util; // htonx and ntohx functions. + using namespace apache::ppr::io::encoding; /* * The DataOutputStream class writes primitive C++ data types to an * underlying output stream in a Java compatible way. Strings - * are written as raw bytes, no character encoding is performed. + * are written as either raw bytes or encoded should encoding + * have been configured. * * All numeric data types are written in big endian (network byte * order) and if the platform is little endian they are converted @@ -43,10 +47,18 @@ namespace apache */ class DataOutputStream : public IOutputStream { +private: + p ostream ; + p encoder ; + public: - virtual void close() throw(IOException) = 0 ; - virtual void flush() throw(IOException) = 0 ; - virtual int write(const char* buffer, int index, int count) throw(IOException) = 0 ; + DataOutputStream(p ostream) ; + DataOutputStream(p ostream, const char* encname) ; + virtual ~DataOutputStream() ; + + virtual void close() throw(IOException) ; + virtual void flush() throw(IOException) ; + virtual int write(const char* buffer, int offset, int length) throw(IOException) ; virtual void writeByte(char v) throw(IOException) ; virtual void writeBoolean(bool v) throw(IOException) ; virtual void writeDouble(double v) throw(IOException) ; @@ -54,7 +66,10 @@ public: virtual void writeShort(short v) throw(IOException) ; virtual void writeInt(int v) throw(IOException) ; virtual void writeLong(long long v) throw(IOException) ; - virtual void writeString(p v) throw(IOException) ; + virtual int writeString(p v) throw(IOException) ; + +protected: + void checkClosed() throw(IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/IInputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/IInputStream.hpp index 8dcf5a9bd9..8118cf5b74 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/IInputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/IInputStream.hpp @@ -45,14 +45,6 @@ struct IInputStream : Interface { virtual void close() throw(IOException) = 0 ; virtual int read(char* buffer, int index, int count) throw(IOException) = 0 ; - virtual char readByte() throw(IOException) = 0 ; - virtual bool readBoolean() throw(IOException) = 0 ; - virtual double readDouble() throw(IOException) = 0 ; - virtual float readFloat() throw(IOException) = 0 ; - virtual short readShort() throw(IOException) = 0 ; - virtual int readInt() throw(IOException) = 0 ; - virtual long long readLong() throw(IOException) = 0 ; - virtual p readString() throw(IOException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/IOutputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/IOutputStream.hpp index 4f78e353fe..0723cec1a2 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/IOutputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/IOutputStream.hpp @@ -46,15 +46,7 @@ struct IOutputStream : Interface { virtual void close() throw(IOException) = 0 ; virtual void flush() throw(IOException) = 0 ; - virtual int write(const char* buffer, int index, int count) throw(IOException) = 0 ; - virtual void writeByte(char v) throw(IOException) = 0 ; - virtual void writeBoolean(bool v) throw(IOException) = 0 ; - virtual void writeDouble(double v) throw(IOException) = 0 ; - virtual void writeFloat(float v) throw(IOException) = 0 ; - virtual void writeShort(short v) throw(IOException) = 0 ; - virtual void writeInt(int v) throw(IOException) = 0 ; - virtual void writeLong(long long v) throw(IOException) = 0 ; - virtual void writeString(p v) throw(IOException) = 0 ; + virtual int write(const char* buffer, int offset, int length) throw(IOException) = 0 ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.cpp index f77e87cd82..6652b24369 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.cpp +++ b/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.cpp @@ -18,7 +18,18 @@ using namespace apache::ppr::io; -void SocketInputStream::close() throw(IOException) +/* + * + */ +SocketInputStream::SocketInputStream(p socket) +{ + this->socket = socket ; +} + +/* + * + */ +SocketInputStream::~SocketInputStream() { // no-op } @@ -26,21 +37,37 @@ void SocketInputStream::close() throw(IOException) /* * */ -int SocketInputStream::read(char* buf, int index, int size) throw(IOException) +void SocketInputStream::close() throw(IOException) { - char* buffer = buf + index ; - int length, remaining = size ; + // Cascade close request to underlying socket + if( socket != NULL ) + { + socket->close() ; + socket = NULL ; + } +} + +/* + * + */ +int SocketInputStream::read(char* buf, int offset, int length) throw(IOException) +{ + char* buffer = buf + offset ; + //char* buffer = buf + index ; + //int length, remaining = size ; + int bytesRead ; // Loop until requested number of bytes are read - while( remaining > 0 ) - { + //while( remaining > 0 ) + //{ // Try to read remaining bytes - length = remaining ; + // length = remaining ; try { // Read some bytes from socket - length = socket->receive(buffer, length) ; + //length = socket->receive(buffer, length) ; + bytesRead = socket->receive(buffer, length) ; } catch( SocketException se ) { @@ -49,8 +76,9 @@ int SocketInputStream::read(char* buf, int index, int size) throw(IOException) } // Adjust buffer pointer and remaining number of bytes - buffer += length ; - remaining -= length ; - } - return size ; + //buffer += length ; + //remaining -= length ; + //} + //return size ; + return bytesRead ; } diff --git a/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.hpp index eb04c18f5b..315691d256 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/SocketInputStream.hpp @@ -17,7 +17,7 @@ #ifndef Ppr_SocketInputStream_hpp_ #define Ppr_SocketInputStream_hpp_ -#include "ppr/io/DataInputStream.hpp" +#include "ppr/io/IInputStream.hpp" #include "ppr/net/ISocket.hpp" #include "ppr/net/SocketException.hpp" #include "ppr/util/ifr/p" @@ -30,22 +30,23 @@ namespace apache { using namespace ifr ; using namespace apache::ppr::net ; - using namespace apache::ppr::util ; /* * SocketInputStream reads primitive C++ data types from a * socket stream. It currently uses PPR sockets for * platform independency. */ -class SocketInputStream : public DataInputStream +class SocketInputStream : public IInputStream { private: p socket ; + public: - SocketInputStream(p socket) : socket (socket) {} -public: + SocketInputStream(p socket) ; + virtual ~SocketInputStream() ; + virtual void close() throw(IOException) ; - virtual int read(char* buffer, int index, int size) throw(IOException) ; + virtual int read(char* buffer, int offset, int length) throw(IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.cpp b/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.cpp index ca900c5c27..7674d189e7 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.cpp +++ b/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.cpp @@ -34,11 +34,22 @@ SocketOutputStream::~SocketOutputStream() // no-op } +/* + * + */ void SocketOutputStream::close() throw(IOException) { - // no-op + // Cascade close request to underlying socket + if( socket != NULL ) + { + socket->close() ; + socket = NULL ; + } } +/* + * + */ void SocketOutputStream::flush() throw(IOException) { // no-op @@ -47,21 +58,24 @@ void SocketOutputStream::flush() throw(IOException) /* * */ -int SocketOutputStream::write(const char* buf, int index, int size) throw(IOException) +int SocketOutputStream::write(const char* buf, int offset, int length) throw(IOException) { - const char* buffer = buf + index ; - int length, remaining = size ; + const char* buffer = buf + offset ; + //const char* buffer = buf + index ; + //int length, remaining = size ; + int bytesWritten ; // Loop until requested number of bytes are read - while( remaining > 0 ) - { + //while( remaining > 0 ) + //{ // Try to write remaining bytes - length = remaining ; + //length = remaining ; try { // Write some bytes to socket - length = socket->send(buffer, length) ; + //length = socket->send(buffer, length) ; + bytesWritten = socket->send(buffer, length) ; } catch( SocketException se ) { @@ -70,8 +84,9 @@ int SocketOutputStream::write(const char* buf, int index, int size) throw(IOExce } // Adjust buffer pointer and remaining number of bytes - buffer += length ; - remaining -= length ; - } - return size ; + //buffer += length ; + //remaining -= length ; + //} + //return size ; + return bytesWritten ; } diff --git a/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.hpp b/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.hpp index 3dfa21ebde..16a34e6cf1 100644 --- a/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.hpp +++ b/openwire-cpp/src/main/cpp/ppr/io/SocketOutputStream.hpp @@ -17,7 +17,7 @@ #ifndef Ppr_SocketOutputStream_hpp_ #define Ppr_SocketOutputStream_hpp_ -#include "ppr/io/DataOutputStream.hpp" +#include "ppr/io/IOutputStream.hpp" #include "ppr/net/ISocket.hpp" #include "ppr/net/SocketException.hpp" #include "ppr/util/ifr/p" @@ -30,14 +30,13 @@ namespace apache { using namespace ifr ; using namespace apache::ppr::net ; - using namespace apache::ppr::util ; /* * SocketOutputStream writes primitive C++ data types to a * socket stream. It currently uses PPR sockets for * platform independency. */ -class SocketOutputStream : public DataOutputStream +class SocketOutputStream : public IOutputStream { private: p socket ; @@ -48,7 +47,7 @@ public: virtual void close() throw(IOException) ; virtual void flush() throw(IOException) ; - virtual int write(const char* buffer, int index, int size) throw(IOException) ; + virtual int write(const char* buffer, int offset, int length) throw(IOException) ; } ; /* namespace */ diff --git a/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.cpp b/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.cpp new file mode 100644 index 0000000000..cd159feaa7 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.cpp @@ -0,0 +1,187 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "ppr/io/encoding/AsciiToUTF8Encoder.hpp" + +using namespace apache::ppr::io::encoding; + + +// Init static members +const char* AsciiToUTF8Encoder::NAME = "AsciiToUTF8" ; + +/* + * + */ +AsciiToUTF8Encoder::AsciiToUTF8Encoder() +{ + // no-op +} + +/* + * + */ +AsciiToUTF8Encoder::~AsciiToUTF8Encoder() +{ + // no-op +} + +/* + * Counts length of encoded version of given string. + */ +int AsciiToUTF8Encoder::length(p str) +{ + // Assert parameter + if( str == NULL ) + { + // Nothing to encode + return 0 ; + } + + int ch, + utflen = 0, + strlen = (int)str->length() ; + + for( int i = 0 ; i < strlen ; i++ ) + { + ch = ((*str)[i] & 0xFF) ; + + // Single byte in range 0x0001 - 0x007F + if( (ch >= 0x0001) && (ch <= 0x007F) ) + utflen++ ; + + // Triple bytes above 0x07FF (should never occur, ASCII 0x00 - 0xFF) + else if( ch > 0x07FF ) + utflen += 3 ; + + // Double bytes for 0x0000 and in range 0x0080 - 0x07FF + else + utflen += 2 ; + } + return utflen ; +} + +/* + * Encodes given string from ASCII into modified UTF-8. + */ +p AsciiToUTF8Encoder::encode(p str, int *enclen) +{ + // Assert parameter + if( str == NULL ) + { + // Nothing to encode + *enclen = 0 ; + return NULL ; + } + + p encstr = new string("") ; + int ch, strlen = (int)str->length() ; + + // Init encoded length + *enclen = 0 ; + + // Loop through string and encode each char + for( int i = 0 ; i < strlen ; i++ ) + { + ch = ((*str)[i] & 0xFF) ; + + // Single byte in range 0x0001 - 0x007F + if( (ch >= 0x0001) && (ch <= 0x007F) ) + { + encstr->append(1, (char)ch) ; + (*enclen)++ ; + } + // Triple bytes above 0x07FF (should never occur, ASCII 0x00 - 0xFF) + else if( ch > 0x07FF ) + { + encstr->append(1, (char)( ((ch >> 12) & 0x0F) | 0xE0 )) ; + encstr->append(1, (char)( ((ch >> 6) & 0x3F) | 0x80 )) ; + encstr->append(1, (char)( ((ch >> 0) & 0x3F) | 0x80 )) ; + *enclen += 3 ; + } + // Double bytes for 0x0000 and in range 0x0080 - 0x07FF + else + { + encstr->append(1, (char)( ((ch >> 6) & 0x1F) | 0xC0 )) ; + encstr->append(1, (char)( ((ch >> 0) & 0x3F) | 0x80 )) ; + *enclen += 2 ; + } + } + return encstr ; +} + +/* + * Decodes given string from modified UTF-8 into ASCII. + */ +p AsciiToUTF8Encoder::decode(p str) +{ + // Assert argument + if( str == NULL || str->length() == 0 ) + return NULL ; + + p decstr = new string("") ; + int length = (int)str->length() ; + unsigned char ch, ch2, ch3; + int i = 0 ; + + // Loop through and decode each char + while( i < length ) + { + ch = ((*str)[i] & 0xFF) ; + + switch( ch >> 4 ) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: // Single byte char, 0xxxxxxx + i++ ; + decstr->append( 1, (char)ch ) ; + break ; + case 12: + case 13: // Double bytes char, 110xxxxx 10xxxxxx + i += 2 ; + + if( i > length ) + throw exception() ; + + ch2 = (*str)[i - 1] ; + if( (ch2 & 0xC0) != 0x80 ) + throw exception() ; + + decstr->append( 1, (char)(((ch & 0x1F) << 6) | (ch2 & 0x3F)) ) ; + break ; + case 14: // Triple bytes char, 1110xxxx 10xxxxxx 10xxxxxx + i += 3 ; + if( i > length ) + throw exception() ; + + ch2 = (*str)[i - 2] ; + ch3 = (*str)[i - 1] ; + if( ((ch2 & 0xC0) != 0x80) || ((ch3 & 0xC0) != 0x80) ) + throw exception(); + + decstr->append( 1, (char)(((ch & 0x0F) << 12) | ((ch2 & 0x3F) << 6) | ((ch3 & 0x3F) << 0)) ) ; + break ; + default: // Unsupported, 10xxxxxx 1111xxxx + throw exception() ; + } + } + return decstr ; +} diff --git a/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.hpp b/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.hpp new file mode 100644 index 0000000000..da6023a14a --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/encoding/AsciiToUTF8Encoder.hpp @@ -0,0 +1,63 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef Ppr_AsciiToUTF8Encoder_hpp_ +#define Ppr_AsciiToUTF8Encoder_hpp_ + +#include +#include +#include +#include +#include + +namespace apache +{ + namespace ppr + { + namespace io + { + namespace encoding + { + using namespace std; + using namespace ifr; + using namespace ppr::io ; + +/* + * Character encoder for extended ASCII to modified UTF-8 encoding. + */ +class AsciiToUTF8Encoder : public ICharsetEncoder +{ +private: + +public: + static const char* NAME ; + +public: + AsciiToUTF8Encoder() ; + virtual ~AsciiToUTF8Encoder() ; + + virtual int length(p str) ; + virtual p encode(p str, int *enclen) ; + virtual p decode(p str) ; +} ; + +/* namespace */ + } + } + } +} + +#endif /*Ppr_AsciiToUTF8Encoder_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.cpp b/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.cpp new file mode 100644 index 0000000000..503d494cbb --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.cpp @@ -0,0 +1,121 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "ppr/io/encoding/CharsetEncoderRegistry.hpp" +#include +#include + +using namespace apache::ppr::io::encoding; + +// Init static members +map > CharsetEncoderRegistry::encoders ; +const char* CharsetEncoderRegistry::DEFAULT = AsciiToUTF8Encoder::NAME ; + +// Init the default set of encoders +static CharsetEncoderRegistry::MapInitializer initializer ; + + +// --- Constructors ------------------------------------------------- + +/* + * + */ +CharsetEncoderRegistry::CharsetEncoderRegistry() +{ + // no-op +} + +/* + * + */ +CharsetEncoderRegistry::~CharsetEncoderRegistry() +{ + // no-op +} + + +// --- Attribute methods -------------------------------------------- + +/* + * + */ +p CharsetEncoderRegistry::getEncoder() +{ + return getEncoder( CharsetEncoderRegistry::DEFAULT ) ; +} + +/* + * + */ +p CharsetEncoderRegistry::getEncoder(const char* name) +{ + // Assert argument + if( name == NULL ) + return NULL ; + + map >::iterator tempIter ; + string key = string(name) ; + + // Make key string all lower case + std::transform(key.begin(), key.end(), key.begin(), (int(*)(int))tolower) ; // The explicit cast is needed to compile on Linux + + // Check if key exists in map + tempIter = encoders.find( key ) ; + if( tempIter != encoders.end() ) + return tempIter->second ; + else // Not found + return NULL ; +} + + +// --- Operation methods -------------------------------------------- + +/* + * + */ +void CharsetEncoderRegistry::addEncoder(const char* name, p encoder) throw(IllegalArgumentException) +{ + // Assert arguments + if( name == NULL || encoder == NULL ) + throw IllegalArgumentException("Name and/or encoder cannot be NULL") ; + + // Make key string all lower case + string key = string(name) ; + std::transform(key.begin(), key.end(), key.begin(), (int(*)(int))tolower) ; // The explicit cast is needed to compile on Linux + + encoders[key] = encoder ; +} + +/* + * + */ +void CharsetEncoderRegistry::removeEncoder(const char* name) throw(IllegalArgumentException) +{ + // Assert argument + if( name == NULL ) + throw IllegalArgumentException("Name cannot be NULL") ; + + map >::iterator tempIter ; + string key = string(name) ; + + // Make key string all lower case + std::transform(key.begin(), key.end(), key.begin(), (int(*)(int))tolower) ; // The explicit cast is needed to compile on Linux + + // Check if key exists in map + tempIter = encoders.find( key ) ; + if( tempIter != encoders.end() ) + encoders.erase( tempIter ) ; +} diff --git a/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.hpp b/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.hpp new file mode 100644 index 0000000000..6030a4b9b2 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/encoding/CharsetEncoderRegistry.hpp @@ -0,0 +1,88 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef Ppr_CharsetEncoderRegistry_hpp_ +#define Ppr_CharsetEncoderRegistry_hpp_ + +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif + +#include +#include +#include "ppr/io/encoding/ICharsetEncoder.hpp" +#include "ppr/IllegalArgumentException.hpp" +#include "ppr/io/encoding/AsciiToUTF8Encoder.hpp" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace ppr + { + namespace io + { + namespace encoding + { + using namespace ifr ; + using namespace std ; + using namespace apache::ppr ; + +/* + * The character set encoder registry maintains all available + * encoders/decoders. + */ +class CharsetEncoderRegistry +{ +private: + static map > encoders ; + +public: + // Name of the default encoder + static const char* DEFAULT ; + +protected: + CharsetEncoderRegistry() ; + +public: + virtual ~CharsetEncoderRegistry() ; + + static p getEncoder() ; + static p getEncoder(const char* name) ; + + static void addEncoder(const char* name, p encoder) throw(IllegalArgumentException) ; + static void removeEncoder(const char* name) throw(IllegalArgumentException) ; + + class MapInitializer + { + public: + MapInitializer() + { + // Add the default set of encoders + CharsetEncoderRegistry::addEncoder(AsciiToUTF8Encoder::NAME, new AsciiToUTF8Encoder() ) ; + } + } ; + + friend class CharsetEncoderRegistry::MapInitializer ; +} ; + +/* namespace */ + } + } + } +} + +#endif /*Ppr_CharsetEncoderRegistry_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/ppr/io/encoding/ICharsetEncoder.hpp b/openwire-cpp/src/main/cpp/ppr/io/encoding/ICharsetEncoder.hpp new file mode 100644 index 0000000000..891fd00ab3 --- /dev/null +++ b/openwire-cpp/src/main/cpp/ppr/io/encoding/ICharsetEncoder.hpp @@ -0,0 +1,52 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef Ppr_ICharsetEncoder_hpp_ +#define Ppr_ICharsetEncoder_hpp_ + +#include +#include "ppr/util/ifr/array" +#include "ppr/util/ifr/p" + +namespace apache +{ + namespace ppr + { + namespace io + { + namespace encoding + { + using namespace ifr ; + using namespace std ; + +/* + * The ICharsetEncoder interface should be implemented by any class + * intended to be a character set encoder/decoder. + */ +struct ICharsetEncoder : Interface +{ + virtual int length(p str) = 0 ; + virtual p encode(p str, int *enclen) = 0 ; + virtual p decode(p str) = 0 ; +} ; + +/* namespace */ + } + } + } +} + +#endif /*Ppr_ICharsetEncoder_hpp_*/ diff --git a/openwire-cpp/src/main/cpp/ppr/util/Hex.cpp b/openwire-cpp/src/main/cpp/ppr/util/Hex.cpp index 929c6eb486..36921e730d 100644 --- a/openwire-cpp/src/main/cpp/ppr/util/Hex.cpp +++ b/openwire-cpp/src/main/cpp/ppr/util/Hex.cpp @@ -47,6 +47,5 @@ p Hex::toString(array buffer) sprintf(&result[i*2], "%02x", (unsigned char) buffer[i]) ; hexStr = new string(result.c_array(), result.size() - 1) ; - return hexStr ; } diff --git a/openwire-cpp/src/test/cpp/TestListener.hpp b/openwire-cpp/src/test/cpp/IUnitTest.hpp similarity index 60% rename from openwire-cpp/src/test/cpp/TestListener.hpp rename to openwire-cpp/src/test/cpp/IUnitTest.hpp index c956d2b0d7..44acee09b9 100644 --- a/openwire-cpp/src/test/cpp/TestListener.hpp +++ b/openwire-cpp/src/test/cpp/IUnitTest.hpp @@ -14,31 +14,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef TestListener_hpp_ -#define TestListener_hpp_ +#ifndef IUnitTest_hpp_ +#define IUnitTest_hpp_ -#include -#include +// Turn off warning message for ignored exception specification +#ifdef _MSC_VER +#pragma warning( disable : 4290 ) +#endif -#include "cms/IMessage.hpp" -#include "cms/IBytesMessage.hpp" -#include "cms/IMessageListener.hpp" +#include #include "ppr/util/ifr/p" -using namespace apache::cms; using namespace ifr; using namespace std; -/* - * - */ -class TestListener : public IMessageListener +struct IUnitTest : Interface { -public: - TestListener() ; - virtual ~TestListener() ; + virtual void setUp() throw (exception) = 0 ; + virtual void execute() throw (exception) = 0 ; + virtual void tearDown() throw (exception) = 0 ; + virtual p toString() = 0 ; +}; - virtual void onMessage(p message) ; -} ; - -#endif /*TestListener_hpp_*/ +#endif /*IUnitTest_hpp_*/ diff --git a/openwire-cpp/src/test/cpp/TestAsynchQueue.cpp b/openwire-cpp/src/test/cpp/TestAsynchQueue.cpp new file mode 100644 index 0000000000..d9e84643ce --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestAsynchQueue.cpp @@ -0,0 +1,121 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "TestAsynchQueue.hpp" + +/* + * + */ +TestAsynchQueue::TestAsynchQueue(p connection) +{ + this->connection = connection ; + this->error = NULL ; +} + +/* + * + */ +TestAsynchQueue::~TestAsynchQueue() +{ + // no-op +} + +/* + * + */ +void TestAsynchQueue::setUp() throw (exception) +{ + // Create a session + session = connection->createSession() ; +} + +/* + * + */ +void TestAsynchQueue::execute() throw (exception) +{ + p queue ; + p consumer ; + p producer ; + p message ; + + // Connect to a queue + queue = session->getQueue("FOO.BAR") ; + + // Create producer and a asycnhrounous consumer + producer = session->createProducer(queue) ; + consumer = session->createConsumer(queue) ; + consumer->setMessageListener( smartify(this) ) ; + + // Create binary message + message = session->createBytesMessage() ; + message->writeBoolean(true) ; + message->writeInt(3677490) ; + message->writeString("Hello Binary World!") ; + + // Send message + producer->send(message) ; + + // Wait for asynchronous message for 5s + semaphore.wait(5) ; + + // Check if any error was registered by the message handler + if( error != NULL ) + throw TraceException( error ) ; +} + +/* + * + */ +void TestAsynchQueue::tearDown() throw (exception) +{ + // Clean up + session->close() ; + session = NULL ; +} + +p TestAsynchQueue::toString() +{ + p str = new string("Send/receive a byte message to 1 queue listener asynchronously") ; + return str ; +} + +void TestAsynchQueue::onMessage(p message) +{ + if( message == NULL ) + { + error = "Received a null message" ; + semaphore.notify() ; + return ; + } + + p msg = p_dyncast (message) ; + if( msg == NULL ) + { + error = "Received wrong type of message" ; + semaphore.notify() ; + return ; + } + + // Verify message content + if( msg->readBoolean() != true || + msg->readInt() != 3677490 || + msg->readString()->compare("Hello Binary World!") != 0 ) + { + error = "Message content has been corrupted" ; + } + semaphore.notify() ; +} diff --git a/openwire-cpp/src/test/cpp/TestAsynchQueue.hpp b/openwire-cpp/src/test/cpp/TestAsynchQueue.hpp new file mode 100644 index 0000000000..ef7327b594 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestAsynchQueue.hpp @@ -0,0 +1,59 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef TestAsynchQueue_hpp_ +#define TestAsynchQueue_hpp_ + +#include +#include + +#include "cms/IConnection.hpp" +#include "ppr/thread/Semaphore.hpp" +#include "ppr/TraceException.hpp" +#include "ppr/util/ifr/p" + +#include "IUnitTest.hpp" + +using namespace apache::cms; +using namespace apache::ppr; +using namespace apache::ppr::thread; +using namespace ifr; +using namespace std; + +/* + * Tests sending/receiving a message to an asynchronous listener. + */ +class TestAsynchQueue : public IUnitTest, public IMessageListener +{ +private: + p connection ; + p session ; + Semaphore semaphore ; + char* error ; + +public: + TestAsynchQueue(p connection) ; + virtual ~TestAsynchQueue() ; + + virtual void setUp() throw (exception) ; + virtual void execute() throw (exception) ; + virtual void tearDown() throw (exception) ; + virtual p toString() ; + + virtual void onMessage(p message) ; +} ; + +#endif /*TestAsynchQueue_hpp_*/ diff --git a/openwire-cpp/src/test/cpp/TestAsynchTopic.cpp b/openwire-cpp/src/test/cpp/TestAsynchTopic.cpp new file mode 100644 index 0000000000..49457234c3 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestAsynchTopic.cpp @@ -0,0 +1,125 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "TestAsynchTopic.hpp" + +/* + * + */ +TestAsynchTopic::TestAsynchTopic(p connection) +{ + this->connection = connection ; + this->error = NULL ; +} + +/* + * + */ +TestAsynchTopic::~TestAsynchTopic() +{ + // no-op +} + +/* + * + */ +void TestAsynchTopic::setUp() throw (exception) +{ + // Create a session + session = connection->createSession() ; +} + +/* + * + */ +void TestAsynchTopic::execute() throw (exception) +{ + p topic ; + p consumer1, + consumer2 ; + p producer ; + p message ; + + // Connect to a topic + topic = session->getTopic("TEST.TOPIC") ; + + // Create producer and two asynchrounous consumers + producer = session->createProducer(topic) ; + consumer1 = session->createConsumer(topic) ; + consumer1->setMessageListener( smartify(this) ) ; + consumer2 = session->createConsumer(topic) ; + consumer2->setMessageListener( smartify(this) ) ; + + // Create binary message + message = session->createMapMessage() ; + message->setBoolean("key1", false) ; + message->setInt("key2", 8494845) ; + message->setString("key3", "Hello Map World!") ; + + // Send message + producer->send(message) ; + + // Wait for asynchronous messages for 5s each + semaphore.wait(5) ; + semaphore.wait(5) ; + + // Check if any error was registered by the message handlers + if( error != NULL ) + throw TraceException( error ) ; +} + +/* + * + */ +void TestAsynchTopic::tearDown() throw (exception) +{ + // Clean up + session->close() ; + session = NULL ; +} + +p TestAsynchTopic::toString() +{ + p str = new string("Send/receive a map message to 2 topic listener asynchronously") ; + return str ; +} + +void TestAsynchTopic::onMessage(p message) +{ + if( message == NULL ) + { + error = "Received a null message" ; + semaphore.notify() ; + return ; + } + + p msg = p_dyncast (message) ; + if( msg == NULL ) + { + error = "Received wrong type of message" ; + semaphore.notify() ; + return ; + } + + // Verify message content + if( msg->getBoolean("key1") != false || + msg->getInt("key2") != 8494845 || + msg->getString("key3")->compare("Hello Map World!") != 0 ) + { + error = "Message content has been corrupted" ; + } + semaphore.notify() ; +} diff --git a/openwire-cpp/src/test/cpp/TestAsynchTopic.hpp b/openwire-cpp/src/test/cpp/TestAsynchTopic.hpp new file mode 100644 index 0000000000..676339d8b0 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestAsynchTopic.hpp @@ -0,0 +1,59 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef TestAsynchTopic_hpp_ +#define TestAsynchTopic_hpp_ + +#include +#include + +#include "cms/IConnection.hpp" +#include "ppr/thread/Semaphore.hpp" +#include "ppr/util/ifr/p" + +#include "ppr/TraceException.hpp" +#include "IUnitTest.hpp" + +using namespace apache::cms; +using namespace apache::ppr; +using namespace apache::ppr::thread; +using namespace ifr; +using namespace std; + +/* + * Tests sending/receiving a message to two asynchronous listeners. + */ +class TestAsynchTopic : public IUnitTest, public IMessageListener +{ +private: + p connection ; + p session ; + Semaphore semaphore ; + char* error ; + +public: + TestAsynchTopic(p connection) ; + virtual ~TestAsynchTopic() ; + + virtual void setUp() throw (exception) ; + virtual void execute() throw (exception) ; + virtual void tearDown() throw (exception) ; + virtual p toString() ; + + virtual void onMessage(p message) ; +} ; + +#endif /*TestAsynchTopic_hpp_*/ diff --git a/openwire-cpp/src/test/cpp/TestListener.cpp b/openwire-cpp/src/test/cpp/TestListener.cpp deleted file mode 100644 index 6db280d573..0000000000 --- a/openwire-cpp/src/test/cpp/TestListener.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * 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. - */ -#include "TestListener.hpp" - -/* - * - */ -TestListener::TestListener() -{ -} - -/* - * - */ -TestListener::~TestListener() -{ -} - -/* - * - */ -void TestListener::onMessage(p message) -{ - try - { - p msg = p_dyncast (message) ; - - if( msg == NULL ) - cout << "No message received!" << endl ; - else - { - cout << "Received message with ID: " << msg->getJMSMessageID()->c_str() << endl ; - cout << " boolean: " << (msg->readBoolean() ? "true" : "false") << endl ; - cout << " integer: " << msg->readInt() << endl ; - cout << " string: " << msg->readUTF()->c_str() << endl ; - } - } - catch( exception& e ) - { - cout << "OnMessage caught: " << e.what() << endl ; - } -} diff --git a/openwire-cpp/src/test/cpp/TestLocalTXCommit.cpp b/openwire-cpp/src/test/cpp/TestLocalTXCommit.cpp new file mode 100644 index 0000000000..f9e9547386 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestLocalTXCommit.cpp @@ -0,0 +1,153 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "TestLocalTXCommit.hpp" + +/* + * + */ +TestLocalTXCommit::TestLocalTXCommit(p connection) +{ + this->connection = connection ; + this->error = NULL ; + this->transmitted = false ; + this->matchCount = 0 ; +} + +/* + * + */ +TestLocalTXCommit::~TestLocalTXCommit() +{ + // no-op +} + +/* + * + */ +void TestLocalTXCommit::setUp() throw (exception) +{ + // Create a session + session = connection->createSession( TransactionalAckMode ) ; +} + +/* + * + */ +void TestLocalTXCommit::execute() throw (exception) +{ + p queue ; + p consumer ; + p producer ; + p message1, message2; + + // Connect to a queue + queue = session->getQueue("FOO.BAR") ; + + // Create producer and a asycnhrounous consumer + producer = session->createProducer(queue) ; + consumer = session->createConsumer(queue) ; + consumer->setMessageListener( smartify(this) ) ; + + // Create text messages + message1 = session->createTextMessage("LocalTX 1") ; + message2 = session->createTextMessage("LocalTX 2") ; + + // Send messages + producer->send(message1) ; + producer->send(message2) ; + + // Commit transaction + transmitted = true ; + session->commit() ; + + // Wait for asynchronous receive for 5s + semaphore.wait(5) ; + + // Check if any error was registered by the message handler + if( error != NULL ) + throw TraceException( error ) ; +} + +/* + * + */ +void TestLocalTXCommit::tearDown() throw (exception) +{ + // Clean up + session->close() ; + session = NULL ; +} + +p TestLocalTXCommit::toString() +{ + p str = new string("Sends multiple messages to a queue guarded by a local transaction") ; + return str ; +} + +void TestLocalTXCommit::onMessage(p message) +{ + if( !transmitted ) + { + error = "Received a message before transaction was committed" ; + session->rollback() ; + semaphore.notify() ; + return ; + } + + if( message == NULL ) + { + error = "Received a null message" ; + session->rollback() ; + semaphore.notify() ; + return ; + } + + p msg = p_dyncast (message) ; + if( msg == NULL ) + { + error = "Received wrong type of message" ; + semaphore.notify() ; + return ; + } + + // Verify message content + if( msg->getText()->compare("LocalTX 1") != 0 || + msg->getText()->compare("LocalTX 2") != 0 ) + { + matchCount++ ; + } + else + { + error = "Message content has been corrupted" ; + + // Rollback receive + session->rollback() ; + + // Wakeup main thread + semaphore.notify() ; + } + + // Did we receive both messages? + if( matchCount == 2 ) + { + // Commit receive + session->commit() ; + + // Wakeup main thread + semaphore.notify() ; + } +} diff --git a/openwire-cpp/src/test/cpp/TestLocalTXCommit.hpp b/openwire-cpp/src/test/cpp/TestLocalTXCommit.hpp new file mode 100644 index 0000000000..b12fad68a7 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestLocalTXCommit.hpp @@ -0,0 +1,63 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef TestLocalTXCommit_hpp_ +#define TestLocalTXCommit_hpp_ + +#include +#include + +#include "cms/IConnection.hpp" +#include "activemq/AcknowledgementMode.hpp" +#include "ppr/thread/Semaphore.hpp" +#include "ppr/TraceException.hpp" +#include "ppr/util/ifr/p" + +#include "IUnitTest.hpp" + +using namespace apache; +using namespace apache::cms; +using namespace apache::ppr; +using namespace apache::ppr::thread; +using namespace ifr; +using namespace std; + +/* + * Tests sending multiple messages to a queue guarded by a local transaction. + */ +class TestLocalTXCommit : public IUnitTest, public IMessageListener +{ +private: + p connection ; + p session ; + Semaphore semaphore ; + char* error ; + bool transmitted ; + int matchCount ; + +public: + TestLocalTXCommit(p connection) ; + virtual ~TestLocalTXCommit() ; + + virtual void setUp() throw (exception) ; + virtual void execute() throw (exception) ; + virtual void tearDown() throw (exception) ; + virtual p toString() ; + + virtual void onMessage(p message) ; +} ; + +#endif /*TestLocalTXCommit_hpp_*/ diff --git a/openwire-cpp/src/test/cpp/TestMain.cpp b/openwire-cpp/src/test/cpp/TestMain.cpp deleted file mode 100644 index 0c94417844..0000000000 --- a/openwire-cpp/src/test/cpp/TestMain.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright 2006 The Apache Software Foundation or its licensors, as - * applicable. - * - * 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. - */ -#include - -#include "cms/IConnectionFactory.hpp" -#include "cms/IConnection.hpp" -#include "cms/IDestination.hpp" -#include "cms/IMessageConsumer.hpp" -#include "cms/IMessageProducer.hpp" -#include "cms/ISession.hpp" -#include "cms/ITextMessage.hpp" -#include "activemq/ConnectionFactory.hpp" -#include "activemq/Connection.hpp" -#include "activemq/command/ActiveMQTextMessage.hpp" -#include "ppr/TraceException.hpp" -#include "ppr/util/MapItemHolder.hpp" -#include "ppr/net/Uri.hpp" -#include "ppr/util/ifr/p" -#include "TestListener.hpp" - -using namespace apache::activemq; -using namespace apache::activemq::command; -using namespace apache::cms; -using namespace apache::ppr; -using namespace apache::ppr::net; -using namespace apache::ppr::util; -using namespace ifr; -using namespace std; - -/* - * Tests synchronous sending/receiving of a text message - */ -void testSyncTextMessage() -{ - try - { - p factory ; - p connection ; - p session ; - p queue ; - p consumer ; - p producer ; - p reqMessage, - rspMessage ; - p uri ; - p props ; - - cout << "Connecting to ActiveMQ broker..." << endl ; - - uri = new Uri("tcp://127.0.0.1:61616?trace=true&protocol=openwire") ; - factory = new ConnectionFactory(uri) ; - connection = factory->createConnection() ; - - // Create session - session = connection->createSession() ; - - // Connect to queue - queue = session->getQueue("FOO.BAR") ; - - cout << "Using destination: " << queue->getQueueName()->c_str() << endl ; - - // Create a consumer and producer - consumer = session->createConsumer(queue) ; - producer = session->createProducer(queue) ; - producer->setPersistent(true) ; - - // Create a message - reqMessage = session->createTextMessage("Hello World!") ; - reqMessage->setJMSCorrelationID("abc") ; - reqMessage->setJMSXGroupID("cheese") ; - props = reqMessage->getProperties() ; - (*props)["someHeader"] = MapItemHolder( "James" ) ; - - // Send message - producer->send(reqMessage) ; - - cout << "Waiting for asynchrounous receive message..." << endl ; - - // Receive and wait for a message - rspMessage = p_dyncast (consumer->receive()) ; - if( rspMessage == NULL ) - cout << "No message received!" << endl ; - else - { - cout << "Received message with ID: " << rspMessage->getJMSMessageID()->c_str() << endl ; - cout << " and text: " << rspMessage->getText()->c_str() << endl ; - } - // Shutdown gracefully (including all attached sub-items, sessions, consumer/producer) - connection->close() ; - - cout << "Disconnected from ActiveMQ broker" << endl ; - } - catch( TraceException& te ) - { - cout << "Caught: " << te.what() << endl ; - //cout << "Stack: " << e.getStackTrace() ; - } - catch( exception& e ) - { - cout << "Caught: " << e.what() << endl ; - //cout << "Stack: " << e.getStackTrace() ; - } -} - -/* - * Tests asynchronous sending/receiving of a binary message - */ -void testAsyncByteMessage() -{ - try - { - p factory ; - p connection ; - p session ; - p queue ; - p consumer ; - p producer ; - p reqMessage, - rspMessage ; - p uri ; - p props ; - p listener ; - - cout << "Connecting to ActiveMQ broker..." << endl ; - - uri = new Uri("tcp://127.0.0.1:61616?trace=true&protocol=openwire") ; - factory = new ConnectionFactory(uri) ; - connection = factory->createConnection() ; - - // Create session - session = connection->createSession() ; - - // Connect to queue - queue = session->getQueue("FOO.BAR") ; - - cout << "Using destination: " << queue->getQueueName()->c_str() << endl ; - - // Create producer and a asycnhrounous consumer - producer = session->createProducer(queue) ; - producer->setPersistent(true) ; - consumer = session->createConsumer(queue) ; - listener = new TestListener() ; - consumer->setMessageListener(listener) ; - - // Create binary message - reqMessage = session->createBytesMessage() ; - reqMessage->writeBoolean(true) ; - reqMessage->writeInt(3677490) ; - reqMessage->writeUTF("Hello Binary World!") ; - - // Send message - producer->send(reqMessage) ; - - // Wait for asynchronous message - char c = getchar() ; - - // Shutdown gracefully (including all attached sub-items, sessions, consumer/producer) - connection->close() ; - - cout << "Disconnected from ActiveMQ broker" << endl ; - } - catch( TraceException& te ) - { - cout << "Caught: " << te.what() << endl ; - //cout << "Stack: " << e.getStackTrace() ; - } - catch( exception& e ) - { - cout << "Caught: " << e.what() << endl ; - //cout << "Stack: " << e.getStackTrace() ; - } -} - -int main() -{ - testSyncTextMessage() ; - testAsyncByteMessage() ; -} diff --git a/openwire-cpp/src/test/cpp/TestSuite.cpp b/openwire-cpp/src/test/cpp/TestSuite.cpp new file mode 100644 index 0000000000..60aa235be5 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestSuite.cpp @@ -0,0 +1,238 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "TestSuite.hpp" + +#include "TestSynchQueue.hpp" +#include "TestAsynchQueue.hpp" +#include "TestAsynchTopic.hpp" +#include "TestLocalTXCommit.hpp" + +/* + * + */ +TestSuite::TestSuite() +{ + this->name = NULL ; + this->trace = false ; + this->connection = NULL ; +} + +/* + * + */ +TestSuite::~TestSuite() +{ + // no-op +} + +/* + * + */ +void TestSuite::setURI(const char* uri) +{ + this->uri = new Uri(uri) ; +} + +/* + * + */ +void TestSuite::setSingle(const char* name) +{ + this->name = name ; +} + +/* + * + */ +void TestSuite::setUp() throw (TraceException) +{ + p factory ; + + cout << "Connecting to ActiveMQ broker..." << endl ; + factory = new ConnectionFactory( this->uri ) ; + connection = factory->createConnection() ; + + this->unitTests["SynchQueue"] = new TestSynchQueue( connection ) ; + this->unitTests["AsynchQueue"] = new TestAsynchQueue( connection ) ; + this->unitTests["AsynchTopic"] = new TestAsynchTopic( connection ) ; + this->unitTests["LocalTXCommit"] = new TestLocalTXCommit( connection ) ; +} + +/* + * + */ +void TestSuite::execute() throw (TraceException) +{ + + try + { + // Set up test suite + setUp() ; + } + catch( TraceException& e ) + { + cout << "Failed to set up test suite. " << e.what() << endl ; + exit(-1) ; + } + + if( name != NULL ) + runSingle( name ) ; + else + runAll() ; + + try + { + // Tear down test suite + tearDown() ; + } + catch( TraceException& e ) + { + cout << "Failed to tear down test suite. " << e.what() << endl ; + exit(-1) ; + } +} + +/* + * + */ +void TestSuite::tearDown() throw (TraceException) +{ + if( connection != NULL ) + connection->close() ; +} + +/* + * + */ +p TestSuite::toString() +{ + p str = new string("ActiveMQ C++ Client Test Suite") ; + return str ; +} + +/* + * + */ +void TestSuite::runSingle(const char* name) throw (TraceException) +{ + // Find unit test + map< string, p >::iterator tempIter ; + string key = string(name) ; + + try + { + // Locate given unit test + tempIter = unitTests.find(key) ; + if( tempIter == unitTests.end() ) + { + cout << "No unit test named [" << name << "] found." << endl ; + exit(-1) ; + } + string info ; + + info.assign( tempIter->second->toString()->c_str() ) ; + + // Pad with spaces up to 71 chars + for( int i = (int)info.length() ; i < 71 ; i++ ) + info.append(" ") ; + + cout << info.c_str() ; + + tempIter->second->setUp() ; + tempIter->second->execute() ; + tempIter->second->tearDown() ; + + cout << "[ OK ]" << endl ; + } + catch( TraceException& e ) + { + cout << "[FAILED]" << endl ; + cout << " " << e.what() << endl ; + } +} + +/* + * + */ +void TestSuite::runAll() throw (TraceException) +{ + map< string, p >::iterator tempIter ; + + // Loop through and execute all unit tests + for( tempIter = unitTests.begin() ; + tempIter != unitTests.end() ; + tempIter++ ) + { + string info ; + + info.assign( tempIter->second->toString()->c_str() ) ; + + // Pad with spaces up to 71 chars + for( int i = (int)info.length() ; i < 71 ; i++ ) + info.append(" ") ; + + cout << info.c_str() ; + + try + { + tempIter->second->setUp() ; + tempIter->second->execute() ; + tempIter->second->tearDown() ; + + cout << "[ OK ]" << endl ; + } + catch( TraceException& e ) + { + cout << "[FAILED]" << endl ; + cout << " " << e.what() << endl ; + } + } +} + +/* + * Main entry point. + */ +int main(int argc, char *argv[]) +{ + TestSuite suite ; + + // Print usage if no arguments was supplied + if( argc <= 1 ) + { + cout << "usage: test \"uri\" [name]" << endl ; + cout << " uri The URI to the ActiveMQ broker, surrounded with quotation marks" << endl ; + cout << " name The name of a single unit test to execute" << endl ; + exit(-1) ; + } + + // Check cmdline args for URI + // Sample URI: "tcp://192.168.64.142:61616?trace=false&protocol=openwire&encoding=none" + for( int i = 0 ; i < argc ; i++ ) + { + // Skip program name + if( i == 0 ) + continue ; + + // Assume URI + if( i == 1 ) + suite.setURI( argv[i] ) ; + // Assume unit test name + if( i == 2 ) + suite.setSingle( argv[i] ) ; + } + suite.execute() ; +} diff --git a/openwire-cpp/src/test/cpp/TestSuite.hpp b/openwire-cpp/src/test/cpp/TestSuite.hpp new file mode 100644 index 0000000000..28c388a6a8 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestSuite.hpp @@ -0,0 +1,68 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef TestSuite_hpp_ +#define TestSuite_hpp_ + +#include +#include +#include +#include + +#include "cms/IConnection.hpp" +#include "cms/IConnectionFactory.hpp" +#include "activemq/ConnectionFactory.hpp" +#include "activemq/Connection.hpp" +#include "ppr/TraceException.hpp" +#include "ppr/net/Uri.hpp" +#include "ppr/util/ifr/p" + +#include "IUnitTest.hpp" + +using namespace apache::activemq; +using namespace apache::cms; +using namespace apache::ppr; +using namespace apache::ppr::net; +using namespace ifr; +using namespace std; + +class TestSuite : public IUnitTest +{ +private: + p connection ; + p uri ; + map< string, p > unitTests ; + const char* name ; + bool trace ; + +public: + TestSuite() ; + virtual ~TestSuite() ; + + virtual void setURI(const char* uri) ; + virtual void setSingle(const char* name) ; + + virtual void setUp() throw (TraceException) ; + virtual void execute() throw (TraceException) ; + virtual void tearDown() throw (TraceException) ; + virtual p toString() ; + +protected: + void runSingle(const char* name) throw (TraceException) ; + void runAll() throw (TraceException) ; +} ; + +#endif /*TestSuite_hpp_*/ diff --git a/openwire-cpp/src/test/cpp/TestSynchQueue.cpp b/openwire-cpp/src/test/cpp/TestSynchQueue.cpp new file mode 100644 index 0000000000..76dd64fb88 --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestSynchQueue.cpp @@ -0,0 +1,110 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#include "TestSynchQueue.hpp" + +/* + * + */ +TestSynchQueue::TestSynchQueue(p connection) +{ + this->connection = connection ; +} + +/* + * + */ +TestSynchQueue::~TestSynchQueue() +{ + // no-op +} + +/* + * + */ +void TestSynchQueue::setUp() throw (exception) +{ + // Create a session + session = connection->createSession() ; +} + +/* + * + */ +void TestSynchQueue::execute() throw (exception) +{ + p queue ; + p consumer ; + p producer ; + p reqMessage, + rspMessage ; + p props ; + MapItemHolder item ; + + // Connect to queue + queue = session->getQueue("FOO.BAR") ; + + // Create a consumer and producer + consumer = session->createConsumer(queue) ; + producer = session->createProducer(queue) ; + producer->setPersistent(true) ; + + // Create a message + reqMessage = session->createTextMessage("Hello World!") ; + reqMessage->setJMSCorrelationID("abc") ; + reqMessage->setJMSXGroupID("cheese") ; + props = reqMessage->getProperties() ; + (*props)["someHeader"] = MapItemHolder( "James" ) ; + + // Send message + producer->send(reqMessage) ; + + // Receive and wait for a message + rspMessage = p_dyncast (consumer->receive()) ; + if( rspMessage == NULL ) + throw TraceException("Received a null message") ; + else + { + props = rspMessage->getProperties() ; + item = (*props)["someHeader"] ; + + // Verify message + if( rspMessage->getJMSCorrelationID()->compare("abc") != 0 ) + throw TraceException("Returned message has invalid correlation ID") ; + if( rspMessage->getJMSXGroupID()->compare("cheese") != 0 ) + throw TraceException("Returned message has invalid group ID") ; + if( rspMessage->getText()->compare("Hello World!") != 0 ) + throw TraceException("Returned message has altered body text") ; + if( item.getString()->compare("James") != 0 ) + throw TraceException("Returned message has invalid properties") ; + } +} + +/* + * + */ +void TestSynchQueue::tearDown() throw (exception) +{ + // Clean up + session->close() ; + session = NULL ; +} + +p TestSynchQueue::toString() +{ + p str = new string("Send/receive a text message to a queue synchronously") ; + return str ; +} diff --git a/openwire-cpp/src/test/cpp/TestSynchQueue.hpp b/openwire-cpp/src/test/cpp/TestSynchQueue.hpp new file mode 100644 index 0000000000..a8f72e44ed --- /dev/null +++ b/openwire-cpp/src/test/cpp/TestSynchQueue.hpp @@ -0,0 +1,50 @@ +/* + * Copyright 2006 The Apache Software Foundation or its licensors, as + * applicable. + * + * 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. + */ +#ifndef TestSynchQueue_hpp_ +#define TestSynchQueue_hpp_ + +#include +#include + +#include "cms/IConnection.hpp" +#include "ppr/TraceException.hpp" +#include "ppr/util/ifr/p" + +#include "IUnitTest.hpp" + +using namespace apache::cms; +using namespace apache::ppr; +using namespace ifr; +using namespace std; + +class TestSynchQueue : public IUnitTest +{ +private: + p connection ; + p session ; + +public: + TestSynchQueue(p connection) ; + virtual ~TestSynchQueue() ; + + virtual void setUp() throw (exception) ; + virtual void execute() throw (exception) ; + virtual void tearDown() throw (exception) ; + virtual p toString() ; +} ; + +#endif /*TestSynchQueue_hpp_*/