[continued from previous message]
++/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file
to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by
applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing
permissions and
* limitations under the License.
*/
package org.apache.activemq.openwire.v8;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Marshalling code for Open Wire Format for WireFormatInfoMarshaller
*
*
* 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.
*
*
*/
public class WireFormatInfoMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
* @return short
representation of the type data structure
*/
public byte getDataStructureType() {
return WireFormatInfo.DATA_STRUCTURE_TYPE;
}
/**
* @return a new object instance
*/
public DataStructure createObject() {
return new WireFormatInfo();
}
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
WireFormatInfo info = (WireFormatInfo)o;
info.
beforeUnmarshall(wireFormat);
info.setMagic(tightUnmarshalConstByteArray(dataIn, bs, 8));
info.setVersion(dataIn.readInt());
info.setMarshalledProperties(tightUnmarshalByteSequence(wireFormat, dataIn, bs));
info.
afterUnmarshall(wireFormat);
}
/**
* Write the booleans that this object uses to a BooleanStream
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
WireFormatInfo info
= (WireFormatInfo)o;
info.beforeMarshall(wireFormat);
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalConstByteArray1(info.getMagic(), bs, 8);
rc += tightMarshalByteSequence1(info.
getMarshalledProperties(), bs);
return rc + 4;
}
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
WireFormatInfo info = (WireFormatInfo)
o;
tightMarshalConstByteArray2(info.getMagic(), dataOut, bs, 8);
dataOut.writeInt(info.getVersion());
tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs);
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, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
WireFormatInfo info = (WireFormatInfo)o;
info.beforeUnmarshall(wireFormat);
info.setMagic(
looseUnmarshalConstByteArray(dataIn, 8));
info.setVersion(dataIn.readInt());
info.setMarshalledProperties(looseUnmarshalByteSequence(wireFormat, dataIn));
info.afterUnmarshall(wireFormat);
}
/**
* Write the
booleans that this object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {
WireFormatInfo info = (WireFormatInfo)o;
info.beforeMarshall(wireFormat)
;
super.looseMarshal(wireFormat, o, dataOut);
looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8);
dataOut.writeInt(info.getVersion());
looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut);
}
}
+\ No newline at end of file
+--- a/activemq-openwire-legacy/src/main/java/org/apache/activemq/openwire/v8/XATransactionIdMarshaller.java
++++ b/activemq-openwire-legacy/src/main/java/org/apache/activemq/openwire/v8/XATransactionIdMarshaller.java
+@@ -1 +1 @@
+-/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file
to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by
applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing
permissions and
* limitations under the License.
*/
package org.apache.activemq.openwire.v8;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Marshalling code for Open Wire Format for XATransactionIdMarshaller
*
*
* 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.
*
*
*/
public class XATransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure we marshal
* @return short
representation of the type data structure
*/
public byte getDataStructureType() {
return XATransactionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new object instance
*/
public DataStructure createObject() {
return new XATransactionId();
}
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
XATransactionId info = (XATransactionId)o;
info.
setFormatId(dataIn.readInt());
info.setGlobalTransactionId(tightUnmarshalByteArray(dataIn, bs));
info.setBranchQualifier(tightUnmarshalByteArray(dataIn, bs));
}
/**
* Write the booleans that this object uses to a
BooleanStream
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
XATransactionId info = (XATransactionId)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
rc +=
tightMarshalByteArray1(info.getGlobalTransactionId(), bs);
rc += tightMarshalByteArray1(info.getBranchQualifier(), bs);
return rc + 4;
}
/**
* 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, DataOutput dataOut, BooleanStream bs) throws IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
XATransactionId info = (XATransactionId)o;
dataOut.writeInt(info.getFormatId());
tightMarshalByteArray2(info.getGlobalTransactionId(), dataOut, bs);
tightMarshalByteArray2(info.getBranchQualifier(), 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, DataInput 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, DataOutput 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);
}
}
+\ No newline at end of file
++/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file
to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by
applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing
permissions and
* limitations under the License.
*/
package org.apache.activemq.openwire.v8;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.activemq.openwire.*;
import org.apache.activemq.command.*;
/**
* Marshalling code for Open Wire Format for XATransactionIdMarshaller
*
*
* 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.
*
*
*/
public class XATransactionIdMarshaller extends TransactionIdMarshaller {
/**
* Return the type of Data Structure we marshal
* @return short
representation of the type data structure
*/
public byte getDataStructureType() {
return XATransactionId.DATA_STRUCTURE_TYPE;
}
/**
* @return a new object instance
*/
public DataStructure createObject() {
return new XATransactionId();
}
/**
* 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, DataInput dataIn, BooleanStream bs) throws IOException {
super.tightUnmarshal(wireFormat, o, dataIn, bs);
XATransactionId info = (XATransactionId)o;
info.
setFormatId(dataIn.readInt());
info.setGlobalTransactionId(tightUnmarshalByteArray(wireFormat, dataIn, bs));
info.setBranchQualifier(tightUnmarshalByteArray(wireFormat, dataIn, bs));
}
/**
* Write the booleans that this
object uses to a BooleanStream
*/
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
XATransactionId info = (XATransactionId)o;
int rc = super.tightMarshal1(wireFormat, o, bs);
rc += tightMarshalByteArray1(info.getGlobalTransactionId(), bs);
rc += tightMarshalByteArray1(info.getBranchQualifier(), bs);
return rc + 4;
}
/**
* 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, DataOutput dataOut, BooleanStream bs) throws
IOException {
super.tightMarshal2(wireFormat, o, dataOut, bs);
XATransactionId info = (XATransactionId)o;
dataOut.writeInt(info.getFormatId());
tightMarshalByteArray2(info.getGlobalTransactionId(), dataOut, bs);
tightMarshalByteArray2(info.getBranchQualifier(), 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, DataInput dataIn) throws IOException {
super.looseUnmarshal(wireFormat, o, dataIn);
XATransactionId info = (XATransactionId)o;
info.setFormatId(dataIn.readInt());
info.setGlobalTransactionId(looseUnmarshalByteArray(wireFormat, dataIn));
info.setBranchQualifier(looseUnmarshalByteArray(wireFormat, dataIn));
}
/**
* Write the booleans that this
object uses to a BooleanStream
*/
public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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);
}
}
+\ No newline at end of file
+--- a/activemq-openwire-legacy/src/test/java/org/apache/activemq/openwire/OpenWireLegacyValidationTest.java
++++ b/activemq-openwire-legacy/src/test/java/org/apache/activemq/openwire/OpenWireLegacyValidationTest.java
+@@ -21,13 +21,13 @@
+ import java.util.ArrayList;
+ import java.util.Collection;
+ import java.util.List;
++import org.apache.activemq.util.ByteSequence;
+ import org.junit.runner.RunWith;
+ import org.junit.runners.Parameterized;
+ import org.junit.runners.Parameterized.Parameters;
+
+ /**
+- * Test that Openwire marshalling for legacy versions will validate Throwable types during
+- * unmarshalling commands that contain a Throwable
++ * Test that Openwire marshalling for legacy versions will validate certain commands correctly
+ */
+ @RunWith(Parameterized.class)
+ public class OpenWireLegacyValidationTest extends OpenWireValidationTest { +@@ -126,4 +126,46 @@
+ }
+ }
+
++ protected DataStreamMarshaller getWireFormatInfoMarshaller() {
++ switch (version) {
++ case 2:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v2.WireFormatInfoMarshaller());
++ case 3:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v3.WireFormatInfoMarshaller());
++ case 4:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v4.WireFormatInfoMarshaller());
++ case 5:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v5.WireFormatInfoMarshaller());
++ case 6:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v6.WireFormatInfoMarshaller());
++ case 7:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v7.WireFormatInfoMarshaller());
++ case 8:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v8.WireFormatInfoMarshaller());
++ default:
++ throw new IllegalArgumentException("Unknown OpenWire version of " + version);
++ }
++ }
++
++ protected DataStreamMarshaller getPartialCommandMarshaller() {
++ switch (version) {
++ case 2:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v2.PartialCommandMarshaller());
++ case 3:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v3.PartialCommandMarshaller());
++ case 4:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v4.PartialCommandMarshaller());
++ case 5:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v5.PartialCommandMarshaller());
++ case 6:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v6.PartialCommandMarshaller());
++ case 7:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v7.PartialCommandMarshaller());
++ case 8:
++ return proxyBadBufferCommand(new org.apache.activemq.openwire.v8.PartialCommandMarshaller());
++ default:
++ throw new IllegalArgumentException("Unknown OpenWire version of " + version);
++ }
++ }
++
+ }
+--- a/pom.xml
++++ b/pom.xml
+@@ -76,6 +76,7 @@
+ <jetty-version>${jetty9-version}</jetty-version>
+ <jmdns-version>3.4.1</jmdns-version>
+ <tomcat-api-version>9.0.65</tomcat-api-version>
++ <javassist-version>3.27.0</javassist-version>
+ <jettison-version>1.5.4</jettison-version>
+ <jmock-version>2.5.1</jmock-version>
+ <jolokia-version>1.7.1</jolokia-version>
+@@ -1054,6 +1055,11 @@
+ <artifactId>jettison</artifactId>
+ <version>${jettison-version}</version>
+ </dependency>
++ <dependency>
++ <groupId>org.javassist</groupId>
++ <artifactId>javassist</artifactId>
++ <version>${javassist-version}</version>
++ </dependency>
+
+ <dependency>
+ <groupId>annogen</groupId>
--sRn9BzuoY94XsR7j--
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEE3lnVbvHK7ir4q61+p3sXeEcY/EFAmg7jScACgkQ+p3sXeEc Y/GJwQ/9Ff2SuHkbqCR600mrKv6GaPXpBQLVfUcS/k1sKUp6AxAILbjWBVflGpz1 bQhwUbLAwE2LhGbXv4YKqZrP1vyk/JD9EYTrvj4EB3ra30i0Ht9qF8XbHc3YYp4F oHyLUBVGSU7xHfjloQtvaFQiWu6V7D56uYPPCMST3wQemB3P6/yEUJZyWR3WFYLG 0Zkf8oUkJXPsKUyfiIr/wB4bk3p19FksuONk249RRznBYzfywjOyJxxN+t5kFf52 BlOPkx5nUs6SetiobiAa2MLwGwQ/I+WroL+R3ouKZTCaEyhszZ8JHFyX3y1cPVK2 XE4gt9OgbWtNYPI+jpOiJXsXi7ugIaF2e/X02Po7BYqghH8KFSOh5/RMKlG1CrCB bU2J4GM36W0qw0MptZNxPsVvqqYAEQjM7Q5xYsIcwsIzXq2iJcsVF9vwhOPL9ExN edMnvcQ3eBL/Z4+e/465/vyXL0gQzBz5suIkGlZ0j4XuWGiazzP/2tUsVN+Oidjp ErfhiyiTxKoD3DYOy7XPXXy2GpbDH43wOLxkl0Lu2LU+Gg1aL/2pk7rxd1/Wr2k6 yqQ0U0S8ZmS6wGCYwVVUd/SfSH1eKTdKjW+bijUAk4zUlKqFU5BVLyNo8ODh5aF/ uQKIIBWPskZsopRBiFI1e4LH5mBDJ/71IX+b+u/sVg9Xyu3iI5Q=
=oBz3
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)