A few openwire refactors/enhancments

- The old/default marshaling style is now refered to tight encoding 
 - We now support a loose encoding style which should be less CPU intensive (it's only a 1 pass algorithim)
 - prefixing the packet size is now optional (needs more testing)
 - Updated the c client so that it works once again.



git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@381926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-03-01 06:29:45 +00:00
parent eba9e88af8
commit 33b73ac71d
172 changed files with 6352 additions and 2854 deletions

View File

@ -40,7 +40,7 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
} }
protected void generateUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) { protected void generateTightUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
out.print(" "); out.print(" ");
String propertyName = property.getSimpleName(); String propertyName = property.getSimpleName();
String type = property.getType().getSimpleName(); String type = property.getType().getSimpleName();
@ -49,22 +49,22 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
out.println("info." + propertyName + " = bs.ReadBoolean();"); out.println("info." + propertyName + " = bs.ReadBoolean();");
} }
else if (type.equals("byte")) { else if (type.equals("byte")) {
out.println("info." + propertyName + " = DataStreamMarshaller.ReadByte(dataIn);"); out.println("info." + propertyName + " = BaseDataStreamMarshaller.ReadByte(dataIn);");
} }
else if (type.equals("char")) { else if (type.equals("char")) {
out.println("info." + propertyName + " = DataStreamMarshaller.ReadChar(dataIn);"); out.println("info." + propertyName + " = BaseDataStreamMarshaller.ReadChar(dataIn);");
} }
else if (type.equals("short")) { else if (type.equals("short")) {
out.println("info." + propertyName + " = DataStreamMarshaller.ReadShort(dataIn);"); out.println("info." + propertyName + " = BaseDataStreamMarshaller.ReadShort(dataIn);");
} }
else if (type.equals("int")) { else if (type.equals("int")) {
out.println("info." + propertyName + " = DataStreamMarshaller.ReadInt(dataIn);"); out.println("info." + propertyName + " = BaseDataStreamMarshaller.ReadInt(dataIn);");
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("info." + propertyName + " = UnmarshalLong(wireFormat, dataIn, bs);"); out.println("info." + propertyName + " = TightUnmarshalLong(wireFormat, dataIn, bs);");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("info." + propertyName + " = ReadString(dataIn, bs);"); out.println("info." + propertyName + " = TightUnmarshalString(dataIn, bs);");
} }
else if (type.equals("byte[]") || type.equals("ByteSequence")) { else if (type.equals("byte[]") || type.equals("ByteSequence")) {
if (size != null) { if (size != null) {
@ -75,17 +75,17 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
} }
} }
else if (isThrowable(property.getType())) { else if (isThrowable(property.getType())) {
out.println("info." + propertyName + " = UnmarshalBrokerError(wireFormat, dataIn, bs);"); out.println("info." + propertyName + " = TightUnmarshalBrokerError(wireFormat, dataIn, bs);");
} }
else if (isCachedProperty(property)) { else if (isCachedProperty(property)) {
out.println("info." + propertyName + " = (" + type + ") UnmarshalCachedObject(wireFormat, dataIn, bs);"); out.println("info." + propertyName + " = (" + type + ") TightUnmarshalCachedObject(wireFormat, dataIn, bs);");
} }
else { else {
out.println("info." + propertyName + " = (" + type + ") UnmarshalNestedObject(wireFormat, dataIn, bs);"); out.println("info." + propertyName + " = (" + type + ") TightUnmarshalNestedObject(wireFormat, dataIn, bs);");
} }
} }
protected void generateUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) { protected void generateTightUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
JClass propertyType = property.getType(); JClass propertyType = property.getType();
String arrayType = propertyType.getArrayComponentType().getSimpleName(); String arrayType = propertyType.getArrayComponentType().getSimpleName();
String propertyName = property.getSimpleName(); String propertyName = property.getSimpleName();
@ -94,17 +94,17 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
out.println(" {"); out.println(" {");
out.println(" " + arrayType + "[] value = new " + arrayType + "[" + size.asInt() + "];"); out.println(" " + arrayType + "[] value = new " + arrayType + "[" + size.asInt() + "];");
out.println(" " + "for( int i=0; i < " + size.asInt() + "; i++ ) {"); out.println(" " + "for( int i=0; i < " + size.asInt() + "; i++ ) {");
out.println(" value[i] = (" + arrayType + ") UnmarshalNestedObject(wireFormat,dataIn, bs);"); out.println(" value[i] = (" + arrayType + ") TightUnmarshalNestedObject(wireFormat,dataIn, bs);");
out.println(" }"); out.println(" }");
out.println(" info." + propertyName + " = value;"); out.println(" info." + propertyName + " = value;");
out.println(" }"); out.println(" }");
} }
else { else {
out.println(" if (bs.ReadBoolean()) {"); out.println(" if (bs.ReadBoolean()) {");
out.println(" short size = DataStreamMarshaller.ReadShort(dataIn);"); out.println(" short size = BaseDataStreamMarshaller.ReadShort(dataIn);");
out.println(" " + arrayType + "[] value = new " + arrayType + "[size];"); out.println(" " + arrayType + "[] value = new " + arrayType + "[size];");
out.println(" for( int i=0; i < size; i++ ) {"); out.println(" for( int i=0; i < size; i++ ) {");
out.println(" value[i] = (" + arrayType + ") UnmarshalNestedObject(wireFormat,dataIn, bs);"); out.println(" value[i] = (" + arrayType + ") TightUnmarshalNestedObject(wireFormat,dataIn, bs);");
out.println(" }"); out.println(" }");
out.println(" info." + propertyName + " = value;"); out.println(" info." + propertyName + " = value;");
out.println(" }"); out.println(" }");
@ -114,7 +114,7 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
} }
} }
protected int generateMarshal1Body(PrintWriter out) { protected int generateTightMarshal1Body(PrintWriter out) {
List properties = getProperties(); List properties = getProperties();
int baseSize = 0; int baseSize = 0;
for (Iterator iter = properties.iterator(); iter.hasNext();) { for (Iterator iter = properties.iterator(); iter.hasNext();) {
@ -133,19 +133,19 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
baseSize += 1; baseSize += 1;
} }
else if (type.equals("char")) { else if (type.equals("char")) {
baseSize += 1; baseSize += 2;
} }
else if (type.equals("short")) { else if (type.equals("short")) {
baseSize += 1; baseSize += 2;
} }
else if (type.equals("int")) { else if (type.equals("int")) {
baseSize += 1; baseSize += 4;
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("rc += Marshal1Long(wireFormat, " + getter + ", bs);"); out.println("rc += TightMarshalLong1(wireFormat, " + getter + ", bs);");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("rc += WriteString(" + getter + ", bs);"); out.println("rc += TightMarshalString1(" + getter + ", bs);");
} }
else if (type.equals("byte[]") || type.equals("ByteSequence")) { else if (type.equals("byte[]") || type.equals("ByteSequence")) {
if (size == null) { if (size == null) {
@ -158,28 +158,28 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
} }
else if (propertyType.isArrayType()) { else if (propertyType.isArrayType()) {
if (size != null) { if (size != null) {
out.println("rc += MarshalObjectArrayConstSize(wireFormat, " + getter + ", bs, " + size.asInt() + ");"); out.println("rc += TightMarshalObjectArrayConstSize1(wireFormat, " + getter + ", bs, " + size.asInt() + ");");
} }
else { else {
out.println("rc += MarshalObjectArray(wireFormat, " + getter + ", bs);"); out.println("rc += TightMarshalObjectArray1(wireFormat, " + getter + ", bs);");
} }
} }
else if (isThrowable(propertyType)) { else if (isThrowable(propertyType)) {
out.println("rc += MarshalBrokerError(wireFormat, " + getter + ", bs);"); out.println("rc += TightMarshalBrokerError1(wireFormat, " + getter + ", bs);");
} }
else { else {
if (isCachedProperty(property)) { if (isCachedProperty(property)) {
out.println("rc += Marshal1CachedObject(wireFormat, " + getter + ", bs);"); out.println("rc += TightMarshalCachedObject1(wireFormat, " + getter + ", bs);");
} }
else { else {
out.println("rc += Marshal1NestedObject(wireFormat, " + getter + ", bs);"); out.println("rc += TightMarshalNestedObject1(wireFormat, " + getter + ", bs);");
} }
} }
} }
return baseSize; return baseSize;
} }
protected void generateMarshal2Body(PrintWriter out) { protected void generateTightMarshal2Body(PrintWriter out) {
List properties = getProperties(); List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) { for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next(); JProperty property = (JProperty) iter.next();
@ -194,22 +194,22 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
out.println("bs.ReadBoolean();"); out.println("bs.ReadBoolean();");
} }
else if (type.equals("byte")) { else if (type.equals("byte")) {
out.println("DataStreamMarshaller.WriteByte(" + getter + ", dataOut);"); out.println("BaseDataStreamMarshaller.WriteByte(" + getter + ", dataOut);");
} }
else if (type.equals("char")) { else if (type.equals("char")) {
out.println("DataStreamMarshaller.WriteChar(" + getter + ", dataOut);"); out.println("BaseDataStreamMarshaller.WriteChar(" + getter + ", dataOut);");
} }
else if (type.equals("short")) { else if (type.equals("short")) {
out.println("DataStreamMarshaller.WriteShort(" + getter + ", dataOut);"); out.println("BaseDataStreamMarshaller.WriteShort(" + getter + ", dataOut);");
} }
else if (type.equals("int")) { else if (type.equals("int")) {
out.println("DataStreamMarshaller.WriteInt(" + getter + ", dataOut);"); out.println("BaseDataStreamMarshaller.WriteInt(" + getter + ", dataOut);");
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("Marshal2Long(wireFormat, " + getter + ", dataOut, bs);"); out.println("TightMarshalLong2(wireFormat, " + getter + ", dataOut, bs);");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("WriteString(" + getter + ", dataOut, bs);"); out.println("TightMarshalString2(" + getter + ", dataOut, bs);");
} }
else if (type.equals("byte[]") || type.equals("ByteSequence")) { else if (type.equals("byte[]") || type.equals("ByteSequence")) {
if (size != null) { if (size != null) {
@ -217,28 +217,28 @@ public abstract class OpenWireCSharpMarshallingScript extends OpenWireJavaMarsha
} }
else { else {
out.println("if(bs.ReadBoolean()) {"); out.println("if(bs.ReadBoolean()) {");
out.println(" DataStreamMarshaller.WriteInt(" + getter + ".Length, dataOut);"); out.println(" BaseDataStreamMarshaller.WriteInt(" + getter + ".Length, dataOut);");
out.println(" dataOut.Write(" + getter + ");"); out.println(" dataOut.Write(" + getter + ");");
out.println(" }"); out.println(" }");
} }
} }
else if (propertyType.isArrayType()) { else if (propertyType.isArrayType()) {
if (size != null) { if (size != null) {
out.println("MarshalObjectArrayConstSize(wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + ");"); out.println("TightMarshalObjectArrayConstSize2(wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + ");");
} }
else { else {
out.println("MarshalObjectArray(wireFormat, " + getter + ", dataOut, bs);"); out.println("TightMarshalObjectArray2(wireFormat, " + getter + ", dataOut, bs);");
} }
} }
else if (isThrowable(propertyType)) { else if (isThrowable(propertyType)) {
out.println("MarshalBrokerError(wireFormat, " + getter + ", dataOut, bs);"); out.println("TightMarshalBrokerError2(wireFormat, " + getter + ", dataOut, bs);");
} }
else { else {
if (isCachedProperty(property)) { if (isCachedProperty(property)) {
out.println("Marshal2CachedObject(wireFormat, " + getter + ", dataOut, bs);"); out.println("TightMarshalCachedObject2(wireFormat, " + getter + ", dataOut, bs);");
} }
else { else {
out.println("Marshal2NestedObject(wireFormat, " + getter + ", dataOut, bs);"); out.println("TightMarshalNestedObject2(wireFormat, " + getter + ", dataOut, bs);");
} }
} }
} }

View File

@ -16,13 +16,18 @@
*/ */
package org.apache.activemq.openwire.tool; package org.apache.activemq.openwire.tool;
import org.codehaus.jam.*; import java.io.File;
import java.io.FileWriter;
import java.io.*; import java.io.PrintWriter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.codehaus.jam.JAnnotation;
import org.codehaus.jam.JAnnotationValue;
import org.codehaus.jam.JClass;
import org.codehaus.jam.JProperty;
/** /**
* *
* @version $Revision$ * @version $Revision$
@ -77,7 +82,7 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
} }
protected String getBaseClassName(JClass jclass) { protected String getBaseClassName(JClass jclass) {
String answer = "DataStreamMarshaller"; String answer = "BaseDataStreamMarshaller";
JClass superclass = jclass.getSuperclass(); JClass superclass = jclass.getSuperclass();
if (superclass != null) { if (superclass != null) {
String superName = superclass.getSimpleName(); String superName = superclass.getSimpleName();
@ -91,7 +96,7 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
protected void initialiseManuallyMaintainedClasses() { protected void initialiseManuallyMaintainedClasses() {
} }
protected void generateUnmarshalBody(PrintWriter out) { protected void generateTightUnmarshalBody(PrintWriter out) {
List properties = getProperties(); List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) { for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next(); JProperty property = (JProperty) iter.next();
@ -101,15 +106,15 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
String propertyTypeName = propertyType.getSimpleName(); String propertyTypeName = propertyType.getSimpleName();
if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) { if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
generateUnmarshalBodyForArrayProperty(out, property, size); generateTightUnmarshalBodyForArrayProperty(out, property, size);
} }
else { else {
generateUnmarshalBodyForProperty(out, property, size); generateTightUnmarshalBodyForProperty(out, property, size);
} }
} }
} }
protected void generateUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) { protected void generateTightUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
out.print(" "); out.print(" ");
String setter = property.getSetter().getSimpleName(); String setter = property.getSetter().getSimpleName();
String type = property.getType().getSimpleName(); String type = property.getType().getSimpleName();
@ -130,52 +135,34 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
out.println("info." + setter + "(dataIn.readInt());"); out.println("info." + setter + "(dataIn.readInt());");
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("info." + setter + "(unmarshalLong(wireFormat, dataIn, bs));"); out.println("info." + setter + "(tightUnmarshalLong(wireFormat, dataIn, bs));");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("info." + setter + "(readString(dataIn, bs));"); out.println("info." + setter + "(tightUnmarshalString(dataIn, bs));");
} }
else if (type.equals("byte[]")) { else if (type.equals("byte[]")) {
if (size != null) { if (size != null) {
out.println("{"); out.println("info." + setter + "(tightUnmarshalConstByteArray(dataIn, bs, "+ size.asInt() +"));");
out.println(" byte data[] = new byte[" + size.asInt() + "];");
out.println(" dataIn.readFully(data);");
out.println(" info." + setter + "(data);");
out.println(" }");
} }
else { else {
out.println("if( bs.readBoolean() ) {"); out.println("info." + setter + "(tightUnmarshalByteArray(dataIn, bs));");
out.println(" int size = dataIn.readInt();");
out.println(" byte data[] = new byte[size];");
out.println(" dataIn.readFully(data);");
out.println(" info." + setter + "(data);");
out.println(" } else {");
out.println(" info." + setter + "(null);");
out.println(" }");
} }
} }
else if (type.equals("ByteSequence")) { else if (type.equals("ByteSequence")) {
out.println("if( bs.readBoolean() ) {"); out.println("info." + setter + "(tightUnmarshalByteSequence(dataIn, bs));");
out.println(" int size = dataIn.readInt();");
out.println(" byte data[] = new byte[size];");
out.println(" dataIn.readFully(data);");
out.println(" info." + setter + "(new org.activeio.ByteSequence(data,0,size));");
out.println(" } else {");
out.println(" info." + setter + "(null);");
out.println(" }");
} }
else if (isThrowable(property.getType())) { else if (isThrowable(property.getType())) {
out.println("info." + setter + "((" + type + ") unmarsalThrowable(wireFormat, dataIn, bs));"); out.println("info." + setter + "((" + type + ") tightUnmarsalThrowable(wireFormat, dataIn, bs));");
} }
else if (isCachedProperty(property)) { else if (isCachedProperty(property)) {
out.println("info." + setter + "((" + type + ") unmarsalCachedObject(wireFormat, dataIn, bs));"); out.println("info." + setter + "((" + type + ") tightUnmarsalCachedObject(wireFormat, dataIn, bs));");
} }
else { else {
out.println("info." + setter + "((" + type + ") unmarsalNestedObject(wireFormat, dataIn, bs));"); out.println("info." + setter + "((" + type + ") tightUnmarsalNestedObject(wireFormat, dataIn, bs));");
} }
} }
protected void generateUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) { protected void generateTightUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
JClass propertyType = property.getType(); JClass propertyType = property.getType();
String arrayType = propertyType.getArrayComponentType().getSimpleName(); String arrayType = propertyType.getArrayComponentType().getSimpleName();
String setter = property.getSetter().getSimpleName(); String setter = property.getSetter().getSimpleName();
@ -184,7 +171,7 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
out.println(" {"); out.println(" {");
out.println(" " + arrayType + " value[] = new " + arrayType + "[" + size.asInt() + "];"); out.println(" " + arrayType + " value[] = new " + arrayType + "[" + size.asInt() + "];");
out.println(" " + "for( int i=0; i < " + size.asInt() + "; i++ ) {"); out.println(" " + "for( int i=0; i < " + size.asInt() + "; i++ ) {");
out.println(" value[i] = (" + arrayType + ") unmarsalNestedObject(wireFormat,dataIn, bs);"); out.println(" value[i] = (" + arrayType + ") tightUnmarsalNestedObject(wireFormat,dataIn, bs);");
out.println(" }"); out.println(" }");
out.println(" info." + setter + "(value);"); out.println(" info." + setter + "(value);");
out.println(" }"); out.println(" }");
@ -194,7 +181,7 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
out.println(" short size = dataIn.readShort();"); out.println(" short size = dataIn.readShort();");
out.println(" " + arrayType + " value[] = new " + arrayType + "[size];"); out.println(" " + arrayType + " value[] = new " + arrayType + "[size];");
out.println(" for( int i=0; i < size; i++ ) {"); out.println(" for( int i=0; i < size; i++ ) {");
out.println(" value[i] = (" + arrayType + ") unmarsalNestedObject(wireFormat,dataIn, bs);"); out.println(" value[i] = (" + arrayType + ") tightUnmarsalNestedObject(wireFormat,dataIn, bs);");
out.println(" }"); out.println(" }");
out.println(" info." + setter + "(value);"); out.println(" info." + setter + "(value);");
out.println(" }"); out.println(" }");
@ -204,7 +191,7 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
} }
} }
protected int generateMarshal1Body(PrintWriter out) { protected int generateTightMarshal1Body(PrintWriter out) {
List properties = getProperties(); List properties = getProperties();
int baseSize = 0; int baseSize = 0;
for (Iterator iter = properties.iterator(); iter.hasNext();) { for (Iterator iter = properties.iterator(); iter.hasNext();) {
@ -223,57 +210,55 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
baseSize += 1; baseSize += 1;
} }
else if (type.equals("char")) { else if (type.equals("char")) {
baseSize += 1; baseSize += 2;
} }
else if (type.equals("short")) { else if (type.equals("short")) {
baseSize += 1; baseSize += 2;
} }
else if (type.equals("int")) { else if (type.equals("int")) {
baseSize += 1; baseSize += 4;
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("rc+=marshal1Long(wireFormat, " + getter + ", bs);"); out.println("rc+=tightMarshalLong1(wireFormat, " + getter + ", bs);");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("rc += writeString(" + getter + ", bs);"); out.println("rc += tightMarshalString1(" + getter + ", bs);");
} }
else if (type.equals("byte[]")) { else if (type.equals("byte[]")) {
if (size == null) { if (size == null) {
out.println("bs.writeBoolean(" + getter + "!=null);"); out.println("rc += tightMarshalByteArray1(" + getter + ", bs);");
out.println(" rc += " + getter + "==null ? 0 : " + getter + ".length+4;");
} }
else { else {
baseSize += size.asInt(); out.println("rc += tightMarshalConstByteArray1(" + getter + ", bs, "+size.asInt()+");");
} }
} }
else if (type.equals("ByteSequence")) { else if (type.equals("ByteSequence")) {
out.println("bs.writeBoolean(" + getter + "!=null);"); out.println("rc += tightMarshalByteSequence1(" + getter + ", bs);");
out.println(" rc += " + getter + "==null ? 0 : " + getter + ".getLength()+4;");
} }
else if (propertyType.isArrayType()) { else if (propertyType.isArrayType()) {
if (size != null) { if (size != null) {
out.println("rc += marshalObjectArrayConstSize(wireFormat, " + getter + ", bs, " + size.asInt() + ");"); out.println("rc += tightMarshalObjectArrayConstSize1(wireFormat, " + getter + ", bs, " + size.asInt() + ");");
} }
else { else {
out.println("rc += marshalObjectArray(wireFormat, " + getter + ", bs);"); out.println("rc += tightMarshalObjectArray1(wireFormat, " + getter + ", bs);");
} }
} }
else if (isThrowable(propertyType)) { else if (isThrowable(propertyType)) {
out.println("rc += marshalThrowable(wireFormat, " + getter + ", bs);"); out.println("rc += tightMarshalThrowable1(wireFormat, " + getter + ", bs);");
} }
else { else {
if (isCachedProperty(property)) { if (isCachedProperty(property)) {
out.println("rc += marshal1CachedObject(wireFormat, " + getter + ", bs);"); out.println("rc += tightMarshalCachedObject1(wireFormat, " + getter + ", bs);");
} }
else { else {
out.println("rc += marshal1NestedObject(wireFormat, " + getter + ", bs);"); out.println("rc += tightMarshalNestedObject1(wireFormat, " + getter + ", bs);");
} }
} }
} }
return baseSize; return baseSize;
} }
protected void generateMarshal2Body(PrintWriter out) { protected void generateTightMarshal2Body(PrintWriter out) {
List properties = getProperties(); List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) { for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next(); JProperty property = (JProperty) iter.next();
@ -300,48 +285,204 @@ public abstract class OpenWireJavaMarshallingScript extends OpenWireClassesScrip
out.println("dataOut.writeInt(" + getter + ");"); out.println("dataOut.writeInt(" + getter + ");");
} }
else if (type.equals("long")) { else if (type.equals("long")) {
out.println("marshal2Long(wireFormat, " + getter + ", dataOut, bs);"); out.println("tightMarshalLong2(wireFormat, " + getter + ", dataOut, bs);");
} }
else if (type.equals("String")) { else if (type.equals("String")) {
out.println("writeString(" + getter + ", dataOut, bs);"); out.println("tightMarshalString2(" + getter + ", dataOut, bs);");
} }
else if (type.equals("byte[]")) { else if (type.equals("byte[]")) {
if (size != null) { if (size != null) {
out.println("dataOut.write(" + getter + ", 0, " + size.asInt() + ");"); out.println("tightMarshalConstByteArray2(" + getter + ", dataOut, bs, " + size.asInt() + ");");
} }
else { else {
out.println("if(bs.readBoolean()) {"); out.println("tightMarshalByteArray2(" + getter + ", dataOut, bs);");
out.println(" dataOut.writeInt(" + getter + ".length);");
out.println(" dataOut.write(" + getter + ");");
out.println(" }");
} }
} }
else if (type.equals("ByteSequence")) { else if (type.equals("ByteSequence")) {
out.println("if(bs.readBoolean()) {"); out.println("tightMarshalByteSequence2(" + getter + ", dataOut, bs);");
out.println(" org.activeio.ByteSequence data = " + getter + ";");
out.println(" dataOut.writeInt(data.getLength());");
out.println(" dataOut.write(data.getData(), data.getOffset(), data.getLength());");
out.println(" }");
} }
else if (propertyType.isArrayType()) { else if (propertyType.isArrayType()) {
if (size != null) { if (size != null) {
out.println("marshalObjectArrayConstSize(wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + ");"); out.println("tightMarshalObjectArrayConstSize2(wireFormat, " + getter + ", dataOut, bs, " + size.asInt() + ");");
} }
else { else {
out.println("marshalObjectArray(wireFormat, " + getter + ", dataOut, bs);"); out.println("tightMarshalObjectArray2(wireFormat, " + getter + ", dataOut, bs);");
} }
} }
else if (isThrowable(propertyType)) { else if (isThrowable(propertyType)) {
out.println("marshalThrowable(wireFormat, " + getter + ", dataOut, bs);"); out.println("tightMarshalThrowable2(wireFormat, " + getter + ", dataOut, bs);");
} }
else { else {
if (isCachedProperty(property)) { if (isCachedProperty(property)) {
out.println("marshal2CachedObject(wireFormat, " + getter + ", dataOut, bs);"); out.println("tightMarshalCachedObject2(wireFormat, " + getter + ", dataOut, bs);");
} }
else { else {
out.println("marshal2NestedObject(wireFormat, " + getter + ", dataOut, bs);"); out.println("tightMarshalNestedObject2(wireFormat, " + getter + ", dataOut, bs);");
} }
} }
} }
} }
protected void generateLooseMarshalBody(PrintWriter out) {
List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next();
JAnnotation annotation = property.getAnnotation("openwire:property");
JAnnotationValue size = annotation.getValue("size");
JClass propertyType = property.getType();
String type = propertyType.getSimpleName();
String getter = "info." + property.getGetter().getSimpleName() + "()";
out.print(indent);
if (type.equals("boolean")) {
out.println("dataOut.writeBoolean("+ getter + ");");
}
else if (type.equals("byte")) {
out.println("dataOut.writeByte(" + getter + ");");
}
else if (type.equals("char")) {
out.println("dataOut.writeChar(" + getter + ");");
}
else if (type.equals("short")) {
out.println("dataOut.writeShort(" + getter + ");");
}
else if (type.equals("int")) {
out.println("dataOut.writeInt(" + getter + ");");
}
else if (type.equals("long")) {
out.println("looseMarshalLong(wireFormat, " + getter + ", dataOut);");
}
else if (type.equals("String")) {
out.println("looseMarshalString(" + getter + ", dataOut);");
}
else if (type.equals("byte[]")) {
if (size != null) {
out.println("looseMarshalConstByteArray(wireFormat, " + getter + ", dataOut, " + size.asInt() + ");");
}
else {
out.println("looseMarshalByteArray(wireFormat, " + getter + ", dataOut);");
}
}
else if (type.equals("ByteSequence")) {
out.println("looseMarshalByteSequence(wireFormat, " + getter + ", dataOut);");
}
else if (propertyType.isArrayType()) {
if (size != null) {
out.println("looseMarshalObjectArrayConstSize(wireFormat, " + getter + ", dataOut, " + size.asInt() + ");");
}
else {
out.println("looseMarshalObjectArray(wireFormat, " + getter + ", dataOut);");
}
}
else if (isThrowable(propertyType)) {
out.println("looseMarshalThrowable(wireFormat, " + getter + ", dataOut);");
}
else {
if (isCachedProperty(property)) {
out.println("looseMarshalCachedObject(wireFormat, " + getter + ", dataOut);");
}
else {
out.println("looseMarshalNestedObject(wireFormat, " + getter + ", dataOut);");
}
}
}
}
protected void generateLooseUnmarshalBody(PrintWriter out) {
List properties = getProperties();
for (Iterator iter = properties.iterator(); iter.hasNext();) {
JProperty property = (JProperty) iter.next();
JAnnotation annotation = property.getAnnotation("openwire:property");
JAnnotationValue size = annotation.getValue("size");
JClass propertyType = property.getType();
String propertyTypeName = propertyType.getSimpleName();
if (propertyType.isArrayType() && !propertyTypeName.equals("byte[]")) {
generateLooseUnmarshalBodyForArrayProperty(out, property, size);
}
else {
generateLooseUnmarshalBodyForProperty(out, property, size);
}
}
}
protected void generateLooseUnmarshalBodyForProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
out.print(" ");
String setter = property.getSetter().getSimpleName();
String type = property.getType().getSimpleName();
if (type.equals("boolean")) {
out.println("info." + setter + "(dataIn.readBoolean());");
}
else if (type.equals("byte")) {
out.println("info." + setter + "(dataIn.readByte());");
}
else if (type.equals("char")) {
out.println("info." + setter + "(dataIn.readChar());");
}
else if (type.equals("short")) {
out.println("info." + setter + "(dataIn.readShort());");
}
else if (type.equals("int")) {
out.println("info." + setter + "(dataIn.readInt());");
}
else if (type.equals("long")) {
out.println("info." + setter + "(looseUnmarshalLong(wireFormat, dataIn));");
}
else if (type.equals("String")) {
out.println("info." + setter + "(looseUnmarshalString(dataIn));");
}
else if (type.equals("byte[]")) {
if (size != null) {
out.println("info." + setter + "(looseUnmarshalConstByteArray(dataIn, " + size.asInt() + "));");
}
else {
out.println("info." + setter + "(looseUnmarshalByteArray(dataIn));");
}
}
else if (type.equals("ByteSequence")) {
out.println("info." + setter + "(looseUnmarshalByteSequence(dataIn));");
}
else if (isThrowable(property.getType())) {
out.println("info." + setter + "((" + type + ") looseUnmarsalThrowable(wireFormat, dataIn));");
}
else if (isCachedProperty(property)) {
out.println("info." + setter + "((" + type + ") looseUnmarsalCachedObject(wireFormat, dataIn));");
}
else {
out.println("info." + setter + "((" + type + ") looseUnmarsalNestedObject(wireFormat, dataIn));");
}
}
protected void generateLooseUnmarshalBodyForArrayProperty(PrintWriter out, JProperty property, JAnnotationValue size) {
JClass propertyType = property.getType();
String arrayType = propertyType.getArrayComponentType().getSimpleName();
String setter = property.getSetter().getSimpleName();
out.println();
if (size != null) {
out.println(" {");
out.println(" " + arrayType + " value[] = new " + arrayType + "[" + size.asInt() + "];");
out.println(" " + "for( int i=0; i < " + size.asInt() + "; i++ ) {");
out.println(" value[i] = (" + arrayType + ") looseUnmarsalNestedObject(wireFormat,dataIn);");
out.println(" }");
out.println(" info." + setter + "(value);");
out.println(" }");
}
else {
out.println(" if (dataIn.readBoolean()) {");
out.println(" short size = dataIn.readShort();");
out.println(" " + arrayType + " value[] = new " + arrayType + "[size];");
out.println(" for( int i=0; i < size; i++ ) {");
out.println(" value[i] = (" + arrayType + ") looseUnmarsalNestedObject(wireFormat,dataIn);");
out.println(" }");
out.println(" info." + setter + "(value);");
out.println(" }");
out.println(" else {");
out.println(" info." + setter + "(null);");
out.println(" }");
}
}
} }

View File

@ -287,9 +287,16 @@ out << """/**
def type = ("ow_"+name).toUpperCase()+"_TYPE" def type = ("ow_"+name).toUpperCase()+"_TYPE"
def baseName="DataStructure"; def baseName="DataStructure";
if( !jclass.superclass.simpleName.equals("Object") ) {
baseName = jclass.superclass.simpleName; def superclass = jclass.superclass;
} while( superclass.superclass != null ) {
if( openwireClasses.contains(superclass) ) {
baseName = superclass.simpleName;
break;
} else {
superclass = superclass.superclass;
}
}
out << """ out << """
ow_boolean ow_is_a_${name}(ow_DataStructure *object) { ow_boolean ow_is_a_${name}(ow_DataStructure *object) {

View File

@ -81,9 +81,9 @@ out << """
// //
// Un-marshal an object instance from the data input stream // Un-marshal an object instance from the data input stream
// //
public override void Unmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs)
{ {
base.Unmarshal(wireFormat, o, dataIn, bs); base.TightUnmarshal(wireFormat, o, dataIn, bs);
""" """
if( !properties.isEmpty() || marshallerAware ) out << """ if( !properties.isEmpty() || marshallerAware ) out << """
@ -95,7 +95,7 @@ if( marshallerAware ) out << """
""" """
generateUnmarshalBody(out) generateTightUnmarshalBody(out)
if( marshallerAware ) out << """ if( marshallerAware ) out << """
info.AfterUnmarshall(wireFormat); info.AfterUnmarshall(wireFormat);
@ -108,7 +108,7 @@ out << """
// //
// Write the booleans that this object uses to a BooleanStream // Write the booleans that this object uses to a BooleanStream
// //
public override int Marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) { public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) {
${jclass.simpleName} info = (${jclass.simpleName})o; ${jclass.simpleName} info = (${jclass.simpleName})o;
""" """
@ -118,10 +118,10 @@ if( marshallerAware ) out << """
""" """
out << """ out << """
int rc = base.Marshal1(wireFormat, info, bs); int rc = base.TightMarshal1(wireFormat, info, bs);
""" """
def baseSize = generateMarshal1Body(out) def baseSize = generateTightMarshal1Body(out)
out << """ out << """
return rc + ${baseSize}; return rc + ${baseSize};
@ -130,15 +130,15 @@ out << """
// //
// Write a object instance to data output stream // Write a object instance to data output stream
// //
public override void Marshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) { public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
base.Marshal2(wireFormat, o, dataOut, bs); base.TightMarshal2(wireFormat, o, dataOut, bs);
""" """
if( !properties.isEmpty() || marshallerAware ) out << """ if( !properties.isEmpty() || marshallerAware ) out << """
${jclass.simpleName} info = (${jclass.simpleName})o; ${jclass.simpleName} info = (${jclass.simpleName})o;
""" """
generateMarshal2Body(out) generateTightMarshal2Body(out)
if( marshallerAware ) out << """ if( marshallerAware ) out << """
info.AfterMarshall(wireFormat); info.AfterMarshall(wireFormat);

View File

@ -96,8 +96,8 @@ out << """
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
""" """
if( !properties.isEmpty() ) out << """ if( !properties.isEmpty() ) out << """
@ -109,7 +109,7 @@ if( marshallerAware ) out << """
""" """
generateUnmarshalBody(out) generateTightUnmarshalBody(out)
if( marshallerAware ) out << """ if( marshallerAware ) out << """
info.afterUnmarshall(wireFormat); info.afterUnmarshall(wireFormat);
@ -122,7 +122,7 @@ out << """
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
""" """
@ -136,10 +136,10 @@ if( marshallerAware ) out << """
""" """
out << """ out << """
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
""" """
def baseSize = generateMarshal1Body(out) def baseSize = generateTightMarshal1Body(out)
out << """ out << """
return rc + ${baseSize}; return rc + ${baseSize};
@ -152,20 +152,76 @@ out << """
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
""" """
if( !properties.isEmpty() ) out << """ if( !properties.isEmpty() ) out << """
${jclass.simpleName} info = (${jclass.simpleName})o; ${jclass.simpleName} info = (${jclass.simpleName})o;
""" """
generateMarshal2Body(out) generateTightMarshal2Body(out)
if( marshallerAware ) out << """ if( marshallerAware ) out << """
info.afterMarshall(wireFormat); info.afterMarshall(wireFormat);
""" """
out << """
}
"""
out << """
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
"""
if( !properties.isEmpty() ) out << """
${jclass.simpleName} info = (${jclass.simpleName})o;
"""
if( marshallerAware ) out << """
info.beforeUnmarshall(wireFormat);
"""
generateLooseUnmarshalBody(out)
if( marshallerAware ) out << """
info.afterUnmarshall(wireFormat);
"""
out << """
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
"""
if( !properties.isEmpty() ) out << """
${jclass.simpleName} info = (${jclass.simpleName})o;
"""
if( marshallerAware ) out << """
info.beforeMarshall(wireFormat);
"""
out << """
super.looseMarshal(wireFormat, o, dataOut);
"""
generateLooseMarshalBody(out)
out << """ out << """
} }
} }

View File

@ -24,7 +24,7 @@ import org.apache.activemq.util.IntrospectionSupport;
* @openwire:marshaller * @openwire:marshaller
* @version $Revision: 1.11 $ * @version $Revision: 1.11 $
*/ */
abstract public class BaseCommand extends DataStructureSupport implements Command { abstract public class BaseCommand implements Command {
protected short commandId; protected short commandId;
protected boolean responseRequired; protected boolean responseRequired;

View File

@ -1,31 +0,0 @@
/**
*
* 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.command;
import org.apache.activemq.util.IntrospectionSupport;
/**
*
* @version $Revision$
*/
public abstract class DataStructureSupport implements DataStructure {
public String toString() {
return IntrospectionSupport.toString(this, DataStructureSupport.class);
}
}

View File

@ -16,12 +16,14 @@
*/ */
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.util.IntrospectionSupport;
/** /**
* *
* @openwire:marshaller code="52" * @openwire:marshaller code="52"
* @version $Revision$ * @version $Revision$
*/ */
public class JournalQueueAck extends DataStructureSupport implements DataStructure { public class JournalQueueAck implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_REMOVE; public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_REMOVE;
@ -60,4 +62,9 @@ public class JournalQueueAck extends DataStructureSupport implements DataStructu
public boolean isMarshallAware() { public boolean isMarshallAware() {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, JournalQueueAck.class);
}
} }

View File

@ -16,12 +16,14 @@
*/ */
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.util.IntrospectionSupport;
/** /**
* *
* @openwire:marshaller code="50" * @openwire:marshaller code="50"
* @version $Revision$ * @version $Revision$
*/ */
public class JournalTopicAck extends DataStructureSupport implements DataStructure { public class JournalTopicAck implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_ACK; public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_ACK;
@ -106,4 +108,8 @@ public class JournalTopicAck extends DataStructureSupport implements DataStructu
public boolean isMarshallAware() { public boolean isMarshallAware() {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, JournalTopicAck.class);
}
} }

View File

@ -16,12 +16,14 @@
*/ */
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.util.IntrospectionSupport;
/** /**
* *
* @openwire:marshaller code="53" * @openwire:marshaller code="53"
* @version $Revision: 1.6 $ * @version $Revision: 1.6 $
*/ */
public class JournalTrace extends DataStructureSupport implements DataStructure { public class JournalTrace implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_TRACE; public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_TRACE;
@ -48,4 +50,8 @@ public class JournalTrace extends DataStructureSupport implements DataStructure
public boolean isMarshallAware() { public boolean isMarshallAware() {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, JournalTrace.class);
}
} }

View File

@ -16,11 +16,13 @@
*/ */
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.util.IntrospectionSupport;
/** /**
* @openwire:marshaller code="54" * @openwire:marshaller code="54"
*/ */
public class JournalTransaction extends DataStructureSupport implements DataStructure { public class JournalTransaction implements DataStructure {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_TRANSACTION; public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_TRANSACTION;
@ -82,4 +84,8 @@ public class JournalTransaction extends DataStructureSupport implements DataStru
public boolean isMarshallAware() { public boolean isMarshallAware() {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, JournalTransaction.class);
}
} }

View File

@ -17,12 +17,13 @@
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.state.CommandVisitor; import org.apache.activemq.state.CommandVisitor;
import org.apache.activemq.util.IntrospectionSupport;
/** /**
* @openwire:marshaller code="10" * @openwire:marshaller code="10"
* @version $Revision$ * @version $Revision$
*/ */
public class KeepAliveInfo extends DataStructureSupport implements Command { public class KeepAliveInfo implements Command {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.KEEP_ALIVE_INFO; public static final byte DATA_STRUCTURE_TYPE=CommandTypes.KEEP_ALIVE_INFO;
@ -84,4 +85,7 @@ public class KeepAliveInfo extends DataStructureSupport implements Command {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, KeepAliveInfo.class);
}
} }

View File

@ -17,6 +17,7 @@
package org.apache.activemq.command; package org.apache.activemq.command;
import org.apache.activemq.state.CommandVisitor; import org.apache.activemq.state.CommandVisitor;
import org.apache.activemq.util.IntrospectionSupport;
import java.util.Arrays; import java.util.Arrays;
@ -33,10 +34,11 @@ public class WireFormatInfo implements Command {
protected int version; protected int version;
protected byte magic[] = MAGIC; protected byte magic[] = MAGIC;
private boolean stackTraceEnabled; protected boolean stackTraceEnabled;
private boolean tcpNoDelayEnabled; protected boolean tcpNoDelayEnabled;
private boolean cacheEnabled; protected boolean cacheEnabled;
private boolean compressionEnabled; protected boolean tightEncodingEnabled;
protected boolean prefixPacketSize;
public byte getDataStructureType() { public byte getDataStructureType() {
return DATA_STRUCTURE_TYPE; return DATA_STRUCTURE_TYPE;
@ -106,10 +108,6 @@ public class WireFormatInfo implements Command {
public void setResponseRequired(boolean responseRequired) { public void setResponseRequired(boolean responseRequired) {
} }
public String toString() {
return "WireFormatInfo {version=" + version + "}";
}
/** /**
* @openwire:property version=1 * @openwire:property version=1
*/ */
@ -121,17 +119,6 @@ public class WireFormatInfo implements Command {
this.cacheEnabled = cacheEnabled; this.cacheEnabled = cacheEnabled;
} }
/**
* @openwire:property version=1
*/
public boolean isCompressionEnabled() {
return compressionEnabled;
}
public void setCompressionEnabled(boolean compressionEnabled) {
this.compressionEnabled = compressionEnabled;
}
/** /**
* @openwire:property version=1 * @openwire:property version=1
*/ */
@ -154,6 +141,26 @@ public class WireFormatInfo implements Command {
this.tcpNoDelayEnabled = tcpNoDelayEnabled; this.tcpNoDelayEnabled = tcpNoDelayEnabled;
} }
/**
* @openwire:property version=1
*/
public boolean isPrefixPacketSize() {
return prefixPacketSize;
}
public void setPrefixPacketSize(boolean prefixPacketSize) {
this.prefixPacketSize = prefixPacketSize;
}
/**
* @openwire:property version=1
*/
public boolean isTightEncodingEnabled() {
return tightEncodingEnabled;
}
public void setTightEncodingEnabled(boolean tightEncodingEnabled) {
this.tightEncodingEnabled = tightEncodingEnabled;
}
public Response visit(CommandVisitor visitor) throws Throwable { public Response visit(CommandVisitor visitor) throws Throwable {
return visitor.processWireFormat(this); return visitor.processWireFormat(this);
} }
@ -170,4 +177,7 @@ public class WireFormatInfo implements Command {
return false; return false;
} }
public String toString() {
return IntrospectionSupport.toString(this, WireFormatInfo.class);
}
} }

View File

@ -1,336 +0,0 @@
/**
*
* 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;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import org.activeio.command.ClassLoading;
import org.apache.activemq.command.DataStructure;
abstract public class DataStreamMarshaller {
static final public Constructor STACK_TRACE_ELEMENT_CONSTRUCTOR;
static {
Constructor constructor=null;
try {
constructor = StackTraceElement.class.getConstructor(new Class[]{String.class, String.class, String.class, int.class});
} catch (Throwable e) {
}
STACK_TRACE_ELEMENT_CONSTRUCTOR = constructor;
}
abstract public byte getDataStructureType();
abstract public DataStructure createObject();
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
return 0;
}
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
}
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
}
public int marshal1Long(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException {
if( o == 0 ) {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
} else if ( (o & 0xFFFFFFFFFFFF0000l ) == 0 ) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
} else if ( (o & 0xFFFFFFFF00000000l ) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
} else {
bs.writeBoolean(true);
bs.writeBoolean(true);
return 8;
}
}
public void marshal2Long(OpenWireFormat wireFormat, long o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
dataOut.writeLong(o);
} else {
dataOut.writeInt((int) o);
}
} else {
if( bs.readBoolean() ) {
dataOut.writeShort((int) o);
}
}
}
public long unmarshalLong(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
return dataIn.readLong();
} else {
return dataIn.readInt();
}
} else {
if( bs.readBoolean() ) {
return dataIn.readShort();
} else {
return 0;
}
}
}
protected DataStructure unmarsalNestedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
return wireFormat.unmarshalNestedObject(dataIn, bs);
}
protected int marshal1NestedObject(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
return wireFormat.marshal1NestedObject(o, bs);
}
protected void marshal2NestedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
wireFormat.marshal2NestedObject(o, dataOut, bs);
}
protected DataStructure unmarsalCachedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
if( bs.readBoolean() ) {
short index = dataIn.readShort();
DataStructure object = wireFormat.unmarshalNestedObject(dataIn, bs);
wireFormat.setInUnmarshallCache(index, object);
return object;
} else {
short index = dataIn.readShort();
return wireFormat.getFromUnmarshallCache(index);
}
} else {
return wireFormat.unmarshalNestedObject(dataIn, bs);
}
}
protected int marshal1CachedObject(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
Short index = wireFormat.getMarshallCacheIndex(o);
bs.writeBoolean(index == null);
if( index == null ) {
int rc = wireFormat.marshal1NestedObject(o, bs);
wireFormat.addToMarshallCache(o);
return 2+rc;
} else {
return 2;
}
} else {
return wireFormat.marshal1NestedObject(o, bs);
}
}
protected void marshal2CachedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
Short index = wireFormat.getMarshallCacheIndex(o);
if( bs.readBoolean() ) {
dataOut.writeShort(index.shortValue());
wireFormat.marshal2NestedObject(o, dataOut, bs);
} else {
dataOut.writeShort(index.shortValue());
}
} else {
wireFormat.marshal2NestedObject(o, dataOut, bs);
}
}
protected Throwable unmarsalThrowable(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
String clazz = readString(dataIn, bs);
String message = readString(dataIn, bs);
Throwable o = createThrowable(clazz, message);
if( wireFormat.isStackTraceEnabled() ) {
if( STACK_TRACE_ELEMENT_CONSTRUCTOR!=null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
readString(dataIn, bs),
readString(dataIn, bs),
readString(dataIn, bs),
new Integer(dataIn.readInt())
});
} catch (IOException e) {
throw e;
} catch (Throwable e) {
}
}
o.setStackTrace(ss);
} else {
short size = dataIn.readShort();
for (int i = 0; i < size; i++) {
readString(dataIn, bs);
readString(dataIn, bs);
readString(dataIn, bs);
dataIn.readInt();
}
}
o.initCause(unmarsalThrowable(wireFormat, dataIn, bs));
}
return o;
} else {
return null;
}
}
private Throwable createThrowable(String className, String message) {
try {
Class clazz = ClassLoading.loadClass(className, DataStreamMarshaller.class.getClassLoader());
Constructor constructor = clazz.getConstructor(new Class[]{String.class});
return (Throwable) constructor.newInstance(new Object[]{message});
} catch (Throwable e) {
return new Throwable(className+": "+message);
}
}
protected int marshalThrowable(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException {
if( o==null ) {
bs.writeBoolean(false);
return 0;
} else {
int rc=0;
bs.writeBoolean(true);
rc += writeString(o.getClass().getName(), bs);
rc += writeString(o.getMessage(), bs);
if( wireFormat.isStackTraceEnabled() ) {
rc += 2;
StackTraceElement[] stackTrace = o.getStackTrace();
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
rc += writeString(element.getClassName(), bs);
rc += writeString(element.getMethodName(), bs);
rc += writeString(element.getFileName(), bs);
rc += 4;
}
rc += marshalThrowable(wireFormat, o.getCause(), bs);
}
return rc;
}
}
protected void marshalThrowable(OpenWireFormat wireFormat, Throwable o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
writeString(o.getClass().getName(), dataOut, bs);
writeString(o.getMessage(), dataOut, bs);
if( wireFormat.isStackTraceEnabled() ) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
writeString(element.getClassName(), dataOut, bs);
writeString(element.getMethodName(), dataOut, bs);
writeString(element.getFileName(), dataOut, bs);
dataOut.writeInt(element.getLineNumber());
}
marshalThrowable(wireFormat, o.getCause(), dataOut, bs);
}
}
}
protected String readString(DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
int size = dataIn.readShort();
byte data[] = new byte[size];
dataIn.readFully(data);
return new String(data,0); // Yes deprecated, but we know what we are doing.
} else {
return dataIn.readUTF();
}
} else {
return null;
}
}
protected int writeString(String value, BooleanStream bs) throws IOException {
bs.writeBoolean(value!=null);
if( value!=null ) {
int strlen = value.length();
int utflen = 0;
char[] charr = new char[strlen];
int c, count = 0;
boolean isOnlyAscii=true;
value.getChars(0, strlen, charr, 0);
for (int i = 0; i < strlen; i++) {
c = charr[i];
if ((c >= 0x0001) && (c <= 0x007F)) {
utflen++;
} else if (c > 0x07FF) {
utflen += 3;
isOnlyAscii=false;
} else {
isOnlyAscii=false;
utflen += 2;
}
}
if( utflen >= Short.MAX_VALUE )
throw new IOException("Encountered a String value that is too long to encode.");
bs.writeBoolean(isOnlyAscii);
return utflen+2;
} else {
return 0;
}
}
protected void writeString(String value, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
// If we verified it only holds ascii values
if( bs.readBoolean() ) {
dataOut.writeShort(value.length());
dataOut.writeBytes(value);
} else {
dataOut.writeUTF(value);
}
}
}
protected int marshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException {
if( objects != null ) {
int rc=0;
bs.writeBoolean(true);
rc += 2;
for( int i=0; i < objects.length; i++ ) {
rc += marshal1NestedObject(wireFormat,objects[i], bs);
}
return rc;
} else {
bs.writeBoolean(false);
return 0;
}
}
protected void marshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
dataOut.writeShort(objects.length);
for( int i=0; i < objects.length; i++ ) {
marshal2NestedObject(wireFormat,objects[i], dataOut, bs);
}
}
}
}

View File

@ -25,6 +25,7 @@ import java.util.HashMap;
import org.activeio.ByteArrayOutputStream; import org.activeio.ByteArrayOutputStream;
import org.activeio.ByteSequence; import org.activeio.ByteSequence;
import org.activeio.Packet; import org.activeio.Packet;
import org.activeio.PacketData;
import org.activeio.adapter.PacketToInputStream; import org.activeio.adapter.PacketToInputStream;
import org.activeio.command.ClassLoading; import org.activeio.command.ClassLoading;
import org.activeio.command.WireFormat; import org.activeio.command.WireFormat;
@ -46,6 +47,8 @@ final public class OpenWireFormat implements WireFormat {
private boolean stackTraceEnabled=true; private boolean stackTraceEnabled=true;
private boolean tcpNoDelayEnabled=false; private boolean tcpNoDelayEnabled=false;
private boolean cacheEnabled=true; private boolean cacheEnabled=true;
private boolean tightEncodingEnabled=true;
private boolean prefixPacketSize=true;
private HashMap marshallCacheMap = new HashMap(); private HashMap marshallCacheMap = new HashMap();
private short nextMarshallCacheIndex=0; private short nextMarshallCacheIndex=0;
@ -64,8 +67,9 @@ final public class OpenWireFormat implements WireFormat {
public int hashCode() { public int hashCode() {
return version return version
^ (cacheEnabled?0x10000000:0x20000000) ^ (cacheEnabled ? 0x10000000:0x20000000)
^ (stackTraceEnabled?0x30000000:0x40000000); ^ (stackTraceEnabled ? 0x01000000:0x02000000)
^ (tightEncodingEnabled ? 0x00100000:0x00200000);
} }
public boolean equals(Object object) { public boolean equals(Object object) {
@ -74,7 +78,8 @@ final public class OpenWireFormat implements WireFormat {
OpenWireFormat o = (OpenWireFormat) object; OpenWireFormat o = (OpenWireFormat) object;
return o.stackTraceEnabled == stackTraceEnabled && return o.stackTraceEnabled == stackTraceEnabled &&
o.cacheEnabled == cacheEnabled && o.cacheEnabled == cacheEnabled &&
o.version == version; o.version == version &&
o.tightEncodingEnabled == tightEncodingEnabled;
} }
public String toString() { public String toString() {
@ -108,19 +113,43 @@ final public class OpenWireFormat implements WireFormat {
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF]; DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null ) if( dsm == null )
throw new IOException("Unknown data type: "+type); throw new IOException("Unknown data type: "+type);
BooleanStream bs = new BooleanStream();
size += dsm.marshal1(this, c, bs);
size += bs.marshalledSize();
ByteArrayOutputStream baos = new ByteArrayOutputStream(size); if( tightEncodingEnabled ) {
DataOutputStream ds = new DataOutputStream(baos);
ds.writeInt(size); BooleanStream bs = new BooleanStream();
ds.writeByte(type); size += dsm.tightMarshal1(this, c, bs);
bs.marshal(ds); size += bs.marshalledSize();
dsm.marshal2(this, c, ds, bs);
ds.close(); ByteArrayOutputStream baos = new ByteArrayOutputStream(size);
DataOutputStream ds = new DataOutputStream(baos);
if( prefixPacketSize ) {
ds.writeInt(size);
}
ds.writeByte(type);
bs.marshal(ds);
dsm.tightMarshal2(this, c, ds, bs);
ds.close();
sequence = baos.toByteSequence();
} else {
ByteArrayOutputStream baos = new ByteArrayOutputStream(size);
DataOutputStream ds = new DataOutputStream(baos);
if( prefixPacketSize ) {
ds.writeInt(0); // we don't know the final size yet but write this here for now.
}
ds.writeByte(type);
dsm.looseMarshal(this, c, ds);
ds.close();
sequence = baos.toByteSequence();
if( prefixPacketSize ) {
size = sequence.getLength()-4;
ByteArrayPacket packet = new ByteArrayPacket(sequence);
PacketData.writeIntBig(packet, size);
}
}
sequence = baos.toByteSequence();
} else { } else {
@ -142,10 +171,14 @@ final public class OpenWireFormat implements WireFormat {
public Object unmarshal(Packet packet) throws IOException { public Object unmarshal(Packet packet) throws IOException {
ByteSequence sequence = packet.asByteSequence(); ByteSequence sequence = packet.asByteSequence();
DataInputStream dis = new DataInputStream(new PacketToInputStream(packet)); DataInputStream dis = new DataInputStream(new PacketToInputStream(packet));
int size = dis.readInt();
if( sequence.getLength() != size+4 ) if( prefixPacketSize ) {
System.out.println("Packet size does not match marshaled size: "+size+", "+(sequence.getLength()-4)); int size = dis.readInt();
// throw new IOException("Packet size does not match marshaled size"); if( sequence.getLength()-4 != size )
System.out.println("Packet size does not match marshaled size: "+size+", "+(sequence.getLength()-4));
// throw new IOException("Packet size does not match marshaled size");
}
Object command = doUnmarshal(dis); Object command = doUnmarshal(dis);
if( !cacheEnabled && ((DataStructure)command).isMarshallAware() ) { if( !cacheEnabled && ((DataStructure)command).isMarshallAware() ) {
((MarshallAware) command).setCachedMarshalledForm(this, sequence); ((MarshallAware) command).setCachedMarshalledForm(this, sequence);
@ -163,13 +196,13 @@ final public class OpenWireFormat implements WireFormat {
throw new IOException("Unknown data type: "+type); throw new IOException("Unknown data type: "+type);
BooleanStream bs = new BooleanStream(); BooleanStream bs = new BooleanStream();
size += dsm.marshal1(this, c, bs); size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize(); size += bs.marshalledSize();
ds.writeInt(size); ds.writeInt(size);
ds.writeByte(type); ds.writeByte(type);
bs.marshal(ds); bs.marshal(ds);
dsm.marshal2(this, c, ds, bs); dsm.tightMarshal2(this, c, ds, bs);
} else { } else {
ds.writeInt(size); ds.writeInt(size);
ds.writeByte(NULL_TYPE); ds.writeByte(NULL_TYPE);
@ -209,16 +242,20 @@ final public class OpenWireFormat implements WireFormat {
if( dsm == null ) if( dsm == null )
throw new IOException("Unknown data type: "+dataType); throw new IOException("Unknown data type: "+dataType);
Object data = dsm.createObject(); Object data = dsm.createObject();
BooleanStream bs = new BooleanStream(); if( this.tightEncodingEnabled ) {
bs.unmarshal(dis); BooleanStream bs = new BooleanStream();
dsm.unmarshal(this, data, dis, bs); bs.unmarshal(dis);
dsm.tightUnmarshal(this, data, dis, bs);
} else {
dsm.looseUnmarshal(this, data, dis);
}
return data; return data;
} else { } else {
return null; return null;
} }
} }
public int marshal1NestedObject(DataStructure o, BooleanStream bs) throws IOException { public int tightMarshalNestedObject1(DataStructure o, BooleanStream bs) throws IOException {
bs.writeBoolean(o != null); bs.writeBoolean(o != null);
if( o == null ) if( o == null )
return 0; return 0;
@ -236,10 +273,10 @@ final public class OpenWireFormat implements WireFormat {
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF]; DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null ) if( dsm == null )
throw new IOException("Unknown data type: "+type); throw new IOException("Unknown data type: "+type);
return 1 + dsm.marshal1(this, o, bs); return 1 + dsm.tightMarshal1(this, o, bs);
} }
public void marshal2NestedObject(DataStructure o, DataOutputStream ds, BooleanStream bs) throws IOException { public void tightMarshalNestedObject2(DataStructure o, DataOutputStream ds, BooleanStream bs) throws IOException {
if( !bs.readBoolean() ) if( !bs.readBoolean() )
return; return;
@ -257,12 +294,12 @@ final public class OpenWireFormat implements WireFormat {
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF]; DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null ) if( dsm == null )
throw new IOException("Unknown data type: "+type); throw new IOException("Unknown data type: "+type);
dsm.marshal2(this, o, ds, bs); dsm.tightMarshal2(this, o, ds, bs);
} }
} }
public DataStructure unmarshalNestedObject(DataInputStream dis, BooleanStream bs) throws IOException { public DataStructure tightUnmarshalNestedObject(DataInputStream dis, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) { if( bs.readBoolean() ) {
byte dataType = dis.readByte(); byte dataType = dis.readByte();
@ -278,14 +315,14 @@ final public class OpenWireFormat implements WireFormat {
BooleanStream bs2 = new BooleanStream(); BooleanStream bs2 = new BooleanStream();
bs2.unmarshal(dis); bs2.unmarshal(dis);
dsm.unmarshal(this, data, dis, bs2); dsm.tightUnmarshal(this, data, dis, bs2);
// TODO: extract the sequence from the dis and associate it. // TODO: extract the sequence from the dis and associate it.
// MarshallAware ma = (MarshallAware)data // MarshallAware ma = (MarshallAware)data
// ma.setCachedMarshalledForm(this, sequence); // ma.setCachedMarshalledForm(this, sequence);
} else { } else {
dsm.unmarshal(this, data, dis, bs); dsm.tightUnmarshal(this, data, dis, bs);
} }
return data; return data;
@ -294,6 +331,35 @@ final public class OpenWireFormat implements WireFormat {
} }
} }
public DataStructure looseUnmarshalNestedObject(DataInputStream dis) throws IOException {
if( dis.readBoolean() ) {
byte dataType = dis.readByte();
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if( dsm == null )
throw new IOException("Unknown data type: "+dataType);
DataStructure data = dsm.createObject();
dsm.looseUnmarshal(this, data, dis);
return data;
} else {
return null;
}
}
public void looseMarshalNestedObject(DataStructure o, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(o!=null);
if( o!=null ) {
byte type = o.getDataStructureType();
dataOut.writeByte(type);
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
if( dsm == null )
throw new IOException("Unknown data type: "+type);
dsm.looseMarshal(this, o, dataOut);
}
}
public Short getMarshallCacheIndex(Object o) { public Short getMarshallCacheIndex(Object o) {
return (Short) marshallCacheMap.get(o); return (Short) marshallCacheMap.get(o);
} }
@ -345,4 +411,20 @@ final public class OpenWireFormat implements WireFormat {
this.cacheEnabled = cacheEnabled; this.cacheEnabled = cacheEnabled;
} }
public boolean isTightEncodingEnabled() {
return tightEncodingEnabled;
}
public void setTightEncodingEnabled(boolean tightEncodingEnabled) {
this.tightEncodingEnabled = tightEncodingEnabled;
}
public boolean isPrefixPacketSize() {
return prefixPacketSize;
}
public void setPrefixPacketSize(boolean prefixPacketSize) {
this.prefixPacketSize = prefixPacketSize;
}
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQBytesMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQBytesMessageMarshaller extends ActiveMQMessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQBytesMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public abstract class ActiveMQDestinationMarshaller extends DataStreamMarshaller { public abstract class ActiveMQDestinationMarshaller extends BaseDataStreamMarshaller {
/** /**
* Un-marshal an object instance from the data input stream * Un-marshal an object instance from the data input stream
@ -45,11 +45,11 @@ public abstract class ActiveMQDestinationMarshaller extends DataStreamMarshaller
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ActiveMQDestination info = (ActiveMQDestination)o; ActiveMQDestination info = (ActiveMQDestination)o;
info.setPhysicalName(readString(dataIn, bs)); info.setPhysicalName(tightUnmarshalString(dataIn, bs));
} }
@ -57,12 +57,12 @@ public abstract class ActiveMQDestinationMarshaller extends DataStreamMarshaller
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ActiveMQDestination info = (ActiveMQDestination)o; ActiveMQDestination info = (ActiveMQDestination)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getPhysicalName(), bs); rc += tightMarshalString1(info.getPhysicalName(), bs);
return rc + 0; return rc + 0;
} }
@ -74,11 +74,39 @@ public abstract class ActiveMQDestinationMarshaller extends DataStreamMarshaller
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ActiveMQDestination info = (ActiveMQDestination)o; ActiveMQDestination info = (ActiveMQDestination)o;
writeString(info.getPhysicalName(), dataOut, bs); tightMarshalString2(info.getPhysicalName(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ActiveMQDestination info = (ActiveMQDestination)o;
info.setPhysicalName(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ActiveMQDestination info = (ActiveMQDestination)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getPhysicalName(), dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQMapMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQMapMessageMarshaller extends ActiveMQMessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQMapMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQMessageMarshaller extends MessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQMessageMarshaller extends MessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQMessageMarshaller extends MessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQObjectMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQObjectMessageMarshaller extends ActiveMQMessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQObjectMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQQueueMarshaller extends ActiveMQDestinationMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQQueueMarshaller extends ActiveMQDestinationMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQQueueMarshaller extends ActiveMQDestinationMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQStreamMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQStreamMessageMarshaller extends ActiveMQMessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQStreamMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -45,8 +45,8 @@ public abstract class ActiveMQTempDestinationMarshaller extends ActiveMQDestinat
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -54,9 +54,9 @@ public abstract class ActiveMQTempDestinationMarshaller extends ActiveMQDestinat
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -68,8 +68,30 @@ public abstract class ActiveMQTempDestinationMarshaller extends ActiveMQDestinat
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQTempQueueMarshaller extends ActiveMQTempDestinationMarshall
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQTempQueueMarshaller extends ActiveMQTempDestinationMarshall
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQTempQueueMarshaller extends ActiveMQTempDestinationMarshall
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQTempTopicMarshaller extends ActiveMQTempDestinationMarshall
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQTempTopicMarshaller extends ActiveMQTempDestinationMarshall
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQTempTopicMarshaller extends ActiveMQTempDestinationMarshall
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQTextMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQTextMessageMarshaller extends ActiveMQMessageMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQTextMessageMarshaller extends ActiveMQMessageMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ActiveMQTopicMarshaller extends ActiveMQDestinationMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ActiveMQTopicMarshaller extends ActiveMQDestinationMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ActiveMQTopicMarshaller extends ActiveMQDestinationMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public abstract class BaseCommandMarshaller extends DataStreamMarshaller { public abstract class BaseCommandMarshaller extends BaseDataStreamMarshaller {
/** /**
* Un-marshal an object instance from the data input stream * Un-marshal an object instance from the data input stream
@ -45,8 +45,8 @@ public abstract class BaseCommandMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
BaseCommand info = (BaseCommand)o; BaseCommand info = (BaseCommand)o;
info.setCommandId(dataIn.readShort()); info.setCommandId(dataIn.readShort());
@ -58,14 +58,14 @@ public abstract class BaseCommandMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
BaseCommand info = (BaseCommand)o; BaseCommand info = (BaseCommand)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
bs.writeBoolean(info.isResponseRequired()); bs.writeBoolean(info.isResponseRequired());
return rc + 1; return rc + 2;
} }
/** /**
@ -75,12 +75,42 @@ public abstract class BaseCommandMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
BaseCommand info = (BaseCommand)o; BaseCommand info = (BaseCommand)o;
dataOut.writeShort(info.getCommandId()); dataOut.writeShort(info.getCommandId());
bs.readBoolean(); bs.readBoolean();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
BaseCommand info = (BaseCommand)o;
info.setCommandId(dataIn.readShort());
info.setResponseRequired(dataIn.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
BaseCommand info = (BaseCommand)o;
super.looseMarshal(wireFormat, o, dataOut);
dataOut.writeShort(info.getCommandId());
dataOut.writeBoolean(info.isResponseRequired());
} }
} }

View File

@ -0,0 +1,592 @@
/**
*
* 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.v1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
import org.activeio.ByteSequence;
import org.activeio.command.ClassLoading;
import org.apache.activemq.command.DataStructure;
import org.apache.activemq.openwire.BooleanStream;
import org.apache.activemq.openwire.DataStreamMarshaller;
import org.apache.activemq.openwire.OpenWireFormat;
abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
static final public Constructor STACK_TRACE_ELEMENT_CONSTRUCTOR;
static {
Constructor constructor=null;
try {
constructor = StackTraceElement.class.getConstructor(new Class[]{String.class, String.class, String.class, int.class});
} catch (Throwable e) {
}
STACK_TRACE_ELEMENT_CONSTRUCTOR = constructor;
}
abstract public byte getDataStructureType();
abstract public DataStructure createObject();
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
return 0;
}
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
}
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
}
public int tightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException {
if( o == 0 ) {
bs.writeBoolean(false);
bs.writeBoolean(false);
return 0;
} else if ( (o & 0xFFFFFFFFFFFF0000l ) == 0 ) {
bs.writeBoolean(false);
bs.writeBoolean(true);
return 2;
} else if ( (o & 0xFFFFFFFF00000000l ) == 0) {
bs.writeBoolean(true);
bs.writeBoolean(false);
return 4;
} else {
bs.writeBoolean(true);
bs.writeBoolean(true);
return 8;
}
}
public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
dataOut.writeLong(o);
} else {
dataOut.writeInt((int) o);
}
} else {
if( bs.readBoolean() ) {
dataOut.writeShort((int) o);
}
}
}
public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
return dataIn.readLong();
} else {
return dataIn.readInt();
}
} else {
if( bs.readBoolean() ) {
return dataIn.readShort();
} else {
return 0;
}
}
}
protected DataStructure tightUnmarsalNestedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
protected int tightMarshalNestedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
return wireFormat.tightMarshalNestedObject1(o, bs);
}
protected void tightMarshalNestedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
}
protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
if( bs.readBoolean() ) {
short index = dataIn.readShort();
DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
wireFormat.setInUnmarshallCache(index, object);
return object;
} else {
short index = dataIn.readShort();
return wireFormat.getFromUnmarshallCache(index);
}
} else {
return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
}
}
protected int tightMarshalCachedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
Short index = wireFormat.getMarshallCacheIndex(o);
bs.writeBoolean(index == null);
if( index == null ) {
int rc = wireFormat.tightMarshalNestedObject1(o, bs);
wireFormat.addToMarshallCache(o);
return 2+rc;
} else {
return 2;
}
} else {
return wireFormat.tightMarshalNestedObject1(o, bs);
}
}
protected void tightMarshalCachedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( wireFormat.isCacheEnabled() ) {
Short index = wireFormat.getMarshallCacheIndex(o);
if( bs.readBoolean() ) {
dataOut.writeShort(index.shortValue());
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
} else {
dataOut.writeShort(index.shortValue());
}
} else {
wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
}
}
protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
String clazz = tightUnmarshalString(dataIn, bs);
String message = tightUnmarshalString(dataIn, bs);
Throwable o = createThrowable(clazz, message);
if( wireFormat.isStackTraceEnabled() ) {
if( STACK_TRACE_ELEMENT_CONSTRUCTOR!=null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
tightUnmarshalString(dataIn, bs),
tightUnmarshalString(dataIn, bs),
tightUnmarshalString(dataIn, bs),
new Integer(dataIn.readInt())
});
} catch (IOException e) {
throw e;
} catch (Throwable e) {
}
}
o.setStackTrace(ss);
} else {
short size = dataIn.readShort();
for (int i = 0; i < size; i++) {
tightUnmarshalString(dataIn, bs);
tightUnmarshalString(dataIn, bs);
tightUnmarshalString(dataIn, bs);
dataIn.readInt();
}
}
o.initCause(tightUnmarsalThrowable(wireFormat, dataIn, bs));
}
return o;
} else {
return null;
}
}
private Throwable createThrowable(String className, String message) {
try {
Class clazz = ClassLoading.loadClass(className, BaseDataStreamMarshaller.class.getClassLoader());
Constructor constructor = clazz.getConstructor(new Class[]{String.class});
return (Throwable) constructor.newInstance(new Object[]{message});
} catch (Throwable e) {
return new Throwable(className+": "+message);
}
}
protected int tightMarshalThrowable1(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException {
if( o==null ) {
bs.writeBoolean(false);
return 0;
} else {
int rc=0;
bs.writeBoolean(true);
rc += tightMarshalString1(o.getClass().getName(), bs);
rc += tightMarshalString1(o.getMessage(), bs);
if( wireFormat.isStackTraceEnabled() ) {
rc += 2;
StackTraceElement[] stackTrace = o.getStackTrace();
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
rc += tightMarshalString1(element.getClassName(), bs);
rc += tightMarshalString1(element.getMethodName(), bs);
rc += tightMarshalString1(element.getFileName(), bs);
rc += 4;
}
rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs);
}
return rc;
}
}
protected void tightMarshalThrowable2(OpenWireFormat wireFormat, Throwable o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
tightMarshalString2(o.getClass().getName(), dataOut, bs);
tightMarshalString2(o.getMessage(), dataOut, bs);
if( wireFormat.isStackTraceEnabled() ) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
tightMarshalString2(element.getClassName(), dataOut, bs);
tightMarshalString2(element.getMethodName(), dataOut, bs);
tightMarshalString2(element.getFileName(), dataOut, bs);
dataOut.writeInt(element.getLineNumber());
}
tightMarshalThrowable2(wireFormat, o.getCause(), dataOut, bs);
}
}
}
protected String tightUnmarshalString(DataInputStream dataIn, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
if( bs.readBoolean() ) {
int size = dataIn.readShort();
byte data[] = new byte[size];
dataIn.readFully(data);
return new String(data,0); // Yes deprecated, but we know what we are doing.
} else {
return dataIn.readUTF();
}
} else {
return null;
}
}
protected int tightMarshalString1(String value, BooleanStream bs) throws IOException {
bs.writeBoolean(value!=null);
if( value!=null ) {
int strlen = value.length();
int utflen = 0;
char[] charr = new char[strlen];
int c, count = 0;
boolean isOnlyAscii=true;
value.getChars(0, strlen, charr, 0);
for (int i = 0; i < strlen; i++) {
c = charr[i];
if ((c >= 0x0001) && (c <= 0x007F)) {
utflen++;
} else if (c > 0x07FF) {
utflen += 3;
isOnlyAscii=false;
} else {
isOnlyAscii=false;
utflen += 2;
}
}
if( utflen >= Short.MAX_VALUE )
throw new IOException("Encountered a String value that is too long to encode.");
bs.writeBoolean(isOnlyAscii);
return utflen+2;
} else {
return 0;
}
}
protected void tightMarshalString2(String value, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
// If we verified it only holds ascii values
if( bs.readBoolean() ) {
dataOut.writeShort(value.length());
dataOut.writeBytes(value);
} else {
dataOut.writeUTF(value);
}
}
}
protected int tightMarshalObjectArray1(OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException {
if( objects != null ) {
int rc=0;
bs.writeBoolean(true);
rc += 2;
for( int i=0; i < objects.length; i++ ) {
rc += tightMarshalNestedObject1(wireFormat,objects[i], bs);
}
return rc;
} else {
bs.writeBoolean(false);
return 0;
}
}
protected void tightMarshalObjectArray2(OpenWireFormat wireFormat, DataStructure[] objects, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ) {
dataOut.writeShort(objects.length);
for( int i=0; i < objects.length; i++ ) {
tightMarshalNestedObject2(wireFormat,objects[i], dataOut, bs);
}
}
}
protected int tightMarshalConstByteArray1(byte[] data, BooleanStream bs, int i) throws IOException {
return i;
}
protected void tightMarshalConstByteArray2(byte[] data, DataOutputStream dataOut, BooleanStream bs, int i) throws IOException {
dataOut.write(data, 0, i);
}
protected byte[] tightUnmarshalConstByteArray(DataInputStream dataIn, BooleanStream bs, int i) throws IOException {
byte data[] = new byte[i];
dataIn.readFully(data);
return data;
}
protected int tightMarshalByteArray1(byte[] data, BooleanStream bs) throws IOException {
bs.writeBoolean(data!=null);
if( data!=null ){
return data.length+4;
} else {
return 0;
}
}
protected void tightMarshalByteArray2(byte[] data, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ){
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] tightUnmarshalByteArray(DataInputStream dataIn, BooleanStream bs) throws IOException {
byte rc[]=null;
if( bs.readBoolean() ) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
}
return rc;
}
protected int tightMarshalByteSequence1(ByteSequence data, BooleanStream bs) throws IOException {
bs.writeBoolean(data!=null);
if( data!=null ){
return data.getLength()+4;
} else {
return 0;
}
}
protected void tightMarshalByteSequence2(ByteSequence data, DataOutputStream dataOut, BooleanStream bs) throws IOException {
if( bs.readBoolean() ){
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected ByteSequence tightUnmarshalByteSequence(DataInputStream dataIn, BooleanStream bs) throws IOException {
ByteSequence rc=null;
if( bs.readBoolean() ) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
return new ByteSequence(t, 0, size);
}
return rc;
}
//
// The loose marshaling logic
//
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
}
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
}
public void looseMarshalLong(OpenWireFormat wireFormat, long o, DataOutputStream dataOut) throws IOException {
dataOut.writeLong(o);
}
public long looseUnmarshalLong(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
return dataIn.readLong();
}
protected DataStructure looseUnmarsalNestedObject(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
protected void looseMarshalNestedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut) throws IOException {
wireFormat.looseMarshalNestedObject(o, dataOut);
}
protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
if( wireFormat.isCacheEnabled() ) {
if( dataIn.readBoolean() ) {
short index = dataIn.readShort();
DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
wireFormat.setInUnmarshallCache(index, object);
return object;
} else {
short index = dataIn.readShort();
return wireFormat.getFromUnmarshallCache(index);
}
} else {
return wireFormat.looseUnmarshalNestedObject(dataIn);
}
}
protected void looseMarshalCachedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut) throws IOException {
if( wireFormat.isCacheEnabled() ) {
Short index = wireFormat.getMarshallCacheIndex(o);
dataOut.writeBoolean(index == null);
if( index == null ) {
index = wireFormat.addToMarshallCache(o);
dataOut.writeShort(index.shortValue());
wireFormat.looseMarshalNestedObject(o, dataOut);
} else {
dataOut.writeShort(index.shortValue());
}
} else {
wireFormat.looseMarshalNestedObject(o, dataOut);
}
}
protected Throwable looseUnmarsalThrowable(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
if( dataIn.readBoolean() ) {
String clazz = looseUnmarshalString(dataIn);
String message = looseUnmarshalString(dataIn);
Throwable o = createThrowable(clazz, message);
if( wireFormat.isStackTraceEnabled() ) {
if( STACK_TRACE_ELEMENT_CONSTRUCTOR!=null) {
StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
for (int i = 0; i < ss.length; i++) {
try {
ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
looseUnmarshalString(dataIn),
looseUnmarshalString(dataIn),
looseUnmarshalString(dataIn),
new Integer(dataIn.readInt())
});
} catch (IOException e) {
throw e;
} catch (Throwable e) {
}
}
o.setStackTrace(ss);
} else {
short size = dataIn.readShort();
for (int i = 0; i < size; i++) {
looseUnmarshalString(dataIn);
looseUnmarshalString(dataIn);
looseUnmarshalString(dataIn);
dataIn.readInt();
}
}
o.initCause(looseUnmarsalThrowable(wireFormat, dataIn));
}
return o;
} else {
return null;
}
}
protected void looseMarshalThrowable(OpenWireFormat wireFormat, Throwable o, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(o!=null);
if( o!=null ) {
looseMarshalString(o.getClass().getName(), dataOut);
looseMarshalString(o.getMessage(), dataOut);
if( wireFormat.isStackTraceEnabled() ) {
StackTraceElement[] stackTrace = o.getStackTrace();
dataOut.writeShort(stackTrace.length);
for (int i = 0; i < stackTrace.length; i++) {
StackTraceElement element = stackTrace[i];
looseMarshalString(element.getClassName(), dataOut);
looseMarshalString(element.getMethodName(), dataOut);
looseMarshalString(element.getFileName(), dataOut);
dataOut.writeInt(element.getLineNumber());
}
looseMarshalThrowable(wireFormat, o.getCause(), dataOut);
}
}
}
protected String looseUnmarshalString(DataInputStream dataIn) throws IOException {
if( dataIn.readBoolean() ) {
return dataIn.readUTF();
} else {
return null;
}
}
protected void looseMarshalString(String value, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(value!=null);
if( value!=null ) {
dataOut.writeUTF(value);
}
}
protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(objects!=null);
if( objects!=null ) {
dataOut.writeShort(objects.length);
for( int i=0; i < objects.length; i++ ) {
looseMarshalNestedObject(wireFormat,objects[i], dataOut);
}
}
}
protected void looseMarshalConstByteArray(OpenWireFormat wireFormat, byte[] data, DataOutputStream dataOut, int i) throws IOException {
dataOut.write(data, 0, i);
}
protected byte[] looseUnmarshalConstByteArray(DataInputStream dataIn, int i) throws IOException {
byte data[] = new byte[i];
dataIn.readFully(data);
return data;
}
protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(data!=null);
if( data!=null ){
dataOut.writeInt(data.length);
dataOut.write(data);
}
}
protected byte[] looseUnmarshalByteArray(DataInputStream dataIn) throws IOException {
byte rc[]=null;
if( dataIn.readBoolean() ) {
int size = dataIn.readInt();
rc = new byte[size];
dataIn.readFully(rc);
}
return rc;
}
protected void looseMarshalByteSequence(OpenWireFormat wireFormat, ByteSequence data, DataOutputStream dataOut) throws IOException {
dataOut.writeBoolean(data!=null);
if( data!=null ){
dataOut.writeInt(data.getLength());
dataOut.write(data.getData(), data.getOffset(), data.getLength());
}
}
protected ByteSequence looseUnmarshalByteSequence(DataInputStream dataIn) throws IOException {
ByteSequence rc=null;
if( dataIn.readBoolean() ) {
int size = dataIn.readInt();
byte[] t = new byte[size];
dataIn.readFully(t);
rc = new ByteSequence(t, 0, size);
}
return rc;
}
}

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class BrokerIdMarshaller extends DataStreamMarshaller { public class BrokerIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,11 +60,11 @@ public class BrokerIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
BrokerId info = (BrokerId)o; BrokerId info = (BrokerId)o;
info.setValue(readString(dataIn, bs)); info.setValue(tightUnmarshalString(dataIn, bs));
} }
@ -72,12 +72,12 @@ public class BrokerIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
BrokerId info = (BrokerId)o; BrokerId info = (BrokerId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getValue(), bs); rc += tightMarshalString1(info.getValue(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class BrokerIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
BrokerId info = (BrokerId)o; BrokerId info = (BrokerId)o;
writeString(info.getValue(), dataOut, bs); tightMarshalString2(info.getValue(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
BrokerId info = (BrokerId)o;
info.setValue(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
BrokerId info = (BrokerId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getValue(), dataOut);
} }
} }

View File

@ -60,25 +60,25 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
BrokerInfo info = (BrokerInfo)o; BrokerInfo info = (BrokerInfo)o;
info.setBrokerId((BrokerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setBrokerId((BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setBrokerURL(readString(dataIn, bs)); info.setBrokerURL(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) { if (bs.readBoolean()) {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerInfo value[] = new BrokerInfo[size]; BrokerInfo value[] = new BrokerInfo[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerInfo) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setPeerBrokerInfos(value); info.setPeerBrokerInfos(value);
} }
else { else {
info.setPeerBrokerInfos(null); info.setPeerBrokerInfos(null);
} }
info.setBrokerName(readString(dataIn, bs)); info.setBrokerName(tightUnmarshalString(dataIn, bs));
info.setSlaveBroker(bs.readBoolean()); info.setSlaveBroker(bs.readBoolean());
} }
@ -87,16 +87,16 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
BrokerInfo info = (BrokerInfo)o; BrokerInfo info = (BrokerInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getBrokerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getBrokerId(), bs);
rc += writeString(info.getBrokerURL(), bs); rc += tightMarshalString1(info.getBrokerURL(), bs);
rc += marshalObjectArray(wireFormat, info.getPeerBrokerInfos(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getPeerBrokerInfos(), bs);
rc += writeString(info.getBrokerName(), bs); rc += tightMarshalString1(info.getBrokerName(), bs);
bs.writeBoolean(info.isSlaveBroker()); bs.writeBoolean(info.isSlaveBroker());
return rc + 0; return rc + 0;
} }
@ -108,15 +108,62 @@ public class BrokerInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
BrokerInfo info = (BrokerInfo)o; BrokerInfo info = (BrokerInfo)o;
marshal2CachedObject(wireFormat, info.getBrokerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getBrokerId(), dataOut, bs);
writeString(info.getBrokerURL(), dataOut, bs); tightMarshalString2(info.getBrokerURL(), dataOut, bs);
marshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
writeString(info.getBrokerName(), dataOut, bs); tightMarshalString2(info.getBrokerName(), dataOut, bs);
bs.readBoolean(); bs.readBoolean();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
BrokerInfo info = (BrokerInfo)o;
info.setBrokerId((BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrokerURL(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerInfo value[] = new BrokerInfo[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setPeerBrokerInfos(value);
}
else {
info.setPeerBrokerInfos(null);
}
info.setBrokerName(looseUnmarshalString(dataIn));
info.setSlaveBroker(dataIn.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
BrokerInfo info = (BrokerInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getBrokerId(), dataOut);
looseMarshalString(info.getBrokerURL(), dataOut);
looseMarshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut);
looseMarshalString(info.getBrokerName(), dataOut);
dataOut.writeBoolean(info.isSlaveBroker());
} }
} }

View File

@ -60,12 +60,12 @@ public class ConnectionErrorMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConnectionError info = (ConnectionError)o; ConnectionError info = (ConnectionError)o;
info.setException((Throwable) unmarsalThrowable(wireFormat, dataIn, bs)); info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
info.setConnectionId((ConnectionId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
} }
@ -73,13 +73,13 @@ public class ConnectionErrorMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConnectionError info = (ConnectionError)o; ConnectionError info = (ConnectionError)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshalThrowable(wireFormat, info.getException(), bs); rc += tightMarshalThrowable1(wireFormat, info.getException(), bs);
rc += marshal1NestedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getConnectionId(), bs);
return rc + 0; return rc + 0;
} }
@ -91,12 +91,42 @@ public class ConnectionErrorMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ConnectionError info = (ConnectionError)o; ConnectionError info = (ConnectionError)o;
marshalThrowable(wireFormat, info.getException(), dataOut, bs); tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ConnectionError info = (ConnectionError)o;
info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
info.setConnectionId((ConnectionId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ConnectionError info = (ConnectionError)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalThrowable(wireFormat, info.getException(), dataOut);
looseMarshalNestedObject(wireFormat, info.getConnectionId(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class ConnectionIdMarshaller extends DataStreamMarshaller { public class ConnectionIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,11 +60,11 @@ public class ConnectionIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConnectionId info = (ConnectionId)o; ConnectionId info = (ConnectionId)o;
info.setValue(readString(dataIn, bs)); info.setValue(tightUnmarshalString(dataIn, bs));
} }
@ -72,12 +72,12 @@ public class ConnectionIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConnectionId info = (ConnectionId)o; ConnectionId info = (ConnectionId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getValue(), bs); rc += tightMarshalString1(info.getValue(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class ConnectionIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ConnectionId info = (ConnectionId)o; ConnectionId info = (ConnectionId)o;
writeString(info.getValue(), dataOut, bs); tightMarshalString2(info.getValue(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ConnectionId info = (ConnectionId)o;
info.setValue(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ConnectionId info = (ConnectionId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getValue(), dataOut);
} }
} }

View File

@ -60,20 +60,20 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConnectionInfo info = (ConnectionInfo)o; ConnectionInfo info = (ConnectionInfo)o;
info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setClientId(readString(dataIn, bs)); info.setClientId(tightUnmarshalString(dataIn, bs));
info.setPassword(readString(dataIn, bs)); info.setPassword(tightUnmarshalString(dataIn, bs));
info.setUserName(readString(dataIn, bs)); info.setUserName(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) { if (bs.readBoolean()) {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size]; BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setBrokerPath(value); info.setBrokerPath(value);
} }
@ -87,16 +87,16 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConnectionInfo info = (ConnectionInfo)o; ConnectionInfo info = (ConnectionInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
rc += writeString(info.getClientId(), bs); rc += tightMarshalString1(info.getClientId(), bs);
rc += writeString(info.getPassword(), bs); rc += tightMarshalString1(info.getPassword(), bs);
rc += writeString(info.getUserName(), bs); rc += tightMarshalString1(info.getUserName(), bs);
rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 0; return rc + 0;
} }
@ -108,15 +108,62 @@ public class ConnectionInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ConnectionInfo info = (ConnectionInfo)o; ConnectionInfo info = (ConnectionInfo)o;
marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
writeString(info.getClientId(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs);
writeString(info.getPassword(), dataOut, bs); tightMarshalString2(info.getPassword(), dataOut, bs);
writeString(info.getUserName(), dataOut, bs); tightMarshalString2(info.getUserName(), dataOut, bs);
marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ConnectionInfo info = (ConnectionInfo)o;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setClientId(looseUnmarshalString(dataIn));
info.setPassword(looseUnmarshalString(dataIn));
info.setUserName(looseUnmarshalString(dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ConnectionInfo info = (ConnectionInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalString(info.getPassword(), dataOut);
looseMarshalString(info.getUserName(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class ConsumerIdMarshaller extends DataStreamMarshaller { public class ConsumerIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,13 +60,13 @@ public class ConsumerIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConsumerId info = (ConsumerId)o; ConsumerId info = (ConsumerId)o;
info.setConnectionId(readString(dataIn, bs)); info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setSessionId(unmarshalLong(wireFormat, dataIn, bs)); info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setValue(unmarshalLong(wireFormat, dataIn, bs)); info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
} }
@ -74,14 +74,14 @@ public class ConsumerIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConsumerId info = (ConsumerId)o; ConsumerId info = (ConsumerId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getConnectionId(), bs); rc += tightMarshalString1(info.getConnectionId(), bs);
rc+=marshal1Long(wireFormat, info.getSessionId(), bs); rc+=tightMarshalLong1(wireFormat, info.getSessionId(), bs);
rc+=marshal1Long(wireFormat, info.getValue(), bs); rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0; return rc + 0;
} }
@ -93,13 +93,45 @@ public class ConsumerIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ConsumerId info = (ConsumerId)o; ConsumerId info = (ConsumerId)o;
writeString(info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getConnectionId(), dataOut, bs);
marshal2Long(wireFormat, info.getSessionId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs);
marshal2Long(wireFormat, info.getValue(), dataOut, bs); tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ConsumerId info = (ConsumerId)o;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setSessionId(looseUnmarshalLong(wireFormat, dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ConsumerId info = (ConsumerId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getSessionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
} }
} }

View File

@ -60,17 +60,17 @@ public class ConsumerInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ConsumerInfo info = (ConsumerInfo)o; ConsumerInfo info = (ConsumerInfo)o;
info.setConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setBrowser(bs.readBoolean()); info.setBrowser(bs.readBoolean());
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setPrefetchSize(dataIn.readInt()); info.setPrefetchSize(dataIn.readInt());
info.setDispatchAsync(bs.readBoolean()); info.setDispatchAsync(bs.readBoolean());
info.setSelector(readString(dataIn, bs)); info.setSelector(tightUnmarshalString(dataIn, bs));
info.setSubcriptionName(readString(dataIn, bs)); info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
info.setNoLocal(bs.readBoolean()); info.setNoLocal(bs.readBoolean());
info.setExclusive(bs.readBoolean()); info.setExclusive(bs.readBoolean());
info.setRetroactive(bs.readBoolean()); info.setRetroactive(bs.readBoolean());
@ -80,7 +80,7 @@ public class ConsumerInfoMarshaller extends BaseCommandMarshaller {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size]; BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setBrokerPath(value); info.setBrokerPath(value);
} }
@ -95,24 +95,24 @@ public class ConsumerInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConsumerInfo info = (ConsumerInfo)o; ConsumerInfo info = (ConsumerInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConsumerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConsumerId(), bs);
bs.writeBoolean(info.isBrowser()); bs.writeBoolean(info.isBrowser());
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
bs.writeBoolean(info.isDispatchAsync()); bs.writeBoolean(info.isDispatchAsync());
rc += writeString(info.getSelector(), bs); rc += tightMarshalString1(info.getSelector(), bs);
rc += writeString(info.getSubcriptionName(), bs); rc += tightMarshalString1(info.getSubcriptionName(), bs);
bs.writeBoolean(info.isNoLocal()); bs.writeBoolean(info.isNoLocal());
bs.writeBoolean(info.isExclusive()); bs.writeBoolean(info.isExclusive());
bs.writeBoolean(info.isRetroactive()); bs.writeBoolean(info.isRetroactive());
rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
bs.writeBoolean(info.isNetworkSubscription()); bs.writeBoolean(info.isNetworkSubscription());
return rc + 2; return rc + 5;
} }
/** /**
@ -122,23 +122,86 @@ public class ConsumerInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ConsumerInfo info = (ConsumerInfo)o; ConsumerInfo info = (ConsumerInfo)o;
marshal2CachedObject(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs);
bs.readBoolean(); bs.readBoolean();
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
dataOut.writeInt(info.getPrefetchSize()); dataOut.writeInt(info.getPrefetchSize());
bs.readBoolean(); bs.readBoolean();
writeString(info.getSelector(), dataOut, bs); tightMarshalString2(info.getSelector(), dataOut, bs);
writeString(info.getSubcriptionName(), dataOut, bs); tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
bs.readBoolean(); bs.readBoolean();
bs.readBoolean(); bs.readBoolean();
bs.readBoolean(); bs.readBoolean();
dataOut.writeByte(info.getPriority()); dataOut.writeByte(info.getPriority());
marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
bs.readBoolean(); bs.readBoolean();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ConsumerInfo info = (ConsumerInfo)o;
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setBrowser(dataIn.readBoolean());
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setPrefetchSize(dataIn.readInt());
info.setDispatchAsync(dataIn.readBoolean());
info.setSelector(looseUnmarshalString(dataIn));
info.setSubcriptionName(looseUnmarshalString(dataIn));
info.setNoLocal(dataIn.readBoolean());
info.setExclusive(dataIn.readBoolean());
info.setRetroactive(dataIn.readBoolean());
info.setPriority(dataIn.readByte());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
info.setNetworkSubscription(dataIn.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ConsumerInfo info = (ConsumerInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
dataOut.writeBoolean(info.isBrowser());
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
dataOut.writeInt(info.getPrefetchSize());
dataOut.writeBoolean(info.isDispatchAsync());
looseMarshalString(info.getSelector(), dataOut);
looseMarshalString(info.getSubcriptionName(), dataOut);
dataOut.writeBoolean(info.isNoLocal());
dataOut.writeBoolean(info.isExclusive());
dataOut.writeBoolean(info.isRetroactive());
dataOut.writeByte(info.getPriority());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
dataOut.writeBoolean(info.isNetworkSubscription());
} }
} }

View File

@ -60,11 +60,11 @@ public class ControlCommandMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ControlCommand info = (ControlCommand)o; ControlCommand info = (ControlCommand)o;
info.setCommand(readString(dataIn, bs)); info.setCommand(tightUnmarshalString(dataIn, bs));
} }
@ -72,12 +72,12 @@ public class ControlCommandMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ControlCommand info = (ControlCommand)o; ControlCommand info = (ControlCommand)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getCommand(), bs); rc += tightMarshalString1(info.getCommand(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class ControlCommandMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ControlCommand info = (ControlCommand)o; ControlCommand info = (ControlCommand)o;
writeString(info.getCommand(), dataOut, bs); tightMarshalString2(info.getCommand(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ControlCommand info = (ControlCommand)o;
info.setCommand(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ControlCommand info = (ControlCommand)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getCommand(), dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class DataArrayResponseMarshaller extends ResponseMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
DataArrayResponse info = (DataArrayResponse)o; DataArrayResponse info = (DataArrayResponse)o;
@ -69,7 +69,7 @@ public class DataArrayResponseMarshaller extends ResponseMarshaller {
short size = dataIn.readShort(); short size = dataIn.readShort();
DataStructure value[] = new DataStructure[size]; DataStructure value[] = new DataStructure[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (DataStructure) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (DataStructure) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setData(value); info.setData(value);
} }
@ -83,12 +83,12 @@ public class DataArrayResponseMarshaller extends ResponseMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
DataArrayResponse info = (DataArrayResponse)o; DataArrayResponse info = (DataArrayResponse)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshalObjectArray(wireFormat, info.getData(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getData(), bs);
return rc + 0; return rc + 0;
} }
@ -100,11 +100,50 @@ public class DataArrayResponseMarshaller extends ResponseMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
DataArrayResponse info = (DataArrayResponse)o; DataArrayResponse info = (DataArrayResponse)o;
marshalObjectArray(wireFormat, info.getData(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getData(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
DataArrayResponse info = (DataArrayResponse)o;
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
DataStructure value[] = new DataStructure[size];
for( int i=0; i < size; i++ ) {
value[i] = (DataStructure) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setData(value);
}
else {
info.setData(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
DataArrayResponse info = (DataArrayResponse)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalObjectArray(wireFormat, info.getData(), dataOut);
} }
} }

View File

@ -60,11 +60,11 @@ public class DataResponseMarshaller extends ResponseMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
DataResponse info = (DataResponse)o; DataResponse info = (DataResponse)o;
info.setData((DataStructure) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setData((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
} }
@ -72,12 +72,12 @@ public class DataResponseMarshaller extends ResponseMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
DataResponse info = (DataResponse)o; DataResponse info = (DataResponse)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1NestedObject(wireFormat, info.getData(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getData(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class DataResponseMarshaller extends ResponseMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
DataResponse info = (DataResponse)o; DataResponse info = (DataResponse)o;
marshal2NestedObject(wireFormat, info.getData(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getData(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
DataResponse info = (DataResponse)o;
info.setData((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
DataResponse info = (DataResponse)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalNestedObject(wireFormat, info.getData(), dataOut);
} }
} }

View File

@ -0,0 +1,97 @@
/**
*
* 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.v1;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Marshalling code for Open Wire Format for DataStructureSupportMarshaller
*
*
* NOTE!: This file is auto generated - do not modify!
* if you need to make a change, please see the modify the groovy scripts in the
* under src/gram/script and then use maven openwire:generate to regenerate
* this file.
*
* @version $Revision$
*/
public abstract class DataStructureSupportMarshaller extends BaseDataStreamMarshaller {
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0;
}
/**
* Write a object instance to data output stream
*
* @param o the instance to be marshaled
* @param dataOut the output stream
* @throws IOException thrown if an error occurs
*/
public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
}
}

View File

@ -60,20 +60,20 @@ public class DestinationInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
DestinationInfo info = (DestinationInfo)o; DestinationInfo info = (DestinationInfo)o;
info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setOperationType(dataIn.readByte()); info.setOperationType(dataIn.readByte());
info.setTimeout(unmarshalLong(wireFormat, dataIn, bs)); info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs));
if (bs.readBoolean()) { if (bs.readBoolean()) {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size]; BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setBrokerPath(value); info.setBrokerPath(value);
} }
@ -87,15 +87,15 @@ public class DestinationInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
DestinationInfo info = (DestinationInfo)o; DestinationInfo info = (DestinationInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc+=marshal1Long(wireFormat, info.getTimeout(), bs); rc+=tightMarshalLong1(wireFormat, info.getTimeout(), bs);
rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 1; return rc + 1;
} }
@ -107,15 +107,62 @@ public class DestinationInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
DestinationInfo info = (DestinationInfo)o; DestinationInfo info = (DestinationInfo)o;
marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
dataOut.writeByte(info.getOperationType()); dataOut.writeByte(info.getOperationType());
marshal2Long(wireFormat, info.getTimeout(), dataOut, bs); tightMarshalLong2(wireFormat, info.getTimeout(), dataOut, bs);
marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
DestinationInfo info = (DestinationInfo)o;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setOperationType(dataIn.readByte());
info.setTimeout(looseUnmarshalLong(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
DestinationInfo info = (DestinationInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
dataOut.writeByte(info.getOperationType());
looseMarshalLong(wireFormat, info.getTimeout(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class DiscoveryEventMarshaller extends DataStreamMarshaller { public class DiscoveryEventMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,12 +60,12 @@ public class DiscoveryEventMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
DiscoveryEvent info = (DiscoveryEvent)o; DiscoveryEvent info = (DiscoveryEvent)o;
info.setServiceName(readString(dataIn, bs)); info.setServiceName(tightUnmarshalString(dataIn, bs));
info.setBrokerName(readString(dataIn, bs)); info.setBrokerName(tightUnmarshalString(dataIn, bs));
} }
@ -73,13 +73,13 @@ public class DiscoveryEventMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
DiscoveryEvent info = (DiscoveryEvent)o; DiscoveryEvent info = (DiscoveryEvent)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getServiceName(), bs); rc += tightMarshalString1(info.getServiceName(), bs);
rc += writeString(info.getBrokerName(), bs); rc += tightMarshalString1(info.getBrokerName(), bs);
return rc + 0; return rc + 0;
} }
@ -91,12 +91,42 @@ public class DiscoveryEventMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
DiscoveryEvent info = (DiscoveryEvent)o; DiscoveryEvent info = (DiscoveryEvent)o;
writeString(info.getServiceName(), dataOut, bs); tightMarshalString2(info.getServiceName(), dataOut, bs);
writeString(info.getBrokerName(), dataOut, bs); tightMarshalString2(info.getBrokerName(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
DiscoveryEvent info = (DiscoveryEvent)o;
info.setServiceName(looseUnmarshalString(dataIn));
info.setBrokerName(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
DiscoveryEvent info = (DiscoveryEvent)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getServiceName(), dataOut);
looseMarshalString(info.getBrokerName(), dataOut);
} }
} }

View File

@ -60,11 +60,11 @@ public class ExceptionResponseMarshaller extends ResponseMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ExceptionResponse info = (ExceptionResponse)o; ExceptionResponse info = (ExceptionResponse)o;
info.setException((Throwable) unmarsalThrowable(wireFormat, dataIn, bs)); info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
} }
@ -72,12 +72,12 @@ public class ExceptionResponseMarshaller extends ResponseMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ExceptionResponse info = (ExceptionResponse)o; ExceptionResponse info = (ExceptionResponse)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshalThrowable(wireFormat, info.getException(), bs); rc += tightMarshalThrowable1(wireFormat, info.getException(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class ExceptionResponseMarshaller extends ResponseMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ExceptionResponse info = (ExceptionResponse)o; ExceptionResponse info = (ExceptionResponse)o;
marshalThrowable(wireFormat, info.getException(), dataOut, bs); tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ExceptionResponse info = (ExceptionResponse)o;
info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ExceptionResponse info = (ExceptionResponse)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalThrowable(wireFormat, info.getException(), dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class FlushCommandMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class FlushCommandMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class FlushCommandMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class IntegerResponseMarshaller extends ResponseMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
IntegerResponse info = (IntegerResponse)o; IntegerResponse info = (IntegerResponse)o;
info.setResult(dataIn.readInt()); info.setResult(dataIn.readInt());
@ -72,13 +72,13 @@ public class IntegerResponseMarshaller extends ResponseMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
IntegerResponse info = (IntegerResponse)o; IntegerResponse info = (IntegerResponse)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 1; return rc + 4;
} }
/** /**
@ -88,11 +88,39 @@ public class IntegerResponseMarshaller extends ResponseMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
IntegerResponse info = (IntegerResponse)o; IntegerResponse info = (IntegerResponse)o;
dataOut.writeInt(info.getResult()); dataOut.writeInt(info.getResult());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
IntegerResponse info = (IntegerResponse)o;
info.setResult(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
IntegerResponse info = (IntegerResponse)o;
super.looseMarshal(wireFormat, o, dataOut);
dataOut.writeInt(info.getResult());
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class JournalQueueAckMarshaller extends DataStreamMarshaller { public class JournalQueueAckMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,12 +60,12 @@ public class JournalQueueAckMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalQueueAck info = (JournalQueueAck)o; JournalQueueAck info = (JournalQueueAck)o;
info.setDestination((ActiveMQDestination) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageAck((MessageAck) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageAck((MessageAck) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
} }
@ -73,13 +73,13 @@ public class JournalQueueAckMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
JournalQueueAck info = (JournalQueueAck)o; JournalQueueAck info = (JournalQueueAck)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1NestedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getDestination(), bs);
rc += marshal1NestedObject(wireFormat, info.getMessageAck(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getMessageAck(), bs);
return rc + 0; return rc + 0;
} }
@ -91,12 +91,42 @@ public class JournalQueueAckMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
JournalQueueAck info = (JournalQueueAck)o; JournalQueueAck info = (JournalQueueAck)o;
marshal2NestedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getMessageAck(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessageAck(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalQueueAck info = (JournalQueueAck)o;
info.setDestination((ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageAck((MessageAck) looseUnmarsalNestedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
JournalQueueAck info = (JournalQueueAck)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalNestedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessageAck(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class JournalTopicAckMarshaller extends DataStreamMarshaller { public class JournalTopicAckMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,16 +60,16 @@ public class JournalTopicAckMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTopicAck info = (JournalTopicAck)o; JournalTopicAck info = (JournalTopicAck)o;
info.setDestination((ActiveMQDestination) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageSequenceId(unmarshalLong(wireFormat, dataIn, bs)); info.setMessageSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSubscritionName(readString(dataIn, bs)); info.setSubscritionName(tightUnmarshalString(dataIn, bs));
info.setClientId(readString(dataIn, bs)); info.setClientId(tightUnmarshalString(dataIn, bs));
info.setTransactionId((TransactionId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
} }
@ -77,17 +77,17 @@ public class JournalTopicAckMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
JournalTopicAck info = (JournalTopicAck)o; JournalTopicAck info = (JournalTopicAck)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1NestedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getDestination(), bs);
rc += marshal1NestedObject(wireFormat, info.getMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getMessageId(), bs);
rc+=marshal1Long(wireFormat, info.getMessageSequenceId(), bs); rc+=tightMarshalLong1(wireFormat, info.getMessageSequenceId(), bs);
rc += writeString(info.getSubscritionName(), bs); rc += tightMarshalString1(info.getSubscritionName(), bs);
rc += writeString(info.getClientId(), bs); rc += tightMarshalString1(info.getClientId(), bs);
rc += marshal1NestedObject(wireFormat, info.getTransactionId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getTransactionId(), bs);
return rc + 0; return rc + 0;
} }
@ -99,16 +99,54 @@ public class JournalTopicAckMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
JournalTopicAck info = (JournalTopicAck)o; JournalTopicAck info = (JournalTopicAck)o;
marshal2NestedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessageId(), dataOut, bs);
marshal2Long(wireFormat, info.getMessageSequenceId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getMessageSequenceId(), dataOut, bs);
writeString(info.getSubscritionName(), dataOut, bs); tightMarshalString2(info.getSubscritionName(), dataOut, bs);
writeString(info.getClientId(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getTransactionId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getTransactionId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTopicAck info = (JournalTopicAck)o;
info.setDestination((ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setSubscritionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
info.setTransactionId((TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
JournalTopicAck info = (JournalTopicAck)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalNestedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut);
looseMarshalLong(wireFormat, info.getMessageSequenceId(), dataOut);
looseMarshalString(info.getSubscritionName(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalNestedObject(wireFormat, info.getTransactionId(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class JournalTraceMarshaller extends DataStreamMarshaller { public class JournalTraceMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,11 +60,11 @@ public class JournalTraceMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTrace info = (JournalTrace)o; JournalTrace info = (JournalTrace)o;
info.setMessage(readString(dataIn, bs)); info.setMessage(tightUnmarshalString(dataIn, bs));
} }
@ -72,12 +72,12 @@ public class JournalTraceMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
JournalTrace info = (JournalTrace)o; JournalTrace info = (JournalTrace)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getMessage(), bs); rc += tightMarshalString1(info.getMessage(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class JournalTraceMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
JournalTrace info = (JournalTrace)o; JournalTrace info = (JournalTrace)o;
writeString(info.getMessage(), dataOut, bs); tightMarshalString2(info.getMessage(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTrace info = (JournalTrace)o;
info.setMessage(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
JournalTrace info = (JournalTrace)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getMessage(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class JournalTransactionMarshaller extends DataStreamMarshaller { public class JournalTransactionMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,11 +60,11 @@ public class JournalTransactionMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
JournalTransaction info = (JournalTransaction)o; JournalTransaction info = (JournalTransaction)o;
info.setTransactionId((TransactionId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setType(dataIn.readByte()); info.setType(dataIn.readByte());
info.setWasPrepared(bs.readBoolean()); info.setWasPrepared(bs.readBoolean());
@ -74,13 +74,13 @@ public class JournalTransactionMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
JournalTransaction info = (JournalTransaction)o; JournalTransaction info = (JournalTransaction)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1NestedObject(wireFormat, info.getTransactionId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getTransactionId(), bs);
bs.writeBoolean(info.getWasPrepared()); bs.writeBoolean(info.getWasPrepared());
return rc + 1; return rc + 1;
} }
@ -92,13 +92,45 @@ public class JournalTransactionMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
JournalTransaction info = (JournalTransaction)o; JournalTransaction info = (JournalTransaction)o;
marshal2NestedObject(wireFormat, info.getTransactionId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getTransactionId(), dataOut, bs);
dataOut.writeByte(info.getType()); dataOut.writeByte(info.getType());
bs.readBoolean(); bs.readBoolean();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
JournalTransaction info = (JournalTransaction)o;
info.setTransactionId((TransactionId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setType(dataIn.readByte());
info.setWasPrepared(dataIn.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
JournalTransaction info = (JournalTransaction)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalNestedObject(wireFormat, info.getTransactionId(), dataOut);
dataOut.writeByte(info.getType());
dataOut.writeBoolean(info.getWasPrepared());
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class KeepAliveInfoMarshaller extends DataStreamMarshaller { public class KeepAliveInfoMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,8 +60,8 @@ public class KeepAliveInfoMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class KeepAliveInfoMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class KeepAliveInfoMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,12 +60,12 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
LocalTransactionId info = (LocalTransactionId)o; LocalTransactionId info = (LocalTransactionId)o;
info.setValue(unmarshalLong(wireFormat, dataIn, bs)); info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
} }
@ -73,13 +73,13 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
LocalTransactionId info = (LocalTransactionId)o; LocalTransactionId info = (LocalTransactionId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc+=marshal1Long(wireFormat, info.getValue(), bs); rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
return rc + 0; return rc + 0;
} }
@ -91,12 +91,42 @@ public class LocalTransactionIdMarshaller extends TransactionIdMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
LocalTransactionId info = (LocalTransactionId)o; LocalTransactionId info = (LocalTransactionId)o;
marshal2Long(wireFormat, info.getValue(), dataOut, bs); tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
LocalTransactionId info = (LocalTransactionId)o;
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
LocalTransactionId info = (LocalTransactionId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
} }
} }

View File

@ -60,16 +60,16 @@ public class MessageAckMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageAck info = (MessageAck)o; MessageAck info = (MessageAck)o;
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setAckType(dataIn.readByte()); info.setAckType(dataIn.readByte());
info.setFirstMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setFirstMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setLastMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setLastMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setMessageCount(dataIn.readInt()); info.setMessageCount(dataIn.readInt());
} }
@ -78,18 +78,18 @@ public class MessageAckMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
MessageAck info = (MessageAck)o; MessageAck info = (MessageAck)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc += marshal1CachedObject(wireFormat, info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs);
rc += marshal1CachedObject(wireFormat, info.getConsumerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConsumerId(), bs);
rc += marshal1NestedObject(wireFormat, info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getFirstMessageId(), bs);
rc += marshal1NestedObject(wireFormat, info.getLastMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getLastMessageId(), bs);
return rc + 2; return rc + 5;
} }
/** /**
@ -99,17 +99,57 @@ public class MessageAckMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
MessageAck info = (MessageAck)o; MessageAck info = (MessageAck)o;
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getTransactionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getTransactionId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs);
dataOut.writeByte(info.getAckType()); dataOut.writeByte(info.getAckType());
marshal2NestedObject(wireFormat, info.getFirstMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getFirstMessageId(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getLastMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getLastMessageId(), dataOut, bs);
dataOut.writeInt(info.getMessageCount()); dataOut.writeInt(info.getMessageCount());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
MessageAck info = (MessageAck)o;
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setAckType(dataIn.readByte());
info.setFirstMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setLastMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setMessageCount(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
MessageAck info = (MessageAck)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
dataOut.writeByte(info.getAckType());
looseMarshalNestedObject(wireFormat, info.getFirstMessageId(), dataOut);
looseMarshalNestedObject(wireFormat, info.getLastMessageId(), dataOut);
dataOut.writeInt(info.getMessageCount());
} }
} }

View File

@ -60,13 +60,13 @@ public class MessageDispatchMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageDispatch info = (MessageDispatch)o; MessageDispatch info = (MessageDispatch)o;
info.setConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setMessage((Message) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessage((Message) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setRedeliveryCounter(dataIn.readInt()); info.setRedeliveryCounter(dataIn.readInt());
} }
@ -75,16 +75,16 @@ public class MessageDispatchMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
MessageDispatch info = (MessageDispatch)o; MessageDispatch info = (MessageDispatch)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConsumerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConsumerId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc += marshal1NestedObject(wireFormat, info.getMessage(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getMessage(), bs);
return rc + 1; return rc + 4;
} }
/** /**
@ -94,14 +94,48 @@ public class MessageDispatchMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
MessageDispatch info = (MessageDispatch)o; MessageDispatch info = (MessageDispatch)o;
marshal2CachedObject(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getMessage(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessage(), dataOut, bs);
dataOut.writeInt(info.getRedeliveryCounter()); dataOut.writeInt(info.getRedeliveryCounter());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
MessageDispatch info = (MessageDispatch)o;
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setMessage((Message) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setRedeliveryCounter(dataIn.readInt());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
MessageDispatch info = (MessageDispatch)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessage(), dataOut);
dataOut.writeInt(info.getRedeliveryCounter());
} }
} }

View File

@ -60,14 +60,14 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageDispatchNotification info = (MessageDispatchNotification)o; MessageDispatchNotification info = (MessageDispatchNotification)o;
info.setConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDeliverySequenceId(unmarshalLong(wireFormat, dataIn, bs)); info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
} }
@ -75,15 +75,15 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
MessageDispatchNotification info = (MessageDispatchNotification)o; MessageDispatchNotification info = (MessageDispatchNotification)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConsumerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConsumerId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc+=marshal1Long(wireFormat, info.getDeliverySequenceId(), bs); rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs);
rc += marshal1NestedObject(wireFormat, info.getMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getMessageId(), bs);
return rc + 0; return rc + 0;
} }
@ -95,14 +95,48 @@ public class MessageDispatchNotificationMarshaller extends BaseCommandMarshaller
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
MessageDispatchNotification info = (MessageDispatchNotification)o; MessageDispatchNotification info = (MessageDispatchNotification)o;
marshal2CachedObject(wireFormat, info.getConsumerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2Long(wireFormat, info.getDeliverySequenceId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getDeliverySequenceId(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessageId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
MessageDispatchNotification info = (MessageDispatchNotification)o;
info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
MessageDispatchNotification info = (MessageDispatchNotification)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class MessageIdMarshaller extends DataStreamMarshaller { public class MessageIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,13 +60,13 @@ public class MessageIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
MessageId info = (MessageId)o; MessageId info = (MessageId)o;
info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setProducerSequenceId(unmarshalLong(wireFormat, dataIn, bs)); info.setProducerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setBrokerSequenceId(unmarshalLong(wireFormat, dataIn, bs)); info.setBrokerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs));
} }
@ -74,14 +74,14 @@ public class MessageIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
MessageId info = (MessageId)o; MessageId info = (MessageId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs);
rc+=marshal1Long(wireFormat, info.getProducerSequenceId(), bs); rc+=tightMarshalLong1(wireFormat, info.getProducerSequenceId(), bs);
rc+=marshal1Long(wireFormat, info.getBrokerSequenceId(), bs); rc+=tightMarshalLong1(wireFormat, info.getBrokerSequenceId(), bs);
return rc + 0; return rc + 0;
} }
@ -93,13 +93,45 @@ public class MessageIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
MessageId info = (MessageId)o; MessageId info = (MessageId)o;
marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs);
marshal2Long(wireFormat, info.getProducerSequenceId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getProducerSequenceId(), dataOut, bs);
marshal2Long(wireFormat, info.getBrokerSequenceId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getBrokerSequenceId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
MessageId info = (MessageId)o;
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setProducerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
info.setBrokerSequenceId(looseUnmarshalLong(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
MessageId info = (MessageId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut);
looseMarshalLong(wireFormat, info.getProducerSequenceId(), dataOut);
looseMarshalLong(wireFormat, info.getBrokerSequenceId(), dataOut);
} }
} }

View File

@ -45,46 +45,32 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
Message info = (Message)o; Message info = (Message)o;
info.beforeUnmarshall(wireFormat); info.beforeUnmarshall(wireFormat);
info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setOriginalDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setOriginalDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setOriginalTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setOriginalTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setGroupID(readString(dataIn, bs)); info.setGroupID(tightUnmarshalString(dataIn, bs));
info.setGroupSequence(dataIn.readInt()); info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(readString(dataIn, bs)); info.setCorrelationId(tightUnmarshalString(dataIn, bs));
info.setPersistent(bs.readBoolean()); info.setPersistent(bs.readBoolean());
info.setExpiration(unmarshalLong(wireFormat, dataIn, bs)); info.setExpiration(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setPriority(dataIn.readByte()); info.setPriority(dataIn.readByte());
info.setReplyTo((ActiveMQDestination) unmarsalNestedObject(wireFormat, dataIn, bs)); info.setReplyTo((ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
info.setTimestamp(unmarshalLong(wireFormat, dataIn, bs)); info.setTimestamp(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setType(readString(dataIn, bs)); info.setType(tightUnmarshalString(dataIn, bs));
if( bs.readBoolean() ) { info.setContent(tightUnmarshalByteSequence(dataIn, bs));
int size = dataIn.readInt(); info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs));
byte data[] = new byte[size]; info.setDataStructure((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs));
dataIn.readFully(data); info.setTargetConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setContent(new org.activeio.ByteSequence(data,0,size));
} else {
info.setContent(null);
}
if( bs.readBoolean() ) {
int size = dataIn.readInt();
byte data[] = new byte[size];
dataIn.readFully(data);
info.setMarshalledProperties(new org.activeio.ByteSequence(data,0,size));
} else {
info.setMarshalledProperties(null);
}
info.setDataStructure((DataStructure) unmarsalNestedObject(wireFormat, dataIn, bs));
info.setTargetConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs));
info.setCompressed(bs.readBoolean()); info.setCompressed(bs.readBoolean());
info.setRedeliveryCounter(dataIn.readInt()); info.setRedeliveryCounter(dataIn.readInt());
@ -92,15 +78,15 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size]; BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setBrokerPath(value); info.setBrokerPath(value);
} }
else { else {
info.setBrokerPath(null); info.setBrokerPath(null);
} }
info.setArrival(unmarshalLong(wireFormat, dataIn, bs)); info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setUserID(readString(dataIn, bs)); info.setUserID(tightUnmarshalString(dataIn, bs));
info.setRecievedByDFBridge(bs.readBoolean()); info.setRecievedByDFBridge(bs.readBoolean());
info.afterUnmarshall(wireFormat); info.afterUnmarshall(wireFormat);
@ -111,39 +97,37 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
Message info = (Message)o; Message info = (Message)o;
info.beforeMarshall(wireFormat); info.beforeMarshall(wireFormat);
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc += marshal1CachedObject(wireFormat, info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs);
rc += marshal1CachedObject(wireFormat, info.getOriginalDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getOriginalDestination(), bs);
rc += marshal1NestedObject(wireFormat, info.getMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getMessageId(), bs);
rc += marshal1CachedObject(wireFormat, info.getOriginalTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getOriginalTransactionId(), bs);
rc += writeString(info.getGroupID(), bs); rc += tightMarshalString1(info.getGroupID(), bs);
rc += writeString(info.getCorrelationId(), bs); rc += tightMarshalString1(info.getCorrelationId(), bs);
bs.writeBoolean(info.isPersistent()); bs.writeBoolean(info.isPersistent());
rc+=marshal1Long(wireFormat, info.getExpiration(), bs); rc+=tightMarshalLong1(wireFormat, info.getExpiration(), bs);
rc += marshal1NestedObject(wireFormat, info.getReplyTo(), bs); rc += tightMarshalNestedObject1(wireFormat, info.getReplyTo(), bs);
rc+=marshal1Long(wireFormat, info.getTimestamp(), bs); rc+=tightMarshalLong1(wireFormat, info.getTimestamp(), bs);
rc += writeString(info.getType(), bs); rc += tightMarshalString1(info.getType(), bs);
bs.writeBoolean(info.getContent()!=null); rc += tightMarshalByteSequence1(info.getContent(), bs);
rc += info.getContent()==null ? 0 : info.getContent().getLength()+4; rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs);
bs.writeBoolean(info.getMarshalledProperties()!=null); rc += tightMarshalNestedObject1(wireFormat, info.getDataStructure(), bs);
rc += info.getMarshalledProperties()==null ? 0 : info.getMarshalledProperties().getLength()+4; rc += tightMarshalCachedObject1(wireFormat, info.getTargetConsumerId(), bs);
rc += marshal1NestedObject(wireFormat, info.getDataStructure(), bs); bs.writeBoolean(info.isCompressed());
rc += marshal1CachedObject(wireFormat, info.getTargetConsumerId(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
bs.writeBoolean(info.isCompressed()); rc+=tightMarshalLong1(wireFormat, info.getArrival(), bs);
rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalString1(info.getUserID(), bs);
rc+=marshal1Long(wireFormat, info.getArrival(), bs); bs.writeBoolean(info.isRecievedByDFBridge());
rc += writeString(info.getUserID(), bs);
bs.writeBoolean(info.isRecievedByDFBridge());
return rc + 3; return rc + 9;
} }
/** /**
@ -153,45 +137,131 @@ public abstract class MessageMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
Message info = (Message)o; Message info = (Message)o;
marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getTransactionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getTransactionId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getOriginalDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getOriginalDestination(), dataOut, bs);
marshal2NestedObject(wireFormat, info.getMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getMessageId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getOriginalTransactionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getOriginalTransactionId(), dataOut, bs);
writeString(info.getGroupID(), dataOut, bs); tightMarshalString2(info.getGroupID(), dataOut, bs);
dataOut.writeInt(info.getGroupSequence()); dataOut.writeInt(info.getGroupSequence());
writeString(info.getCorrelationId(), dataOut, bs); tightMarshalString2(info.getCorrelationId(), dataOut, bs);
bs.readBoolean(); bs.readBoolean();
marshal2Long(wireFormat, info.getExpiration(), dataOut, bs); tightMarshalLong2(wireFormat, info.getExpiration(), dataOut, bs);
dataOut.writeByte(info.getPriority()); dataOut.writeByte(info.getPriority());
marshal2NestedObject(wireFormat, info.getReplyTo(), dataOut, bs); tightMarshalNestedObject2(wireFormat, info.getReplyTo(), dataOut, bs);
marshal2Long(wireFormat, info.getTimestamp(), dataOut, bs); tightMarshalLong2(wireFormat, info.getTimestamp(), dataOut, bs);
writeString(info.getType(), dataOut, bs); tightMarshalString2(info.getType(), dataOut, bs);
if(bs.readBoolean()) { tightMarshalByteSequence2(info.getContent(), dataOut, bs);
org.activeio.ByteSequence data = info.getContent(); tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs);
dataOut.writeInt(data.getLength()); tightMarshalNestedObject2(wireFormat, info.getDataStructure(), dataOut, bs);
dataOut.write(data.getData(), data.getOffset(), data.getLength()); tightMarshalCachedObject2(wireFormat, info.getTargetConsumerId(), dataOut, bs);
} bs.readBoolean();
if(bs.readBoolean()) { dataOut.writeInt(info.getRedeliveryCounter());
org.activeio.ByteSequence data = info.getMarshalledProperties(); tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
dataOut.writeInt(data.getLength()); tightMarshalLong2(wireFormat, info.getArrival(), dataOut, bs);
dataOut.write(data.getData(), data.getOffset(), data.getLength()); tightMarshalString2(info.getUserID(), dataOut, bs);
} bs.readBoolean();
marshal2NestedObject(wireFormat, info.getDataStructure(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getTargetConsumerId(), dataOut, bs);
bs.readBoolean();
dataOut.writeInt(info.getRedeliveryCounter());
marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs);
marshal2Long(wireFormat, info.getArrival(), dataOut, bs);
writeString(info.getUserID(), dataOut, bs);
bs.readBoolean();
info.afterMarshall(wireFormat); info.afterMarshall(wireFormat);
} }
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
Message info = (Message)o;
info.beforeUnmarshall(wireFormat);
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setOriginalDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setOriginalTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setGroupID(looseUnmarshalString(dataIn));
info.setGroupSequence(dataIn.readInt());
info.setCorrelationId(looseUnmarshalString(dataIn));
info.setPersistent(dataIn.readBoolean());
info.setExpiration(looseUnmarshalLong(wireFormat, dataIn));
info.setPriority(dataIn.readByte());
info.setReplyTo((ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTimestamp(looseUnmarshalLong(wireFormat, dataIn));
info.setType(looseUnmarshalString(dataIn));
info.setContent(looseUnmarshalByteSequence(dataIn));
info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn));
info.setDataStructure((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn));
info.setTargetConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setCompressed(dataIn.readBoolean());
info.setRedeliveryCounter(dataIn.readInt());
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
info.setArrival(looseUnmarshalLong(wireFormat, dataIn));
info.setUserID(looseUnmarshalString(dataIn));
info.setRecievedByDFBridge(dataIn.readBoolean());
info.afterUnmarshall(wireFormat);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
Message info = (Message)o;
info.beforeMarshall(wireFormat);
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalByteSequence(wireFormat, info.getContent(), dataOut);
looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut);
looseMarshalNestedObject(wireFormat, info.getDataStructure(), dataOut);
looseMarshalCachedObject(wireFormat, info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());
}
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class ProducerIdMarshaller extends DataStreamMarshaller { public class ProducerIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,13 +60,13 @@ public class ProducerIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ProducerId info = (ProducerId)o; ProducerId info = (ProducerId)o;
info.setConnectionId(readString(dataIn, bs)); info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setValue(unmarshalLong(wireFormat, dataIn, bs)); info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
info.setSessionId(unmarshalLong(wireFormat, dataIn, bs)); info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs));
} }
@ -74,14 +74,14 @@ public class ProducerIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ProducerId info = (ProducerId)o; ProducerId info = (ProducerId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getConnectionId(), bs); rc += tightMarshalString1(info.getConnectionId(), bs);
rc+=marshal1Long(wireFormat, info.getValue(), bs); rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
rc+=marshal1Long(wireFormat, info.getSessionId(), bs); rc+=tightMarshalLong1(wireFormat, info.getSessionId(), bs);
return rc + 0; return rc + 0;
} }
@ -93,13 +93,45 @@ public class ProducerIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ProducerId info = (ProducerId)o; ProducerId info = (ProducerId)o;
writeString(info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getConnectionId(), dataOut, bs);
marshal2Long(wireFormat, info.getValue(), dataOut, bs); tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
marshal2Long(wireFormat, info.getSessionId(), dataOut, bs); tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ProducerId info = (ProducerId)o;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
info.setSessionId(looseUnmarshalLong(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ProducerId info = (ProducerId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
looseMarshalLong(wireFormat, info.getSessionId(), dataOut);
} }
} }

View File

@ -60,18 +60,18 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
ProducerInfo info = (ProducerInfo)o; ProducerInfo info = (ProducerInfo)o;
info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
if (bs.readBoolean()) { if (bs.readBoolean()) {
short size = dataIn.readShort(); short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size]; BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) { for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
} }
info.setBrokerPath(value); info.setBrokerPath(value);
} }
@ -85,14 +85,14 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ProducerInfo info = (ProducerInfo)o; ProducerInfo info = (ProducerInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 0; return rc + 0;
} }
@ -104,13 +104,56 @@ public class ProducerInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
ProducerInfo info = (ProducerInfo)o; ProducerInfo info = (ProducerInfo)o;
marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
ProducerInfo info = (ProducerInfo)o;
info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
if (dataIn.readBoolean()) {
short size = dataIn.readShort();
BrokerId value[] = new BrokerId[size];
for( int i=0; i < size; i++ ) {
value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
}
info.setBrokerPath(value);
}
else {
info.setBrokerPath(null);
}
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
ProducerInfo info = (ProducerInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
} }
} }

View File

@ -60,11 +60,11 @@ public class RemoveInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
RemoveInfo info = (RemoveInfo)o; RemoveInfo info = (RemoveInfo)o;
info.setObjectId((DataStructure) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setObjectId((DataStructure) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
} }
@ -72,12 +72,12 @@ public class RemoveInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
RemoveInfo info = (RemoveInfo)o; RemoveInfo info = (RemoveInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getObjectId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getObjectId(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class RemoveInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
RemoveInfo info = (RemoveInfo)o; RemoveInfo info = (RemoveInfo)o;
marshal2CachedObject(wireFormat, info.getObjectId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getObjectId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
RemoveInfo info = (RemoveInfo)o;
info.setObjectId((DataStructure) looseUnmarsalCachedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
RemoveInfo info = (RemoveInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getObjectId(), dataOut);
} }
} }

View File

@ -60,13 +60,13 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setSubcriptionName(readString(dataIn, bs)); info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
info.setClientId(readString(dataIn, bs)); info.setClientId(tightUnmarshalString(dataIn, bs));
} }
@ -74,14 +74,14 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
rc += writeString(info.getSubcriptionName(), bs); rc += tightMarshalString1(info.getSubcriptionName(), bs);
rc += writeString(info.getClientId(), bs); rc += tightMarshalString1(info.getClientId(), bs);
return rc + 0; return rc + 0;
} }
@ -93,13 +93,45 @@ public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
writeString(info.getSubcriptionName(), dataOut, bs); tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
writeString(info.getClientId(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setSubcriptionName(looseUnmarshalString(dataIn));
info.setClientId(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
looseMarshalString(info.getSubcriptionName(), dataOut);
looseMarshalString(info.getClientId(), dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ResponseMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
Response info = (Response)o; Response info = (Response)o;
info.setCorrelationId(dataIn.readShort()); info.setCorrelationId(dataIn.readShort());
@ -72,13 +72,13 @@ public class ResponseMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
Response info = (Response)o; Response info = (Response)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 1; return rc + 2;
} }
/** /**
@ -88,11 +88,39 @@ public class ResponseMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
Response info = (Response)o; Response info = (Response)o;
dataOut.writeShort(info.getCorrelationId()); dataOut.writeShort(info.getCorrelationId());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
Response info = (Response)o;
info.setCorrelationId(dataIn.readShort());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
Response info = (Response)o;
super.looseMarshal(wireFormat, o, dataOut);
dataOut.writeShort(info.getCorrelationId());
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class SessionIdMarshaller extends DataStreamMarshaller { public class SessionIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,12 +60,12 @@ public class SessionIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
SessionId info = (SessionId)o; SessionId info = (SessionId)o;
info.setConnectionId(readString(dataIn, bs)); info.setConnectionId(tightUnmarshalString(dataIn, bs));
info.setValue(unmarshalLong(wireFormat, dataIn, bs)); info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs));
} }
@ -73,13 +73,13 @@ public class SessionIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
SessionId info = (SessionId)o; SessionId info = (SessionId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getConnectionId(), bs); rc += tightMarshalString1(info.getConnectionId(), bs);
rc+=marshal1Long(wireFormat, info.getValue(), bs); rc+=tightMarshalLong1(wireFormat, info.getValue(), bs);
return rc + 0; return rc + 0;
} }
@ -91,12 +91,42 @@ public class SessionIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
SessionId info = (SessionId)o; SessionId info = (SessionId)o;
writeString(info.getConnectionId(), dataOut, bs); tightMarshalString2(info.getConnectionId(), dataOut, bs);
marshal2Long(wireFormat, info.getValue(), dataOut, bs); tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
SessionId info = (SessionId)o;
info.setConnectionId(looseUnmarshalString(dataIn));
info.setValue(looseUnmarshalLong(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
SessionId info = (SessionId)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getConnectionId(), dataOut);
looseMarshalLong(wireFormat, info.getValue(), dataOut);
} }
} }

View File

@ -60,11 +60,11 @@ public class SessionInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
SessionInfo info = (SessionInfo)o; SessionInfo info = (SessionInfo)o;
info.setSessionId((SessionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setSessionId((SessionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
} }
@ -72,12 +72,12 @@ public class SessionInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
SessionInfo info = (SessionInfo)o; SessionInfo info = (SessionInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getSessionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getSessionId(), bs);
return rc + 0; return rc + 0;
} }
@ -89,11 +89,39 @@ public class SessionInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
SessionInfo info = (SessionInfo)o; SessionInfo info = (SessionInfo)o;
marshal2CachedObject(wireFormat, info.getSessionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getSessionId(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
SessionInfo info = (SessionInfo)o;
info.setSessionId((SessionId) looseUnmarsalCachedObject(wireFormat, dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
SessionInfo info = (SessionInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getSessionId(), dataOut);
} }
} }

View File

@ -60,8 +60,8 @@ public class ShutdownInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -69,9 +69,9 @@ public class ShutdownInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -83,8 +83,30 @@ public class ShutdownInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class SubscriptionInfoMarshaller extends DataStreamMarshaller { public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,14 +60,14 @@ public class SubscriptionInfoMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
SubscriptionInfo info = (SubscriptionInfo)o; SubscriptionInfo info = (SubscriptionInfo)o;
info.setClientId(readString(dataIn, bs)); info.setClientId(tightUnmarshalString(dataIn, bs));
info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setSelector(readString(dataIn, bs)); info.setSelector(tightUnmarshalString(dataIn, bs));
info.setSubcriptionName(readString(dataIn, bs)); info.setSubcriptionName(tightUnmarshalString(dataIn, bs));
} }
@ -75,15 +75,15 @@ public class SubscriptionInfoMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
SubscriptionInfo info = (SubscriptionInfo)o; SubscriptionInfo info = (SubscriptionInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += writeString(info.getClientId(), bs); rc += tightMarshalString1(info.getClientId(), bs);
rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs);
rc += writeString(info.getSelector(), bs); rc += tightMarshalString1(info.getSelector(), bs);
rc += writeString(info.getSubcriptionName(), bs); rc += tightMarshalString1(info.getSubcriptionName(), bs);
return rc + 0; return rc + 0;
} }
@ -95,14 +95,48 @@ public class SubscriptionInfoMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
SubscriptionInfo info = (SubscriptionInfo)o; SubscriptionInfo info = (SubscriptionInfo)o;
writeString(info.getClientId(), dataOut, bs); tightMarshalString2(info.getClientId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs);
writeString(info.getSelector(), dataOut, bs); tightMarshalString2(info.getSelector(), dataOut, bs);
writeString(info.getSubcriptionName(), dataOut, bs); tightMarshalString2(info.getSubcriptionName(), dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
SubscriptionInfo info = (SubscriptionInfo)o;
info.setClientId(looseUnmarshalString(dataIn));
info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setSelector(looseUnmarshalString(dataIn));
info.setSubcriptionName(looseUnmarshalString(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
SubscriptionInfo info = (SubscriptionInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalString(info.getClientId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut);
looseMarshalString(info.getSelector(), dataOut);
looseMarshalString(info.getSubcriptionName(), dataOut);
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public abstract class TransactionIdMarshaller extends DataStreamMarshaller { public abstract class TransactionIdMarshaller extends BaseDataStreamMarshaller {
/** /**
* Un-marshal an object instance from the data input stream * Un-marshal an object instance from the data input stream
@ -45,8 +45,8 @@ public abstract class TransactionIdMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
} }
@ -54,9 +54,9 @@ public abstract class TransactionIdMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
return rc + 0; return rc + 0;
} }
@ -68,8 +68,30 @@ public abstract class TransactionIdMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
super.looseMarshal(wireFormat, o, dataOut);
} }
} }

View File

@ -60,12 +60,12 @@ public class TransactionInfoMarshaller extends BaseCommandMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
TransactionInfo info = (TransactionInfo)o; TransactionInfo info = (TransactionInfo)o;
info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
info.setType(dataIn.readByte()); info.setType(dataIn.readByte());
} }
@ -74,13 +74,13 @@ public class TransactionInfoMarshaller extends BaseCommandMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
TransactionInfo info = (TransactionInfo)o; TransactionInfo info = (TransactionInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
rc += marshal1CachedObject(wireFormat, info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs);
return rc + 1; return rc + 1;
} }
@ -92,13 +92,45 @@ public class TransactionInfoMarshaller extends BaseCommandMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
TransactionInfo info = (TransactionInfo)o; TransactionInfo info = (TransactionInfo)o;
marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
marshal2CachedObject(wireFormat, info.getTransactionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, info.getTransactionId(), dataOut, bs);
dataOut.writeByte(info.getType()); dataOut.writeByte(info.getType());
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
TransactionInfo info = (TransactionInfo)o;
info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn));
info.setType(dataIn.readByte());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
TransactionInfo info = (TransactionInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut);
dataOut.writeByte(info.getType());
} }
} }

View File

@ -36,7 +36,7 @@ import org.apache.activemq.command.*;
* *
* @version $Revision$ * @version $Revision$
*/ */
public class WireFormatInfoMarshaller extends DataStreamMarshaller { public class WireFormatInfoMarshaller extends BaseDataStreamMarshaller {
/** /**
* Return the type of Data Structure we marshal * Return the type of Data Structure we marshal
@ -60,20 +60,17 @@ public class WireFormatInfoMarshaller extends DataStreamMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
WireFormatInfo info = (WireFormatInfo)o; WireFormatInfo info = (WireFormatInfo)o;
{ info.setMagic(tightUnmarshalConstByteArray(dataIn, bs, 8));
byte data[] = new byte[8];
dataIn.readFully(data);
info.setMagic(data);
}
info.setVersion(dataIn.readInt()); info.setVersion(dataIn.readInt());
info.setCacheEnabled(bs.readBoolean()); info.setCacheEnabled(bs.readBoolean());
info.setCompressionEnabled(bs.readBoolean());
info.setStackTraceEnabled(bs.readBoolean()); info.setStackTraceEnabled(bs.readBoolean());
info.setTcpNoDelayEnabled(bs.readBoolean()); info.setTcpNoDelayEnabled(bs.readBoolean());
info.setPrefixPacketSize(bs.readBoolean());
info.setTightEncodingEnabled(bs.readBoolean());
} }
@ -81,17 +78,19 @@ public class WireFormatInfoMarshaller extends DataStreamMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
WireFormatInfo info = (WireFormatInfo)o; WireFormatInfo info = (WireFormatInfo)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
bs.writeBoolean(info.isCacheEnabled()); rc += tightMarshalConstByteArray1(info.getMagic(), bs, 8);
bs.writeBoolean(info.isCompressionEnabled()); bs.writeBoolean(info.isCacheEnabled());
bs.writeBoolean(info.isStackTraceEnabled()); bs.writeBoolean(info.isStackTraceEnabled());
bs.writeBoolean(info.isTcpNoDelayEnabled()); bs.writeBoolean(info.isTcpNoDelayEnabled());
bs.writeBoolean(info.isPrefixPacketSize());
bs.writeBoolean(info.isTightEncodingEnabled());
return rc + 9; return rc + 4;
} }
/** /**
@ -101,16 +100,57 @@ public class WireFormatInfoMarshaller extends DataStreamMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
WireFormatInfo info = (WireFormatInfo)o; WireFormatInfo info = (WireFormatInfo)o;
dataOut.write(info.getMagic(), 0, 8); tightMarshalConstByteArray2(info.getMagic(), dataOut, bs, 8);
dataOut.writeInt(info.getVersion()); dataOut.writeInt(info.getVersion());
bs.readBoolean(); bs.readBoolean();
bs.readBoolean(); bs.readBoolean();
bs.readBoolean(); bs.readBoolean();
bs.readBoolean(); bs.readBoolean();
bs.readBoolean();
}
/**
* Un-marshal an object instance from the data input stream
*
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
WireFormatInfo info = (WireFormatInfo)o;
info.setMagic(looseUnmarshalConstByteArray(dataIn, 8));
info.setVersion(dataIn.readInt());
info.setCacheEnabled(dataIn.readBoolean());
info.setStackTraceEnabled(dataIn.readBoolean());
info.setTcpNoDelayEnabled(dataIn.readBoolean());
info.setPrefixPacketSize(dataIn.readBoolean());
info.setTightEncodingEnabled(dataIn.readBoolean());
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
WireFormatInfo info = (WireFormatInfo)o;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8);
dataOut.writeInt(info.getVersion());
dataOut.writeBoolean(info.isCacheEnabled());
dataOut.writeBoolean(info.isStackTraceEnabled());
dataOut.writeBoolean(info.isTcpNoDelayEnabled());
dataOut.writeBoolean(info.isPrefixPacketSize());
dataOut.writeBoolean(info.isTightEncodingEnabled());
} }
} }

View File

@ -60,27 +60,13 @@ public class XATransactionIdMarshaller extends TransactionIdMarshaller {
* @param dataIn the data input stream to build the object from * @param dataIn the data input stream to build the object from
* @throws IOException * @throws IOException
*/ */
public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
super.unmarshal(wireFormat, o, dataIn, bs); super.tightUnmarshal(wireFormat, o, dataIn, bs);
XATransactionId info = (XATransactionId)o; XATransactionId info = (XATransactionId)o;
info.setFormatId(dataIn.readInt()); info.setFormatId(dataIn.readInt());
if( bs.readBoolean() ) { info.setGlobalTransactionId(tightUnmarshalByteArray(dataIn, bs));
int size = dataIn.readInt(); info.setBranchQualifier(tightUnmarshalByteArray(dataIn, bs));
byte data[] = new byte[size];
dataIn.readFully(data);
info.setGlobalTransactionId(data);
} else {
info.setGlobalTransactionId(null);
}
if( bs.readBoolean() ) {
int size = dataIn.readInt();
byte data[] = new byte[size];
dataIn.readFully(data);
info.setBranchQualifier(data);
} else {
info.setBranchQualifier(null);
}
} }
@ -88,17 +74,15 @@ public class XATransactionIdMarshaller extends TransactionIdMarshaller {
/** /**
* Write the booleans that this object uses to a BooleanStream * Write the booleans that this object uses to a BooleanStream
*/ */
public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
XATransactionId info = (XATransactionId)o; XATransactionId info = (XATransactionId)o;
int rc = super.marshal1(wireFormat, o, bs); int rc = super.tightMarshal1(wireFormat, o, bs);
bs.writeBoolean(info.getGlobalTransactionId()!=null); rc += tightMarshalByteArray1(info.getGlobalTransactionId(), bs);
rc += info.getGlobalTransactionId()==null ? 0 : info.getGlobalTransactionId().length+4; rc += tightMarshalByteArray1(info.getBranchQualifier(), bs);
bs.writeBoolean(info.getBranchQualifier()!=null);
rc += info.getBranchQualifier()==null ? 0 : info.getBranchQualifier().length+4;
return rc + 1; return rc + 4;
} }
/** /**
@ -108,19 +92,45 @@ public class XATransactionIdMarshaller extends TransactionIdMarshaller {
* @param dataOut the output stream * @param dataOut the output stream
* @throws IOException thrown if an error occurs * @throws IOException thrown if an error occurs
*/ */
public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
super.marshal2(wireFormat, o, dataOut, bs); super.tightMarshal2(wireFormat, o, dataOut, bs);
XATransactionId info = (XATransactionId)o; XATransactionId info = (XATransactionId)o;
dataOut.writeInt(info.getFormatId()); dataOut.writeInt(info.getFormatId());
if(bs.readBoolean()) { tightMarshalByteArray2(info.getGlobalTransactionId(), dataOut, bs);
dataOut.writeInt(info.getGlobalTransactionId().length); tightMarshalByteArray2(info.getBranchQualifier(), dataOut, bs);
dataOut.write(info.getGlobalTransactionId());
} }
if(bs.readBoolean()) {
dataOut.writeInt(info.getBranchQualifier().length); /**
dataOut.write(info.getBranchQualifier()); * Un-marshal an object instance from the data input stream
} *
* @param o the object to un-marshal
* @param dataIn the data input stream to build the object from
* @throws IOException
*/
public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
XATransactionId info = (XATransactionId)o;
info.setFormatId(dataIn.readInt());
info.setGlobalTransactionId(looseUnmarshalByteArray(dataIn));
info.setBranchQualifier(looseUnmarshalByteArray(dataIn));
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
XATransactionId info = (XATransactionId)o;
super.looseMarshal(wireFormat, o, dataOut);
dataOut.writeInt(info.getFormatId());
looseMarshalByteArray(wireFormat, info.getGlobalTransactionId(), dataOut);
looseMarshalByteArray(wireFormat, info.getBranchQualifier(), dataOut);
} }
} }

View File

@ -76,6 +76,8 @@ public class WireFormatNegotiator extends TransportFilter {
info.setStackTraceEnabled(((OpenWireFormat)wireFormat).isStackTraceEnabled()); info.setStackTraceEnabled(((OpenWireFormat)wireFormat).isStackTraceEnabled());
info.setTcpNoDelayEnabled(((OpenWireFormat)wireFormat).isTcpNoDelayEnabled()); info.setTcpNoDelayEnabled(((OpenWireFormat)wireFormat).isTcpNoDelayEnabled());
info.setCacheEnabled(((OpenWireFormat)wireFormat).isCacheEnabled()); info.setCacheEnabled(((OpenWireFormat)wireFormat).isCacheEnabled());
info.setPrefixPacketSize(((OpenWireFormat)wireFormat).isPrefixPacketSize());
info.setTightEncodingEnabled(((OpenWireFormat)wireFormat).isTightEncodingEnabled());
} }
return info; return info;
} }
@ -84,7 +86,7 @@ public class WireFormatNegotiator extends TransportFilter {
if( command.isWireFormatInfo() ) { if( command.isWireFormatInfo() ) {
WireFormatInfo info = (WireFormatInfo) command; WireFormatInfo info = (WireFormatInfo) command;
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Received WireFormat: " + info + " with version: 0x" + Integer.toString(info.getVersion(), 16)); log.debug("Received WireFormat: " + info);
} }
if( !info.isValid() ) { if( !info.isValid() ) {
@ -105,6 +107,12 @@ public class WireFormatNegotiator extends TransportFilter {
if( !info.isCacheEnabled() ) { if( !info.isCacheEnabled() ) {
((OpenWireFormat)wireFormat).setCacheEnabled(false); ((OpenWireFormat)wireFormat).setCacheEnabled(false);
} }
if( !info.isPrefixPacketSize() ) {
((OpenWireFormat)wireFormat).setPrefixPacketSize(false);
}
if( !info.isTightEncodingEnabled() ) {
((OpenWireFormat)wireFormat).setTightEncodingEnabled(false);
}
} }
readyCountDownLatch.countDown(); readyCountDownLatch.countDown();

View File

@ -33,7 +33,7 @@ import org.apache.activemq.command.*;
* under src/gram/script and then use maven openwire:generate to regenerate * under src/gram/script and then use maven openwire:generate to regenerate
* this file. * this file.
* *
* @version $Revision: $ * @version $Revision$
*/ */
public class WireFormatInfoTest extends DataFileGeneratorTestSupport { public class WireFormatInfoTest extends DataFileGeneratorTestSupport {
@ -52,9 +52,10 @@ public class WireFormatInfoTest extends DataFileGeneratorTestSupport {
WireFormatInfo info = (WireFormatInfo) object; WireFormatInfo info = (WireFormatInfo) object;
info.setVersion(1); info.setVersion(1);
info.setCacheEnabled(true); info.setCacheEnabled(true);
info.setCompressionEnabled(false); info.setStackTraceEnabled(false);
info.setStackTraceEnabled(true); info.setTcpNoDelayEnabled(true);
info.setTcpNoDelayEnabled(false); info.setPrefixPacketSize(false);
info.setTightEncodingEnabled(true);
} }
} }

View File

@ -381,6 +381,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -407,6 +408,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -432,6 +434,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -458,6 +461,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -484,6 +488,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -509,6 +514,7 @@
INSTALL_PATH = /usr/local/lib; INSTALL_PATH = /usr/local/lib;
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\""; LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../apr/lib\"";
LIBRARY_STYLE = DYNAMIC; LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
OPTIMIZATION_CFLAGS = "-O0"; OPTIMIZATION_CFLAGS = "-O0";
OTHER_CFLAGS = ""; OTHER_CFLAGS = "";
OTHER_LDFLAGS = ""; OTHER_LDFLAGS = "";
@ -630,6 +636,7 @@
53C445C808E4A3CB006387E9 /* Default */, 53C445C808E4A3CB006387E9 /* Default */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Default;
}; };
53C445D708E4A6F4006387E9 /* Build configuration list for PBXNativeTarget "activemq" */ = { 53C445D708E4A6F4006387E9 /* Build configuration list for PBXNativeTarget "activemq" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
@ -639,6 +646,7 @@
53C445DA08E4A6F4006387E9 /* Default */, 53C445DA08E4A6F4006387E9 /* Default */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Default;
}; };
53C445DB08E4A6F4006387E9 /* Build configuration list for PBXNativeTarget "main" */ = { 53C445DB08E4A6F4006387E9 /* Build configuration list for PBXNativeTarget "main" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
@ -648,6 +656,7 @@
53C445DE08E4A6F4006387E9 /* Default */, 53C445DE08E4A6F4006387E9 /* Default */,
); );
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Default;
}; };
53D4A41D08A8931000CAE09B /* Build configuration list for PBXProject "openwire" */ = { 53D4A41D08A8931000CAE09B /* Build configuration list for PBXProject "openwire" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;

View File

@ -94,23 +94,27 @@ ow_ConnectionId *create_ConnectionId(amqcs_connection *connection, apr_pool_t *p
); );
rc = ow_ConnectionId_create(pool); rc = ow_ConnectionId_create(pool);
rc->connectionId = ow_string_create_from_cstring(pool, buff); rc->value = ow_string_create_from_cstring(pool, buff);
return rc; return rc;
} }
ow_ProducerId *create_ProducerId(amqcs_connection *connection, apr_pool_t *pool) { ow_ProducerId *create_ProducerId(amqcs_connection *connection, apr_pool_t *pool) {
ow_ProducerId *rc; ow_ProducerId *rc;
rc = ow_ProducerId_create(pool); rc = ow_ProducerId_create(pool);
rc->connectionId = connection->info->connectionId->connectionId; rc->connectionId = connection->info->connectionId->value;
rc->sessionId = -1; rc->sessionId = -1;
rc->producerId = 1; rc->value = 1;
return rc; return rc;
} }
ow_WireFormatInfo *create_WireFormatInfo(apr_pool_t *pool) { ow_WireFormatInfo *create_WireFormatInfo(apr_pool_t *pool) {
ow_WireFormatInfo *info = ow_WireFormatInfo_create(pool); ow_WireFormatInfo *info = ow_WireFormatInfo_create(pool);
info->version = OW_WIREFORMAT_VERSION; info->version = OW_WIREFORMAT_VERSION;
info->options = 0; info->cacheEnabled = 0;
info->prefixPacketSize = 1;
info->tightEncodingEnabled = 1;
info->stackTraceEnabled = 0;
info->tcpNoDelayEnabled = 0;
info->magic = ow_byte_array_create_with_data(pool, 8, ACTIVEMQ_MAGIC); info->magic = ow_byte_array_create_with_data(pool, 8, ACTIVEMQ_MAGIC);
return info; return info;
} }
@ -165,6 +169,9 @@ apr_status_t amqcs_connect(amqcs_connection **conn, amqcs_connect_options *optio
connection->info->connectionId = create_ConnectionId(connection, pool); connection->info->connectionId = create_ConnectionId(connection, pool);
if( strlen(options->clientId)>0 ) { if( strlen(options->clientId)>0 ) {
connection->info->clientId = ow_string_create_from_cstring(pool, options->clientId); connection->info->clientId = ow_string_create_from_cstring(pool, options->clientId);
} else {
strncpy(options->clientId, connection->info->connectionId->value, sizeof(options->clientId));
connection->info->clientId = connection->info->connectionId->value;
} }
if( strlen(options->userId)>0 ) { if( strlen(options->userId)>0 ) {
connection->info->userName = ow_string_create_from_cstring(pool, options->userId); connection->info->userName = ow_string_create_from_cstring(pool, options->userId);

View File

@ -44,6 +44,7 @@ extern "C" {
#define OW_REDELIVERYPOLICY_TYPE 13 #define OW_REDELIVERYPOLICY_TYPE 13
#define OW_CONTROLCOMMAND_TYPE 14 #define OW_CONTROLCOMMAND_TYPE 14
#define OW_FLUSHCOMMAND_TYPE 15 #define OW_FLUSHCOMMAND_TYPE 15
#define OW_CONNECTIONERROR_TYPE 16
#define OW_MESSAGEDISPATCH_TYPE 21 #define OW_MESSAGEDISPATCH_TYPE 21
#define OW_MESSAGEACK_TYPE 22 #define OW_MESSAGEACK_TYPE 22
@ -61,6 +62,8 @@ extern "C" {
#define OW_DATAARRAYRESPONSE_TYPE 33 #define OW_DATAARRAYRESPONSE_TYPE 33
#define OW_INTEGERRESPONSE_TYPE 34 #define OW_INTEGERRESPONSE_TYPE 34
#define OW_DISCOVERYEVENT_TYPE 40
#define OW_JOURNALTOPICACK_TYPE 50 #define OW_JOURNALTOPICACK_TYPE 50
#define OW_JOURNALADD_TYPE 51 #define OW_JOURNALADD_TYPE 51
#define OW_JOURNALQUEUEACK_TYPE 52 #define OW_JOURNALQUEUEACK_TYPE 52
@ -79,6 +82,7 @@ extern "C" {
#define OW_BOOLEAN_TYPE 78 #define OW_BOOLEAN_TYPE 78
#define OW_BYTE_ARRAY_TYPE 79 #define OW_BYTE_ARRAY_TYPE 79
#define OW_MESSAGEDISPATCHNOTIFICATION_TYPE 90
#define OW_ACTIVEMQQUEUE_TYPE 100 #define OW_ACTIVEMQQUEUE_TYPE 100
#define OW_ACTIVEMQTOPIC_TYPE 101 #define OW_ACTIVEMQTOPIC_TYPE 101

View File

@ -669,7 +669,7 @@ ow_JournalQueueAck *ow_JournalQueueAck_create(apr_pool_t *pool)
apr_status_t ow_marshal1_JournalQueueAck(ow_bit_buffer *buffer, ow_JournalQueueAck *object) apr_status_t ow_marshal1_JournalQueueAck(ow_bit_buffer *buffer, ow_JournalQueueAck *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->destination)); SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->destination));
SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->messageAck)); SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->messageAck));
@ -677,7 +677,7 @@ apr_status_t ow_marshal1_JournalQueueAck(ow_bit_buffer *buffer, ow_JournalQueueA
} }
apr_status_t ow_marshal2_JournalQueueAck(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalQueueAck *object) apr_status_t ow_marshal2_JournalQueueAck(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalQueueAck *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->destination)); SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->destination));
SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->messageAck)); SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->messageAck));
@ -686,7 +686,7 @@ apr_status_t ow_marshal2_JournalQueueAck(ow_byte_buffer *buffer, ow_bit_buffer *
apr_status_t ow_unmarshal_JournalQueueAck(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalQueueAck *object, apr_pool_t *pool) apr_status_t ow_unmarshal_JournalQueueAck(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalQueueAck *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->destination, pool)); SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->destination, pool));
SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->messageAck, pool)); SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->messageAck, pool));
@ -721,9 +721,10 @@ apr_status_t ow_marshal1_WireFormatInfo(ow_bit_buffer *buffer, ow_WireFormatInfo
ow_bit_buffer_append(buffer, object->cacheEnabled); ow_bit_buffer_append(buffer, object->cacheEnabled);
ow_bit_buffer_append(buffer, object->compressionEnabled);
ow_bit_buffer_append(buffer, object->stackTraceEnabled); ow_bit_buffer_append(buffer, object->stackTraceEnabled);
ow_bit_buffer_append(buffer, object->tcpNoDelayEnabled); ow_bit_buffer_append(buffer, object->tcpNoDelayEnabled);
ow_bit_buffer_append(buffer, object->prefixPacketSize);
ow_bit_buffer_append(buffer, object->tightEncodingEnabled);
return APR_SUCCESS; return APR_SUCCESS;
} }
@ -735,6 +736,7 @@ apr_status_t ow_marshal2_WireFormatInfo(ow_byte_buffer *buffer, ow_bit_buffer *b
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
ow_bit_buffer_read(bitbuffer);
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
return APR_SUCCESS; return APR_SUCCESS;
@ -746,9 +748,10 @@ apr_status_t ow_unmarshal_WireFormatInfo(ow_byte_array *buffer, ow_bit_buffer *b
SUCCESS_CHECK(ow_unmarshal_byte_array_const_size(buffer, &object->magic, 8, pool)); SUCCESS_CHECK(ow_unmarshal_byte_array_const_size(buffer, &object->magic, 8, pool));
SUCCESS_CHECK(ow_byte_array_read_int(buffer, &object->version)); SUCCESS_CHECK(ow_byte_array_read_int(buffer, &object->version));
object->cacheEnabled = ow_bit_buffer_read(bitbuffer); object->cacheEnabled = ow_bit_buffer_read(bitbuffer);
object->compressionEnabled = ow_bit_buffer_read(bitbuffer);
object->stackTraceEnabled = ow_bit_buffer_read(bitbuffer); object->stackTraceEnabled = ow_bit_buffer_read(bitbuffer);
object->tcpNoDelayEnabled = ow_bit_buffer_read(bitbuffer); object->tcpNoDelayEnabled = ow_bit_buffer_read(bitbuffer);
object->prefixPacketSize = ow_bit_buffer_read(bitbuffer);
object->tightEncodingEnabled = ow_bit_buffer_read(bitbuffer);
return APR_SUCCESS; return APR_SUCCESS;
} }
@ -1222,20 +1225,20 @@ ow_KeepAliveInfo *ow_KeepAliveInfo_create(apr_pool_t *pool)
apr_status_t ow_marshal1_KeepAliveInfo(ow_bit_buffer *buffer, ow_KeepAliveInfo *object) apr_status_t ow_marshal1_KeepAliveInfo(ow_bit_buffer *buffer, ow_KeepAliveInfo *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
return APR_SUCCESS; return APR_SUCCESS;
} }
apr_status_t ow_marshal2_KeepAliveInfo(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object) apr_status_t ow_marshal2_KeepAliveInfo(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
return APR_SUCCESS; return APR_SUCCESS;
} }
apr_status_t ow_unmarshal_KeepAliveInfo(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object, apr_pool_t *pool) apr_status_t ow_unmarshal_KeepAliveInfo(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_KeepAliveInfo *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
return APR_SUCCESS; return APR_SUCCESS;
} }
@ -1396,7 +1399,7 @@ ow_boolean ow_is_a_BaseCommand(ow_DataStructure *object) {
apr_status_t ow_marshal1_BaseCommand(ow_bit_buffer *buffer, ow_BaseCommand *object) apr_status_t ow_marshal1_BaseCommand(ow_bit_buffer *buffer, ow_BaseCommand *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
ow_bit_buffer_append(buffer, object->responseRequired); ow_bit_buffer_append(buffer, object->responseRequired);
@ -1404,7 +1407,7 @@ apr_status_t ow_marshal1_BaseCommand(ow_bit_buffer *buffer, ow_BaseCommand *obje
} }
apr_status_t ow_marshal2_BaseCommand(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_BaseCommand *object) apr_status_t ow_marshal2_BaseCommand(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_BaseCommand *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_byte_buffer_append_short(buffer, object->commandId)); SUCCESS_CHECK(ow_byte_buffer_append_short(buffer, object->commandId));
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
@ -1413,7 +1416,7 @@ apr_status_t ow_marshal2_BaseCommand(ow_byte_buffer *buffer, ow_bit_buffer *bitb
apr_status_t ow_unmarshal_BaseCommand(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_BaseCommand *object, apr_pool_t *pool) apr_status_t ow_unmarshal_BaseCommand(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_BaseCommand *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_byte_array_read_short(buffer, &object->commandId)); SUCCESS_CHECK(ow_byte_array_read_short(buffer, &object->commandId));
object->responseRequired = ow_bit_buffer_read(bitbuffer); object->responseRequired = ow_bit_buffer_read(bitbuffer);
@ -1499,14 +1502,14 @@ ow_JournalTrace *ow_JournalTrace_create(apr_pool_t *pool)
apr_status_t ow_marshal1_JournalTrace(ow_bit_buffer *buffer, ow_JournalTrace *object) apr_status_t ow_marshal1_JournalTrace(ow_bit_buffer *buffer, ow_JournalTrace *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
ow_marshal1_string(buffer, object->message); ow_marshal1_string(buffer, object->message);
return APR_SUCCESS; return APR_SUCCESS;
} }
apr_status_t ow_marshal2_JournalTrace(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTrace *object) apr_status_t ow_marshal2_JournalTrace(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTrace *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal2_string(buffer, bitbuffer, object->message)); SUCCESS_CHECK(ow_marshal2_string(buffer, bitbuffer, object->message));
return APR_SUCCESS; return APR_SUCCESS;
@ -1514,7 +1517,7 @@ apr_status_t ow_marshal2_JournalTrace(ow_byte_buffer *buffer, ow_bit_buffer *bit
apr_status_t ow_unmarshal_JournalTrace(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTrace *object, apr_pool_t *pool) apr_status_t ow_unmarshal_JournalTrace(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTrace *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_unmarshal_string(buffer, bitbuffer, &object->message, pool)); SUCCESS_CHECK(ow_unmarshal_string(buffer, bitbuffer, &object->message, pool));
return APR_SUCCESS; return APR_SUCCESS;
@ -1670,7 +1673,7 @@ ow_JournalTopicAck *ow_JournalTopicAck_create(apr_pool_t *pool)
apr_status_t ow_marshal1_JournalTopicAck(ow_bit_buffer *buffer, ow_JournalTopicAck *object) apr_status_t ow_marshal1_JournalTopicAck(ow_bit_buffer *buffer, ow_JournalTopicAck *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->destination)); SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->destination));
SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->messageId)); SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->messageId));
ow_marshal1_long(buffer, object->messageSequenceId); ow_marshal1_long(buffer, object->messageSequenceId);
@ -1682,7 +1685,7 @@ apr_status_t ow_marshal1_JournalTopicAck(ow_bit_buffer *buffer, ow_JournalTopicA
} }
apr_status_t ow_marshal2_JournalTopicAck(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTopicAck *object) apr_status_t ow_marshal2_JournalTopicAck(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTopicAck *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->destination)); SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->destination));
SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->messageId)); SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->messageId));
SUCCESS_CHECK(ow_marshal2_long(buffer, bitbuffer, object->messageSequenceId)); SUCCESS_CHECK(ow_marshal2_long(buffer, bitbuffer, object->messageSequenceId));
@ -1695,7 +1698,7 @@ apr_status_t ow_marshal2_JournalTopicAck(ow_byte_buffer *buffer, ow_bit_buffer *
apr_status_t ow_unmarshal_JournalTopicAck(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTopicAck *object, apr_pool_t *pool) apr_status_t ow_unmarshal_JournalTopicAck(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTopicAck *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->destination, pool)); SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->destination, pool));
SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->messageId, pool)); SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->messageId, pool));
SUCCESS_CHECK(ow_unmarshal_long(buffer, bitbuffer, &object->messageSequenceId, pool)); SUCCESS_CHECK(ow_unmarshal_long(buffer, bitbuffer, &object->messageSequenceId, pool));
@ -2250,14 +2253,14 @@ ow_boolean ow_is_a_ActiveMQDestination(ow_DataStructure *object) {
apr_status_t ow_marshal1_ActiveMQDestination(ow_bit_buffer *buffer, ow_ActiveMQDestination *object) apr_status_t ow_marshal1_ActiveMQDestination(ow_bit_buffer *buffer, ow_ActiveMQDestination *object)
{ {
ow_marshal1_JNDIBaseStorable(buffer, (ow_JNDIBaseStorable*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
ow_marshal1_string(buffer, object->physicalName); ow_marshal1_string(buffer, object->physicalName);
return APR_SUCCESS; return APR_SUCCESS;
} }
apr_status_t ow_marshal2_ActiveMQDestination(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_ActiveMQDestination *object) apr_status_t ow_marshal2_ActiveMQDestination(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_ActiveMQDestination *object)
{ {
ow_marshal2_JNDIBaseStorable(buffer, bitbuffer, (ow_JNDIBaseStorable*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal2_string(buffer, bitbuffer, object->physicalName)); SUCCESS_CHECK(ow_marshal2_string(buffer, bitbuffer, object->physicalName));
return APR_SUCCESS; return APR_SUCCESS;
@ -2265,7 +2268,7 @@ apr_status_t ow_marshal2_ActiveMQDestination(ow_byte_buffer *buffer, ow_bit_buff
apr_status_t ow_unmarshal_ActiveMQDestination(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_ActiveMQDestination *object, apr_pool_t *pool) apr_status_t ow_unmarshal_ActiveMQDestination(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_ActiveMQDestination *object, apr_pool_t *pool)
{ {
ow_unmarshal_JNDIBaseStorable(buffer, bitbuffer, (ow_JNDIBaseStorable*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_unmarshal_string(buffer, bitbuffer, &object->physicalName, pool)); SUCCESS_CHECK(ow_unmarshal_string(buffer, bitbuffer, &object->physicalName, pool));
return APR_SUCCESS; return APR_SUCCESS;
@ -2451,7 +2454,7 @@ ow_JournalTransaction *ow_JournalTransaction_create(apr_pool_t *pool)
apr_status_t ow_marshal1_JournalTransaction(ow_bit_buffer *buffer, ow_JournalTransaction *object) apr_status_t ow_marshal1_JournalTransaction(ow_bit_buffer *buffer, ow_JournalTransaction *object)
{ {
ow_marshal1_DataStructureSupport(buffer, (ow_DataStructureSupport*)object); ow_marshal1_DataStructure(buffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->transactionId)); SUCCESS_CHECK(ow_marshal1_nested_object(buffer, (ow_DataStructure*)object->transactionId));
ow_bit_buffer_append(buffer, object->wasPrepared); ow_bit_buffer_append(buffer, object->wasPrepared);
@ -2460,7 +2463,7 @@ apr_status_t ow_marshal1_JournalTransaction(ow_bit_buffer *buffer, ow_JournalTra
} }
apr_status_t ow_marshal2_JournalTransaction(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTransaction *object) apr_status_t ow_marshal2_JournalTransaction(ow_byte_buffer *buffer, ow_bit_buffer *bitbuffer, ow_JournalTransaction *object)
{ {
ow_marshal2_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object); ow_marshal2_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object);
SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->transactionId)); SUCCESS_CHECK(ow_marshal2_nested_object(buffer, bitbuffer, (ow_DataStructure*)object->transactionId));
SUCCESS_CHECK(ow_byte_buffer_append_byte(buffer, object->type)); SUCCESS_CHECK(ow_byte_buffer_append_byte(buffer, object->type));
ow_bit_buffer_read(bitbuffer); ow_bit_buffer_read(bitbuffer);
@ -2470,7 +2473,7 @@ apr_status_t ow_marshal2_JournalTransaction(ow_byte_buffer *buffer, ow_bit_buffe
apr_status_t ow_unmarshal_JournalTransaction(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTransaction *object, apr_pool_t *pool) apr_status_t ow_unmarshal_JournalTransaction(ow_byte_array *buffer, ow_bit_buffer *bitbuffer, ow_JournalTransaction *object, apr_pool_t *pool)
{ {
ow_unmarshal_DataStructureSupport(buffer, bitbuffer, (ow_DataStructureSupport*)object, pool); ow_unmarshal_DataStructure(buffer, bitbuffer, (ow_DataStructure*)object, pool);
SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->transactionId, pool)); SUCCESS_CHECK(ow_unmarshal_nested_object(buffer, bitbuffer, (ow_DataStructure**)&object->transactionId, pool));
SUCCESS_CHECK(ow_byte_array_read_byte(buffer, &object->type)); SUCCESS_CHECK(ow_byte_array_read_byte(buffer, &object->type));
object->wasPrepared = ow_bit_buffer_read(bitbuffer); object->wasPrepared = ow_bit_buffer_read(bitbuffer);

View File

@ -228,9 +228,10 @@ typedef struct ow_WireFormatInfo {
ow_byte_array *magic; ow_byte_array *magic;
ow_int version; ow_int version;
ow_boolean cacheEnabled; ow_boolean cacheEnabled;
ow_boolean compressionEnabled;
ow_boolean stackTraceEnabled; ow_boolean stackTraceEnabled;
ow_boolean tcpNoDelayEnabled; ow_boolean tcpNoDelayEnabled;
ow_boolean prefixPacketSize;
ow_boolean tightEncodingEnabled;
} ow_WireFormatInfo; } ow_WireFormatInfo;
ow_WireFormatInfo *ow_WireFormatInfo_create(apr_pool_t *pool); ow_WireFormatInfo *ow_WireFormatInfo_create(apr_pool_t *pool);

View File

@ -1,47 +1,49 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/BrokerId.hpp" #include "command/BrokerId.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::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() BrokerId::BrokerId()
{ {
value = new string() ; this->value = NULL ;
} }
BrokerId::~BrokerId() BrokerId::~BrokerId()
{ {
// no-op
} }
int BrokerId::getCommandType()
{
return BrokerId::TYPE ;
}
p<string> BrokerId::getValue() p<string> BrokerId::getValue()
{ {
return value ; return value ;
} }
void BrokerId::setValue(const char* brokerId) void BrokerId::setValue(p<string> value)
{ {
this->value->assign( brokerId ) ; this->value = value ;
} }

View File

@ -1,23 +1,32 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef BrokerId_hpp_ #ifndef BrokerId_hpp_
#define BrokerId_hpp_ #define BrokerId_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/AbstractCommand.hpp" #include "command/AbstractCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
@ -30,9 +39,16 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std ; using namespace apache::activemq::client;
/* /*
*
* 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 class BrokerId : public AbstractCommand
@ -41,15 +57,17 @@ private:
p<string> value ; p<string> value ;
public: public:
const static char TYPE = 124 ; const static int TYPE = 124;
public: public:
BrokerId() ; BrokerId() ;
virtual ~BrokerId() ; virtual ~BrokerId() ;
virtual int getCommandType() ;
virtual p<string> getValue() ; virtual p<string> getValue() ;
virtual void setValue(const char* brokerId) ; virtual void setValue(p<string> value) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,53 +1,46 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/BrokerInfo.hpp" #include "command/BrokerInfo.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::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() BrokerInfo::BrokerInfo()
{ {
brokerId = NULL ; this->brokerId = NULL ;
brokerURL = new string() ; this->brokerURL = NULL ;
brokerName = new string() ; this->peerBrokerInfos = NULL ;
peerInfos = NULL ; this->brokerName = NULL ;
this->slaveBroker = NULL ;
} }
BrokerInfo::~BrokerInfo() BrokerInfo::~BrokerInfo()
{ {
// no-op
} }
int BrokerInfo::getCommandType()
{
return BrokerInfo::TYPE ;
}
p<string> BrokerInfo::getBrokerName()
{
return brokerName ;
}
void BrokerInfo::setBrokerName(const char* name)
{
brokerName->assign(name) ;
}
p<BrokerId> BrokerInfo::getBrokerId() p<BrokerId> BrokerInfo::getBrokerId()
{ {
@ -59,22 +52,46 @@ void BrokerInfo::setBrokerId(p<BrokerId> brokerId)
this->brokerId = brokerId ; this->brokerId = brokerId ;
} }
p<string> BrokerInfo::getBrokerURL() p<string> BrokerInfo::getBrokerURL()
{ {
return brokerURL ; return brokerURL ;
} }
void BrokerInfo::setBrokerURL(const char* url) void BrokerInfo::setBrokerURL(p<string> brokerURL)
{ {
this->brokerURL->assign(url) ; this->brokerURL = brokerURL ;
} }
ap<BrokerInfo> BrokerInfo::getPeerBrokerInfo()
BrokerInfo[] BrokerInfo::getPeerBrokerInfos()
{ {
return peerInfos ; return peerBrokerInfos ;
} }
void BrokerInfo::setPeerBrokerInfo(ap<BrokerInfo> info) void BrokerInfo::setPeerBrokerInfos(BrokerInfo[] peerBrokerInfos)
{ {
peerInfos = info ; this->peerBrokerInfos = peerBrokerInfos ;
}
p<string> BrokerInfo::getBrokerName()
{
return brokerName ;
}
void BrokerInfo::setBrokerName(p<string> brokerName)
{
this->brokerName = brokerName ;
}
bool BrokerInfo::getSlaveBroker()
{
return slaveBroker ;
}
void BrokerInfo::setSlaveBroker(bool slaveBroker)
{
this->slaveBroker = slaveBroker ;
} }

View File

@ -1,26 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef BrokerInfo_hpp_ #ifndef BrokerInfo_hpp_
#define BrokerInfo_hpp_ #define BrokerInfo_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp" #include "command/BrokerId.hpp"
#include "util/ifr/ap" #include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -32,35 +39,51 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std; using namespace apache::activemq::client;
/* /*
*
* 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 class BrokerInfo : public BaseCommand
{ {
private: private:
p<BrokerId> brokerId ; p<BrokerId> brokerId ;
p<string> brokerURL, p<string> brokerURL ;
brokerName ; BrokerInfo[] peerBrokerInfos ;
ap<BrokerInfo> peerInfos ; p<string> brokerName ;
bool slaveBroker ;
public: public:
const static char TYPE = 2 ; const static int TYPE = 2;
public: public:
BrokerInfo() ; BrokerInfo() ;
virtual ~BrokerInfo() ; virtual ~BrokerInfo() ;
virtual int getCommandType() ;
virtual p<string> getBrokerName() ;
virtual void setBrokerName(const char* name) ;
virtual p<BrokerId> getBrokerId() ; virtual p<BrokerId> getBrokerId() ;
virtual void setBrokerId(p<BrokerId> id) ; virtual void setBrokerId(p<BrokerId> brokerId) ;
virtual p<string> getBrokerURL() ; virtual p<string> getBrokerURL() ;
virtual void setBrokerURL(const char* url) ; virtual void setBrokerURL(p<string> brokerURL) ;
virtual ap<BrokerInfo> getPeerBrokerInfo() ;
virtual void setPeerBrokerInfo(ap<BrokerInfo> info) ; virtual BrokerInfo[] getPeerBrokerInfos() ;
virtual void setPeerBrokerInfos(BrokerInfo[] peerBrokerInfos) ;
virtual p<string> getBrokerName() ;
virtual void setBrokerName(p<string> brokerName) ;
virtual bool getSlaveBroker() ;
virtual void setSlaveBroker(bool slaveBroker) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,46 +1,49 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ConnectionId.hpp" #include "command/ConnectionId.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ConnectionId::ConnectionId()
{ {
value = new string() ; this->value = NULL ;
} }
ConnectionId::~ConnectionId() ConnectionId::~ConnectionId()
{ {
} }
int ConnectionId::getCommandType()
{
return ConnectionId::TYPE ;
}
void ConnectionId::setValue(const char* value)
{
this->value->assign(value) ;
}
p<string> ConnectionId::getValue() p<string> ConnectionId::getValue()
{ {
return value ; return value ;
} }
void ConnectionId::setValue(p<string> value)
{
this->value = value ;
}

View File

@ -1,23 +1,32 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ConnectionId_hpp_ #ifndef ConnectionId_hpp_
#define ConnectionId_hpp_ #define ConnectionId_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/AbstractCommand.hpp" #include "command/AbstractCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
@ -30,25 +39,35 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std; using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ConnectionId : public AbstractCommand
{ {
private: private:
p<string> value ; p<string> value ;
const static int TYPE = 120 ; public:
const static int TYPE = 120;
public: public:
ConnectionId() ; ConnectionId() ;
virtual ~ConnectionId() ; virtual ~ConnectionId() ;
virtual int getCommandType() ;
virtual void setValue(const char* value) ;
virtual p<string> getValue() ; virtual p<string> getValue() ;
virtual void setValue(p<string> value) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,39 +1,47 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ConnectionInfo.hpp" #include "command/ConnectionInfo.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ConnectionInfo::ConnectionInfo()
{ {
connectionId = NULL ; this->connectionId = NULL ;
brokerPath = NULL ; this->clientId = NULL ;
username = new string() ; this->password = NULL ;
password = new string() ; this->userName = NULL ;
clientId = new string() ; this->brokerPath = NULL ;
} }
ConnectionInfo::~ConnectionInfo() ConnectionInfo::~ConnectionInfo()
{ {
} }
p<ConnectionId> ConnectionInfo::getConnectionId() p<ConnectionId> ConnectionInfo::getConnectionId()
{ {
return connectionId ; return connectionId ;
@ -44,42 +52,46 @@ void ConnectionInfo::setConnectionId(p<ConnectionId> connectionId)
this->connectionId = connectionId ; this->connectionId = connectionId ;
} }
p<string> ConnectionInfo::getUsername()
{
return this->username ;
}
void ConnectionInfo::setUsername(const char* username)
{
this->username->assign( username ) ;
}
p<string> ConnectionInfo::getPassword()
{
return this->password ;
}
void ConnectionInfo::setPassword(const char* password)
{
this->password->assign( password ) ;
}
p<string> ConnectionInfo::getClientId() p<string> ConnectionInfo::getClientId()
{ {
return this->clientId ; return clientId ;
} }
void ConnectionInfo::setClientId(const char* clientId) void ConnectionInfo::setClientId(p<string> clientId)
{ {
this->clientId->assign( clientId ) ; this->clientId = clientId ;
} }
p<BrokerId*> ConnectionInfo::getBrokerPath()
p<string> ConnectionInfo::getPassword()
{ {
return this->brokerPath ; return password ;
} }
void ConnectionInfo::setBrokerPath(p<BrokerId*> brokerPath) void ConnectionInfo::setPassword(p<string> password)
{
this->password = password ;
}
p<string> ConnectionInfo::getUserName()
{
return userName ;
}
void ConnectionInfo::setUserName(p<string> userName)
{
this->userName = userName ;
}
BrokerId[] ConnectionInfo::getBrokerPath()
{
return brokerPath ;
}
void ConnectionInfo::setBrokerPath(BrokerId[] brokerPath)
{ {
this->brokerPath = brokerPath ; this->brokerPath = brokerPath ;
} }

View File

@ -1,26 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ConnectionInfo_hpp_ #ifndef ConnectionInfo_hpp_
#define ConnectionInfo_hpp_ #define ConnectionInfo_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp" #include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp" #include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -32,36 +39,51 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std; using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ConnectionInfo : public BaseCommand
{ {
private: private:
p<ConnectionId> connectionId ; p<ConnectionId> connectionId ;
p<BrokerId*> brokerPath ; p<string> clientId ;
p<string> username, p<string> password ;
password, p<string> userName ;
clientId ; BrokerId[] brokerPath ;
public: public:
const static int TYPE = 3 ; const static int TYPE = 3;
public: public:
ConnectionInfo() ; ConnectionInfo() ;
virtual ~ConnectionInfo() ; virtual ~ConnectionInfo() ;
virtual p<ConnectionId> getConnectionId() ; virtual p<ConnectionId> getConnectionId() ;
virtual void setConnectionId(p<ConnectionId> connectionId) ; virtual void setConnectionId(p<ConnectionId> connectionId) ;
virtual p<string> getUsername() ;
virtual void setUsername(const char* username) ;
virtual p<string> getPassword() ;
virtual void setPassword(const char* password) ;
virtual p<string> getClientId() ; virtual p<string> getClientId() ;
virtual void setClientId(const char* clientId) ; virtual void setClientId(p<string> clientId) ;
virtual p<BrokerId*> getBrokerPath() ;
virtual void setBrokerPath(p<BrokerId*> brokerPath) ; virtual p<string> getPassword() ;
virtual void setPassword(p<string> password) ;
virtual p<string> getUserName() ;
virtual void setUserName(p<string> userName) ;
virtual BrokerId[] getBrokerPath() ;
virtual void setBrokerPath(BrokerId[] brokerPath) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,48 +1,59 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ConsumerId.hpp" #include "command/ConsumerId.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ConsumerId::ConsumerId()
{ {
connectionId = new string() ; this->connectionId = NULL ;
this->sessionId = NULL ;
this->value = NULL ;
} }
ConsumerId::~ConsumerId() ConsumerId::~ConsumerId()
{ {
} }
int ConsumerId::getCommandType()
p<string> ConsumerId::getConnectionId()
{ {
return ConsumerId::TYPE ; return connectionId ;
} }
void ConsumerId::setValue(long consumerId) void ConsumerId::setConnectionId(p<string> connectionId)
{ {
this->consumerId = consumerId ; this->connectionId = connectionId ;
} }
long ConsumerId::getValue()
long ConsumerId::getSessionId()
{ {
return consumerId ; return sessionId ;
} }
void ConsumerId::setSessionId(long sessionId) void ConsumerId::setSessionId(long sessionId)
@ -50,17 +61,13 @@ void ConsumerId::setSessionId(long sessionId)
this->sessionId = sessionId ; this->sessionId = sessionId ;
} }
long ConsumerId::getSessionId()
long ConsumerId::getValue()
{ {
return sessionId ; return value ;
} }
void ConsumerId::setConnectionId(const char* connectionId) void ConsumerId::setValue(long value)
{ {
this->connectionId->assign( connectionId ) ; this->value = value ;
}
p<string> ConsumerId::getConnectionId()
{
return connectionId ;
} }

View File

@ -1,23 +1,32 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ConsumerId_hpp_ #ifndef ConsumerId_hpp_
#define ConsumerId_hpp_ #define ConsumerId_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/AbstractCommand.hpp" #include "command/AbstractCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
@ -30,31 +39,43 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std; using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ConsumerId : public AbstractCommand
{ {
private: private:
p<string> connectionId ; p<string> connectionId ;
long sessionId, long sessionId ;
consumerId ; long value ;
const static int TYPE = 122 ; public:
const static int TYPE = 122;
public: public:
ConsumerId() ; ConsumerId() ;
virtual ~ConsumerId() ; virtual ~ConsumerId() ;
virtual int getCommandType() ;
virtual void setValue(long consumerId) ;
virtual long getValue() ;
virtual void setSessionId(long sessionId) ;
virtual long getSessionId() ;
virtual void setConnectionId(const char* connectionId) ;
virtual p<string> getConnectionId() ; virtual p<string> getConnectionId() ;
virtual void setConnectionId(p<string> connectionId) ;
virtual long getSessionId() ;
virtual void setSessionId(long sessionId) ;
virtual long getValue() ;
virtual void setValue(long value) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,40 +1,55 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ConsumerInfo.hpp" #include "command/ConsumerInfo.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ConsumerInfo::ConsumerInfo()
{ {
consumerId = NULL ; this->consumerId = NULL ;
} this->browser = NULL ;
this->destination = NULL ;
ConsumerInfo::ConsumerInfo(const char* name) this->prefetchSize = NULL ;
{ this->dispatchAsync = NULL ;
consumerId = NULL ; this->selector = NULL ;
this->subcriptionName = NULL ;
this->noLocal = NULL ;
this->exclusive = NULL ;
this->retroactive = NULL ;
this->priority = NULL ;
this->brokerPath = NULL ;
this->networkSubscription = NULL ;
} }
ConsumerInfo::~ConsumerInfo() ConsumerInfo::~ConsumerInfo()
{ {
} }
p<ConsumerId> ConsumerInfo::getConsumerId() p<ConsumerId> ConsumerInfo::getConsumerId()
{ {
return consumerId ; return consumerId ;
@ -44,3 +59,135 @@ void ConsumerInfo::setConsumerId(p<ConsumerId> consumerId)
{ {
this->consumerId = consumerId ; this->consumerId = consumerId ;
} }
bool ConsumerInfo::getBrowser()
{
return browser ;
}
void ConsumerInfo::setBrowser(bool browser)
{
this->browser = browser ;
}
ActiveMQDestination ConsumerInfo::getDestination()
{
return destination ;
}
void ConsumerInfo::setDestination(ActiveMQDestination 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<string> ConsumerInfo::getSelector()
{
return selector ;
}
void ConsumerInfo::setSelector(p<string> selector)
{
this->selector = selector ;
}
p<string> ConsumerInfo::getSubcriptionName()
{
return subcriptionName ;
}
void ConsumerInfo::setSubcriptionName(p<string> 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 ;
}
byte ConsumerInfo::getPriority()
{
return priority ;
}
void ConsumerInfo::setPriority(byte priority)
{
this->priority = priority ;
}
BrokerId[] ConsumerInfo::getBrokerPath()
{
return brokerPath ;
}
void ConsumerInfo::setBrokerPath(BrokerId[] brokerPath)
{
this->brokerPath = brokerPath ;
}
bool ConsumerInfo::getNetworkSubscription()
{
return networkSubscription ;
}
void ConsumerInfo::setNetworkSubscription(bool networkSubscription)
{
this->networkSubscription = networkSubscription ;
}

View File

@ -1,24 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ConsumerInfo_hpp_ #ifndef ConsumerInfo_hpp_
#define ConsumerInfo_hpp_ #define ConsumerInfo_hpp_
#include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp" #include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -30,25 +39,83 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ConsumerInfo : public BaseCommand
{ {
private: private:
p<ConsumerId> consumerId ; p<ConsumerId> consumerId ;
bool browser ;
ActiveMQDestination destination ;
int prefetchSize ;
bool dispatchAsync ;
p<string> selector ;
p<string> subcriptionName ;
bool noLocal ;
bool exclusive ;
bool retroactive ;
byte priority ;
BrokerId[] brokerPath ;
bool networkSubscription ;
public: public:
const static int TYPE = 5 ; const static int TYPE = 5;
public: public:
ConsumerInfo() ; ConsumerInfo() ;
ConsumerInfo(const char* name) ;
virtual ~ConsumerInfo() ; virtual ~ConsumerInfo() ;
virtual p<ConsumerId> getConsumerId() ; virtual p<ConsumerId> getConsumerId() ;
virtual void setConsumerId(p<ConsumerId> consumerId) ; virtual void setConsumerId(p<ConsumerId> consumerId) ;
virtual bool getBrowser() ;
virtual void setBrowser(bool browser) ;
virtual ActiveMQDestination getDestination() ;
virtual void setDestination(ActiveMQDestination destination) ;
virtual int getPrefetchSize() ;
virtual void setPrefetchSize(int prefetchSize) ;
virtual bool getDispatchAsync() ;
virtual void setDispatchAsync(bool dispatchAsync) ;
virtual p<string> getSelector() ;
virtual void setSelector(p<string> selector) ;
virtual p<string> getSubcriptionName() ;
virtual void setSubcriptionName(p<string> 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 byte getPriority() ;
virtual void setPriority(byte priority) ;
virtual BrokerId[] getBrokerPath() ;
virtual void setBrokerPath(BrokerId[] brokerPath) ;
virtual bool getNetworkSubscription() ;
virtual void setNetworkSubscription(bool networkSubscription) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,45 +1,49 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ExceptionResponse.hpp" #include "command/ExceptionResponse.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::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() ExceptionResponse::ExceptionResponse()
{ {
this->exception = NULL ;
} }
ExceptionResponse::~ExceptionResponse() ExceptionResponse::~ExceptionResponse()
{ {
} }
int ExceptionResponse::getCommandType()
{
return ExceptionResponse::TYPE ;
}
p<BrokerError> ExceptionResponse::getException() BrokerError ExceptionResponse::getException()
{ {
return exception ; return exception ;
} }
void ExceptionResponse::setException(p<BrokerError> exception) void ExceptionResponse::setException(BrokerError exception)
{ {
this->exception = exception ; this->exception = exception ;
} }

View File

@ -1,23 +1,32 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ExceptionResponse_hpp_ #ifndef ExceptionResponse_hpp_
#define ExceptionResponse_hpp_ #define ExceptionResponse_hpp_
#include "BrokerError.hpp" #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/Response.hpp" #include "command/Response.hpp"
#include "util/ifr/p" #include "util/ifr/p"
@ -33,24 +42,33 @@ namespace apache
using namespace apache::activemq::client; using namespace apache::activemq::client;
/* /*
*
* 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 class ExceptionResponse : public Response
{ {
private: private:
p<BrokerError> exception ; BrokerError exception ;
public: public:
static const int TYPE = 31 ; const static int TYPE = 31;
public: public:
ExceptionResponse() ; ExceptionResponse() ;
~ExceptionResponse() ; virtual ~ExceptionResponse() ;
virtual int getCommandType() ;
p<BrokerError> getException() ; virtual BrokerError getException() ;
void setException(p<BrokerError> exception) ; virtual void setException(BrokerError exception) ;
};
} ;
/* namespace */ /* namespace */
} }

View File

@ -1,40 +1,337 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/Message.hpp" #include "command/Message.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() 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 = NULL ;
this->correlationId = NULL ;
this->persistent = NULL ;
this->expiration = NULL ;
this->priority = NULL ;
this->replyTo = NULL ;
this->timestamp = NULL ;
this->type = NULL ;
this->content = NULL ;
this->marshalledProperties = NULL ;
this->dataStructure = NULL ;
this->targetConsumerId = NULL ;
this->compressed = NULL ;
this->redeliveryCounter = NULL ;
this->brokerPath = NULL ;
this->arrival = NULL ;
this->userID = NULL ;
this->recievedByDFBridge = NULL ;
} }
Message::~Message() Message::~Message()
{ {
} }
p<ActiveMQDestination> Message::getDestination()
p<ProducerId> Message::getProducerId()
{
return producerId ;
}
void Message::setProducerId(p<ProducerId> producerId)
{
this->producerId = producerId ;
}
ActiveMQDestination Message::getDestination()
{ {
return destination ; return destination ;
} }
void Message::setDestination(p<ActiveMQDestination> destination) void Message::setDestination(ActiveMQDestination destination)
{ {
this->destination = destination ; this->destination = destination ;
} }
p<TransactionId> Message::getTransactionId()
{
return transactionId ;
}
void Message::setTransactionId(p<TransactionId> transactionId)
{
this->transactionId = transactionId ;
}
ActiveMQDestination Message::getOriginalDestination()
{
return originalDestination ;
}
void Message::setOriginalDestination(ActiveMQDestination originalDestination)
{
this->originalDestination = originalDestination ;
}
p<MessageId> Message::getMessageId()
{
return messageId ;
}
void Message::setMessageId(p<MessageId> messageId)
{
this->messageId = messageId ;
}
p<TransactionId> Message::getOriginalTransactionId()
{
return originalTransactionId ;
}
void Message::setOriginalTransactionId(p<TransactionId> originalTransactionId)
{
this->originalTransactionId = originalTransactionId ;
}
p<string> Message::getGroupID()
{
return groupID ;
}
void Message::setGroupID(p<string> groupID)
{
this->groupID = groupID ;
}
int Message::getGroupSequence()
{
return groupSequence ;
}
void Message::setGroupSequence(int groupSequence)
{
this->groupSequence = groupSequence ;
}
p<string> Message::getCorrelationId()
{
return correlationId ;
}
void Message::setCorrelationId(p<string> correlationId)
{
this->correlationId = correlationId ;
}
bool Message::getPersistent()
{
return persistent ;
}
void Message::setPersistent(bool persistent)
{
this->persistent = persistent ;
}
long Message::getExpiration()
{
return expiration ;
}
void Message::setExpiration(long expiration)
{
this->expiration = expiration ;
}
byte Message::getPriority()
{
return priority ;
}
void Message::setPriority(byte priority)
{
this->priority = priority ;
}
ActiveMQDestination Message::getReplyTo()
{
return replyTo ;
}
void Message::setReplyTo(ActiveMQDestination replyTo)
{
this->replyTo = replyTo ;
}
long Message::getTimestamp()
{
return timestamp ;
}
void Message::setTimestamp(long timestamp)
{
this->timestamp = timestamp ;
}
p<string> Message::getType()
{
return type ;
}
void Message::setType(p<string> type)
{
this->type = type ;
}
void* Message::getContent()
{
return content ;
}
void Message::setContent(void* content)
{
this->content = content ;
}
void* Message::getMarshalledProperties()
{
return marshalledProperties ;
}
void Message::setMarshalledProperties(void* marshalledProperties)
{
this->marshalledProperties = marshalledProperties ;
}
DataStructure Message::getDataStructure()
{
return dataStructure ;
}
void Message::setDataStructure(DataStructure dataStructure)
{
this->dataStructure = dataStructure ;
}
p<ConsumerId> Message::getTargetConsumerId()
{
return targetConsumerId ;
}
void Message::setTargetConsumerId(p<ConsumerId> 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 ;
}
BrokerId[] Message::getBrokerPath()
{
return brokerPath ;
}
void Message::setBrokerPath(BrokerId[] brokerPath)
{
this->brokerPath = brokerPath ;
}
long Message::getArrival()
{
return arrival ;
}
void Message::setArrival(long arrival)
{
this->arrival = arrival ;
}
p<string> Message::getUserID()
{
return userID ;
}
void Message::setUserID(p<string> userID)
{
this->userID = userID ;
}
bool Message::getRecievedByDFBridge()
{
return recievedByDFBridge ;
}
void Message::setRecievedByDFBridge(bool recievedByDFBridge)
{
this->recievedByDFBridge = recievedByDFBridge ;
}

View File

@ -1,26 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef Message_hpp_ #ifndef Message_hpp_
#define Message_hpp_ #define Message_hpp_
#include <string> #include <string>
#include "IMessage.hpp"
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/ActiveMQDestination.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -32,21 +39,131 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class Message : public BaseCommand
{ {
private: private:
p<ActiveMQDestination> destination ; p<ProducerId> producerId ;
ActiveMQDestination destination ;
p<TransactionId> transactionId ;
ActiveMQDestination originalDestination ;
p<MessageId> messageId ;
p<TransactionId> originalTransactionId ;
p<string> groupID ;
int groupSequence ;
p<string> correlationId ;
bool persistent ;
long expiration ;
byte priority ;
ActiveMQDestination replyTo ;
long timestamp ;
p<string> type ;
void* content ;
void* marshalledProperties ;
DataStructure dataStructure ;
p<ConsumerId> targetConsumerId ;
bool compressed ;
int redeliveryCounter ;
BrokerId[] brokerPath ;
long arrival ;
p<string> userID ;
bool recievedByDFBridge ;
public:
const static int TYPE = 0;
public: public:
Message() ; Message() ;
virtual ~Message() ; virtual ~Message() ;
virtual p<ActiveMQDestination> getDestination() ;
virtual void setDestination(p<ActiveMQDestination> destination) ; virtual p<ProducerId> getProducerId() ;
virtual void setProducerId(p<ProducerId> producerId) ;
virtual ActiveMQDestination getDestination() ;
virtual void setDestination(ActiveMQDestination destination) ;
virtual p<TransactionId> getTransactionId() ;
virtual void setTransactionId(p<TransactionId> transactionId) ;
virtual ActiveMQDestination getOriginalDestination() ;
virtual void setOriginalDestination(ActiveMQDestination originalDestination) ;
virtual p<MessageId> getMessageId() ;
virtual void setMessageId(p<MessageId> messageId) ;
virtual p<TransactionId> getOriginalTransactionId() ;
virtual void setOriginalTransactionId(p<TransactionId> originalTransactionId) ;
virtual p<string> getGroupID() ;
virtual void setGroupID(p<string> groupID) ;
virtual int getGroupSequence() ;
virtual void setGroupSequence(int groupSequence) ;
virtual p<string> getCorrelationId() ;
virtual void setCorrelationId(p<string> correlationId) ;
virtual bool getPersistent() ;
virtual void setPersistent(bool persistent) ;
virtual long getExpiration() ;
virtual void setExpiration(long expiration) ;
virtual byte getPriority() ;
virtual void setPriority(byte priority) ;
virtual ActiveMQDestination getReplyTo() ;
virtual void setReplyTo(ActiveMQDestination replyTo) ;
virtual long getTimestamp() ;
virtual void setTimestamp(long timestamp) ;
virtual p<string> getType() ;
virtual void setType(p<string> type) ;
virtual void* getContent() ;
virtual void setContent(void* content) ;
virtual void* getMarshalledProperties() ;
virtual void setMarshalledProperties(void* marshalledProperties) ;
virtual DataStructure getDataStructure() ;
virtual void setDataStructure(DataStructure dataStructure) ;
virtual p<ConsumerId> getTargetConsumerId() ;
virtual void setTargetConsumerId(p<ConsumerId> targetConsumerId) ;
virtual bool getCompressed() ;
virtual void setCompressed(bool compressed) ;
virtual int getRedeliveryCounter() ;
virtual void setRedeliveryCounter(int redeliveryCounter) ;
virtual BrokerId[] getBrokerPath() ;
virtual void setBrokerPath(BrokerId[] brokerPath) ;
virtual long getArrival() ;
virtual void setArrival(long arrival) ;
virtual p<string> getUserID() ;
virtual void setUserID(p<string> userID) ;
virtual bool getRecievedByDFBridge() ;
virtual void setRecievedByDFBridge(bool recievedByDFBridge) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,30 +1,121 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/MessageAck.hpp" #include "command/MessageAck.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() MessageAck::MessageAck()
{ {
this->destination = NULL ;
this->transactionId = NULL ;
this->consumerId = NULL ;
this->ackType = NULL ;
this->firstMessageId = NULL ;
this->lastMessageId = NULL ;
this->messageCount = NULL ;
} }
MessageAck::~MessageAck() MessageAck::~MessageAck()
{ {
} }
ActiveMQDestination MessageAck::getDestination()
{
return destination ;
}
void MessageAck::setDestination(ActiveMQDestination destination)
{
this->destination = destination ;
}
p<TransactionId> MessageAck::getTransactionId()
{
return transactionId ;
}
void MessageAck::setTransactionId(p<TransactionId> transactionId)
{
this->transactionId = transactionId ;
}
p<ConsumerId> MessageAck::getConsumerId()
{
return consumerId ;
}
void MessageAck::setConsumerId(p<ConsumerId> consumerId)
{
this->consumerId = consumerId ;
}
byte MessageAck::getAckType()
{
return ackType ;
}
void MessageAck::setAckType(byte ackType)
{
this->ackType = ackType ;
}
p<MessageId> MessageAck::getFirstMessageId()
{
return firstMessageId ;
}
void MessageAck::setFirstMessageId(p<MessageId> firstMessageId)
{
this->firstMessageId = firstMessageId ;
}
p<MessageId> MessageAck::getLastMessageId()
{
return lastMessageId ;
}
void MessageAck::setLastMessageId(p<MessageId> lastMessageId)
{
this->lastMessageId = lastMessageId ;
}
int MessageAck::getMessageCount()
{
return messageCount ;
}
void MessageAck::setMessageCount(int messageCount)
{
this->messageCount = messageCount ;
}

View File

@ -1,23 +1,34 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef MessageAck_hpp_ #ifndef MessageAck_hpp_
#define MessageAck_hpp_ #define MessageAck_hpp_
#include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp"
#include "util/ifr/p"
namespace apache namespace apache
{ {
@ -27,18 +38,60 @@ namespace apache
{ {
namespace command namespace command
{ {
using namespace ifr;
using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class MessageAck : public BaseCommand
{ {
private:
ActiveMQDestination destination ;
p<TransactionId> transactionId ;
p<ConsumerId> consumerId ;
byte ackType ;
p<MessageId> firstMessageId ;
p<MessageId> lastMessageId ;
int messageCount ;
public: public:
const static int TYPE = 22 ; const static int TYPE = 22;
public: public:
MessageAck() ; MessageAck() ;
virtual ~MessageAck() ; virtual ~MessageAck() ;
virtual ActiveMQDestination getDestination() ;
virtual void setDestination(ActiveMQDestination destination) ;
virtual p<TransactionId> getTransactionId() ;
virtual void setTransactionId(p<TransactionId> transactionId) ;
virtual p<ConsumerId> getConsumerId() ;
virtual void setConsumerId(p<ConsumerId> consumerId) ;
virtual byte getAckType() ;
virtual void setAckType(byte ackType) ;
virtual p<MessageId> getFirstMessageId() ;
virtual void setFirstMessageId(p<MessageId> firstMessageId) ;
virtual p<MessageId> getLastMessageId() ;
virtual void setLastMessageId(p<MessageId> lastMessageId) ;
virtual int getMessageCount() ;
virtual void setMessageCount(int messageCount) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,50 +1,67 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ProducerId.hpp" #include "command/ProducerId.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ProducerId::ProducerId()
{ {
connectionId = new string() ; this->connectionId = NULL ;
this->value = NULL ;
this->sessionId = NULL ;
} }
ProducerId::~ProducerId() ProducerId::~ProducerId()
{ {
} }
int ProducerId::getCommandType()
p<string> ProducerId::getConnectionId()
{ {
return ProducerId::TYPE ; return connectionId ;
} }
void ProducerId::setValue(long producerId) void ProducerId::setConnectionId(p<string> connectionId)
{ {
this->producerId = producerId ; this->connectionId = connectionId ;
} }
long ProducerId::getValue() long ProducerId::getValue()
{ {
return producerId ; return value ;
} }
void ProducerId::setValue(long value)
{
this->value = value ;
}
long ProducerId::getSessionId() long ProducerId::getSessionId()
{ {
return sessionId ; return sessionId ;
@ -54,13 +71,3 @@ void ProducerId::setSessionId(long sessionId)
{ {
this->sessionId = sessionId ; this->sessionId = sessionId ;
} }
p<string> ProducerId::getConnectionId()
{
return connectionId ;
}
void ProducerId::setConnectionId(const char* connectionId)
{
this->connectionId->assign( connectionId ) ;
}

View File

@ -1,23 +1,32 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ProducerId_hpp_ #ifndef ProducerId_hpp_
#define ProducerId_hpp_ #define ProducerId_hpp_
#include <string> #include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/AbstractCommand.hpp" #include "command/AbstractCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
@ -30,31 +39,43 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace std; using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ProducerId : public AbstractCommand
{ {
private: private:
p<string> connectionId ; p<string> connectionId ;
long sessionId, long value ;
producerId ; long sessionId ;
const static int TYPE = 123 ; public:
const static int TYPE = 123;
public: public:
ProducerId() ; ProducerId() ;
virtual ~ProducerId() ; virtual ~ProducerId() ;
virtual int getCommandType() ;
virtual void setValue(long producerId) ;
virtual long getValue() ;
virtual void setSessionId(long sessionId) ;
virtual long getSessionId() ;
virtual void setConnectionId(const char* connectionId) ;
virtual p<string> getConnectionId() ; virtual p<string> getConnectionId() ;
virtual void setConnectionId(p<string> connectionId) ;
virtual long getValue() ;
virtual void setValue(long value) ;
virtual long getSessionId() ;
virtual void setSessionId(long sessionId) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,36 +1,45 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/ProducerInfo.hpp" #include "command/ProducerInfo.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() ProducerInfo::ProducerInfo()
{ {
this->producerId = NULL ; this->producerId = NULL ;
this->destination = NULL ; this->destination = NULL ;
this->brokerPath = NULL ;
} }
ProducerInfo::~ProducerInfo() ProducerInfo::~ProducerInfo()
{ {
} }
p<ProducerId> ProducerInfo::getProducerId() p<ProducerId> ProducerInfo::getProducerId()
{ {
return producerId ; return producerId ;
@ -41,12 +50,24 @@ void ProducerInfo::setProducerId(p<ProducerId> producerId)
this->producerId = producerId ; this->producerId = producerId ;
} }
p<IDestination> ProducerInfo::getDestination()
ActiveMQDestination ProducerInfo::getDestination()
{ {
return destination ; return destination ;
} }
void ProducerInfo::setDestination(p<IDestination> destination) void ProducerInfo::setDestination(ActiveMQDestination destination)
{ {
this->destination = destination ; this->destination = destination ;
} }
BrokerId[] ProducerInfo::getBrokerPath()
{
return brokerPath ;
}
void ProducerInfo::setBrokerPath(BrokerId[] brokerPath)
{
this->brokerPath = brokerPath ;
}

View File

@ -1,26 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef ProducerInfo_hpp_ #ifndef ProducerInfo_hpp_
#define ProducerInfo_hpp_ #define ProducerInfo_hpp_
#include <string> #include <string>
#include "IDestination.hpp"
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp" #include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -35,25 +42,40 @@ namespace apache
using namespace apache::activemq::client; using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class ProducerInfo : public BaseCommand
{ {
private: private:
p<ProducerId> producerId ; p<ProducerId> producerId ;
p<IDestination> destination ; ActiveMQDestination destination ;
BrokerId[] brokerPath ;
public: public:
const static int TYPE = 6 ; const static int TYPE = 6;
public: public:
ProducerInfo() ; ProducerInfo() ;
virtual ~ProducerInfo() ; virtual ~ProducerInfo() ;
virtual p<ProducerId> getProducerId() ; virtual p<ProducerId> getProducerId() ;
virtual void setProducerId(p<ProducerId> producerId) ; virtual void setProducerId(p<ProducerId> producerId) ;
virtual p<IDestination> getDestination() ;
virtual void setDestination(p<IDestination> destination) ; virtual ActiveMQDestination getDestination() ;
virtual void setDestination(ActiveMQDestination destination) ;
virtual BrokerId[] getBrokerPath() ;
virtual void setBrokerPath(BrokerId[] brokerPath) ;
} ; } ;
/* namespace */ /* namespace */

View File

@ -1,40 +1,49 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#include "command/RemoveInfo.hpp" #include "command/RemoveInfo.hpp"
using namespace apache::activemq::client::command; using namespace apache::activemq::client::command;
/* /*
* Dummy, should be auto-generated *
* 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() RemoveInfo::RemoveInfo()
{ {
this->objectId = NULL ;
} }
RemoveInfo::~RemoveInfo() RemoveInfo::~RemoveInfo()
{ {
} }
p<IDataStructure> RemoveInfo::getObjectId()
DataStructure RemoveInfo::getObjectId()
{ {
return objectId ; return objectId ;
} }
void RemoveInfo::setObjectId(p<IDataStructure> oid) void RemoveInfo::setObjectId(DataStructure objectId)
{ {
this->objectId = oid ; this->objectId = objectId ;
} }

View File

@ -1,24 +1,33 @@
/* /*
* Copyright 2006 The Apache Software Foundation or its licensors, as * Copyright 2006 The Apache Software Foundation or its licensors, as
* applicable. * applicable.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef RemoveInfo_hpp_ #ifndef RemoveInfo_hpp_
#define RemoveInfo_hpp_ #define RemoveInfo_hpp_
#include <string>
/* we could cut this down - for now include all possible headers */
#include "command/BaseCommand.hpp"
#include "command/BrokerId.hpp"
#include "command/ConnectionId.hpp"
#include "command/ConsumerId.hpp"
#include "command/ProducerId.hpp"
#include "command/SessionId.hpp"
#include "command/BaseCommand.hpp" #include "command/BaseCommand.hpp"
#include "command/IDataStructure.hpp"
#include "util/ifr/p" #include "util/ifr/p"
namespace apache namespace apache
@ -30,24 +39,35 @@ namespace apache
namespace command namespace command
{ {
using namespace ifr; using namespace ifr;
using namespace apache::activemq::client;
/* /*
* Dummy, should be auto-generated. *
* 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 class RemoveInfo : public BaseCommand
{ {
private: private:
p<IDataStructure> objectId ; DataStructure objectId ;
public: public:
const static int TYPE = 12 ; const static int TYPE = 12;
public: public:
RemoveInfo() ; RemoveInfo() ;
virtual ~RemoveInfo() ; virtual ~RemoveInfo() ;
virtual p<IDataStructure> getObjectId() ;
virtual void setObjectId(p<IDataStructure> oid) ; virtual DataStructure getObjectId() ;
virtual void setObjectId(DataStructure objectId) ;
} ; } ;
/* namespace */ /* namespace */

Some files were not shown because too many files have changed in this diff Show More