http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/OpenWireTopicMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/OpenWireTopicMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/OpenWireTopicMarshaller.java deleted file mode 100644 index 1fee745..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/OpenWireTopicMarshaller.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.OpenWireTopic; - -public class OpenWireTopicMarshaller extends OpenWireDestinationMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return OpenWireTopic.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new OpenWireTopic(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - super.looseMarshal(wireFormat, o, dataOut); - } -}
http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/PartialCommandMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/PartialCommandMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/PartialCommandMarshaller.java deleted file mode 100644 index 2932fed..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/PartialCommandMarshaller.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.PartialCommand; - -public class PartialCommandMarshaller extends BaseDataStreamMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return PartialCommand.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new PartialCommand(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - PartialCommand info = (PartialCommand) o; - info.setCommandId(dataIn.readInt()); - info.setData(tightUnmarshalByteArray(dataIn, bs)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - PartialCommand info = (PartialCommand) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalByteArray1(info.getData(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - PartialCommand info = (PartialCommand) o; - dataOut.writeInt(info.getCommandId()); - tightMarshalByteArray2(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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - PartialCommand info = (PartialCommand) o; - info.setCommandId(dataIn.readInt()); - info.setData(looseUnmarshalByteArray(dataIn)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - PartialCommand info = (PartialCommand) o; - - super.looseMarshal(wireFormat, o, dataOut); - dataOut.writeInt(info.getCommandId()); - looseMarshalByteArray(wireFormat, info.getData(), dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerAckMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerAckMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerAckMarshaller.java deleted file mode 100644 index 432d36e..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerAckMarshaller.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.ProducerAck; -import org.apache.activemq.openwire.commands.ProducerId; - -public class ProducerAckMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return ProducerAck.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new ProducerAck(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - ProducerAck info = (ProducerAck) o; - info.setProducerId((ProducerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); - info.setSize(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - ProducerAck info = (ProducerAck) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalNestedObject1(wireFormat, info.getProducerId(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - ProducerAck info = (ProducerAck) o; - tightMarshalNestedObject2(wireFormat, info.getProducerId(), dataOut, bs); - dataOut.writeInt(info.getSize()); - } - - /** - * 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - ProducerAck info = (ProducerAck) o; - info.setProducerId((ProducerId) looseUnmarsalNestedObject(wireFormat, dataIn)); - info.setSize(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - ProducerAck info = (ProducerAck) o; - - super.looseMarshal(wireFormat, o, dataOut); - looseMarshalNestedObject(wireFormat, info.getProducerId(), dataOut); - dataOut.writeInt(info.getSize()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerIdMarshaller.java deleted file mode 100644 index e9d7277..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerIdMarshaller.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.ProducerId; - -public class ProducerIdMarshaller extends BaseDataStreamMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return ProducerId.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new ProducerId(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - ProducerId info = (ProducerId) o; - info.setConnectionId(tightUnmarshalString(dataIn, bs)); - info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs)); - info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - ProducerId info = (ProducerId) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalString1(info.getConnectionId(), bs); - rc += tightMarshalLong1(wireFormat, info.getValue(), bs); - rc += tightMarshalLong1(wireFormat, info.getSessionId(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - ProducerId info = (ProducerId) o; - tightMarshalString2(info.getConnectionId(), dataOut, bs); - tightMarshalLong2(wireFormat, info.getValue(), 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput 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 - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerInfoMarshaller.java deleted file mode 100644 index 00593b8..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ProducerInfoMarshaller.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.BrokerId; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.OpenWireDestination; -import org.apache.activemq.openwire.commands.ProducerId; -import org.apache.activemq.openwire.commands.ProducerInfo; - -public class ProducerInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return ProducerInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new ProducerInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - ProducerInfo info = (ProducerInfo) o; - info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - - if (bs.readBoolean()) { - short size = dataIn.readShort(); - BrokerId value[] = new BrokerId[size]; - for (int i = 0; i < size; i++) { - value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs); - } - info.setBrokerPath(value); - } else { - info.setBrokerPath(null); - } - info.setDispatchAsync(bs.readBoolean()); - info.setWindowSize(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - ProducerInfo info = (ProducerInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs); - rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs); - rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); - bs.writeBoolean(info.isDispatchAsync()); - - 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - ProducerInfo info = (ProducerInfo) o; - tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs); - tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); - tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); - bs.readBoolean(); - dataOut.writeInt(info.getWindowSize()); - } - - /** - * 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - ProducerInfo info = (ProducerInfo) o; - info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn)); - info.setDestination((OpenWireDestination) 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); - } - info.setDispatchAsync(dataIn.readBoolean()); - info.setWindowSize(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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); - dataOut.writeBoolean(info.isDispatchAsync()); - dataOut.writeInt(info.getWindowSize()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveInfoMarshaller.java deleted file mode 100644 index 5a158bd..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveInfoMarshaller.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.RemoveInfo; - -public class RemoveInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return RemoveInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new RemoveInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - RemoveInfo info = (RemoveInfo) o; - info.setObjectId(tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setLastDeliveredSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - RemoveInfo info = (RemoveInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalCachedObject1(wireFormat, info.getObjectId(), bs); - rc += tightMarshalLong1(wireFormat, info.getLastDeliveredSequenceId(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - RemoveInfo info = (RemoveInfo) o; - tightMarshalCachedObject2(wireFormat, info.getObjectId(), dataOut, bs); - tightMarshalLong2(wireFormat, info.getLastDeliveredSequenceId(), 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - RemoveInfo info = (RemoveInfo) o; - info.setObjectId(looseUnmarsalCachedObject(wireFormat, dataIn)); - info.setLastDeliveredSequenceId(looseUnmarshalLong(wireFormat, dataIn)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - RemoveInfo info = (RemoveInfo) o; - - super.looseMarshal(wireFormat, o, dataOut); - looseMarshalCachedObject(wireFormat, info.getObjectId(), dataOut); - looseMarshalLong(wireFormat, info.getLastDeliveredSequenceId(), dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveSubscriptionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveSubscriptionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveSubscriptionInfoMarshaller.java deleted file mode 100644 index e443b46..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/RemoveSubscriptionInfoMarshaller.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.ConnectionId; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.RemoveSubscriptionInfo; - -public class RemoveSubscriptionInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return RemoveSubscriptionInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new RemoveSubscriptionInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) o; - info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setSubcriptionName(tightUnmarshalString(dataIn, bs)); - info.setClientId(tightUnmarshalString(dataIn, bs)); - - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs); - rc += tightMarshalString1(info.getSubcriptionName(), bs); - rc += tightMarshalString1(info.getClientId(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - RemoveSubscriptionInfo info = (RemoveSubscriptionInfo) o; - tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs); - tightMarshalString2(info.getSubcriptionName(), 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput 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 - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ReplayCommandMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ReplayCommandMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ReplayCommandMarshaller.java deleted file mode 100644 index 0d0d2df..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ReplayCommandMarshaller.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.ReplayCommand; - -public class ReplayCommandMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return ReplayCommand.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new ReplayCommand(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - ReplayCommand info = (ReplayCommand) o; - info.setFirstNakNumber(dataIn.readInt()); - info.setLastNakNumber(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - int rc = super.tightMarshal1(wireFormat, o, bs); - return rc + 8; - } - - /** - * 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - ReplayCommand info = (ReplayCommand) o; - dataOut.writeInt(info.getFirstNakNumber()); - dataOut.writeInt(info.getLastNakNumber()); - } - - /** - * 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - ReplayCommand info = (ReplayCommand) o; - info.setFirstNakNumber(dataIn.readInt()); - info.setLastNakNumber(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - ReplayCommand info = (ReplayCommand) o; - - super.looseMarshal(wireFormat, o, dataOut); - dataOut.writeInt(info.getFirstNakNumber()); - dataOut.writeInt(info.getLastNakNumber()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ResponseMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ResponseMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ResponseMarshaller.java deleted file mode 100644 index 78c176c..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ResponseMarshaller.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.Response; - -public class ResponseMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return Response.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new Response(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - Response info = (Response) o; - info.setCorrelationId(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - int rc = super.tightMarshal1(wireFormat, o, 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - Response info = (Response) o; - dataOut.writeInt(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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - Response info = (Response) o; - info.setCorrelationId(dataIn.readInt()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - Response info = (Response) o; - super.looseMarshal(wireFormat, o, dataOut); - dataOut.writeInt(info.getCorrelationId()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionIdMarshaller.java deleted file mode 100644 index ba834cd..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionIdMarshaller.java +++ /dev/null @@ -1,129 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.SessionId; - -public class SessionIdMarshaller extends BaseDataStreamMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return SessionId.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new SessionId(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - SessionId info = (SessionId) o; - info.setConnectionId(tightUnmarshalString(dataIn, bs)); - info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - SessionId info = (SessionId) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalString1(info.getConnectionId(), bs); - rc += tightMarshalLong1(wireFormat, info.getValue(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - SessionId info = (SessionId) o; - tightMarshalString2(info.getConnectionId(), 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput 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 - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - SessionId info = (SessionId) o; - - super.looseMarshal(wireFormat, o, dataOut); - looseMarshalString(info.getConnectionId(), dataOut); - looseMarshalLong(wireFormat, info.getValue(), dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionInfoMarshaller.java deleted file mode 100644 index e297d32..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SessionInfoMarshaller.java +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.SessionId; -import org.apache.activemq.openwire.commands.SessionInfo; - -public class SessionInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return SessionInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new SessionInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - SessionInfo info = (SessionInfo) o; - info.setSessionId((SessionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - SessionInfo info = (SessionInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalCachedObject1(wireFormat, info.getSessionId(), 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - SessionInfo info = (SessionInfo) o; - 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput 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 - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - SessionInfo info = (SessionInfo) o; - - super.looseMarshal(wireFormat, o, dataOut); - looseMarshalCachedObject(wireFormat, info.getSessionId(), dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ShutdownInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ShutdownInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ShutdownInfoMarshaller.java deleted file mode 100644 index 1af7fa7..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/ShutdownInfoMarshaller.java +++ /dev/null @@ -1,107 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.ShutdownInfo; - -public class ShutdownInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return ShutdownInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new ShutdownInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - super.looseMarshal(wireFormat, o, dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SubscriptionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SubscriptionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SubscriptionInfoMarshaller.java deleted file mode 100644 index 5615a71..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/SubscriptionInfoMarshaller.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.OpenWireDestination; -import org.apache.activemq.openwire.commands.SubscriptionInfo; - -public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return SubscriptionInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new SubscriptionInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - SubscriptionInfo info = (SubscriptionInfo) o; - info.setClientId(tightUnmarshalString(dataIn, bs)); - info.setDestination((OpenWireDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setSelector(tightUnmarshalString(dataIn, bs)); - info.setSubcriptionName(tightUnmarshalString(dataIn, bs)); - info.setSubscribedDestination((OpenWireDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); - info.setNoLocal(bs.readBoolean()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - SubscriptionInfo info = (SubscriptionInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalString1(info.getClientId(), bs); - rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs); - rc += tightMarshalString1(info.getSelector(), bs); - rc += tightMarshalString1(info.getSubcriptionName(), bs); - rc += tightMarshalNestedObject1(wireFormat, info.getSubscribedDestination(), bs); - bs.writeBoolean(info.isNoLocal()); - - 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - SubscriptionInfo info = (SubscriptionInfo) o; - tightMarshalString2(info.getClientId(), dataOut, bs); - tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); - tightMarshalString2(info.getSelector(), dataOut, bs); - tightMarshalString2(info.getSubcriptionName(), dataOut, bs); - tightMarshalNestedObject2(wireFormat, info.getSubscribedDestination(), dataOut, bs); - 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - - SubscriptionInfo info = (SubscriptionInfo) o; - info.setClientId(looseUnmarshalString(dataIn)); - info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); - info.setSelector(looseUnmarshalString(dataIn)); - info.setSubcriptionName(looseUnmarshalString(dataIn)); - info.setSubscribedDestination((OpenWireDestination) looseUnmarsalNestedObject(wireFormat, dataIn)); - info.setNoLocal(dataIn.readBoolean()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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); - looseMarshalNestedObject(wireFormat, info.getSubscribedDestination(), dataOut); - dataOut.writeBoolean(info.isNoLocal()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionIdMarshaller.java deleted file mode 100644 index f9e3e64..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionIdMarshaller.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; - -public abstract class TransactionIdMarshaller 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { - super.looseUnmarshal(wireFormat, o, dataIn); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { - super.looseMarshal(wireFormat, o, dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionInfoMarshaller.java deleted file mode 100644 index bce262e..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/TransactionInfoMarshaller.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.ConnectionId; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.TransactionId; -import org.apache.activemq.openwire.commands.TransactionInfo; - -public class TransactionInfoMarshaller extends BaseCommandMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return TransactionInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new TransactionInfo(); - } - - /** - * 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 - */ - @Override - public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { - super.tightUnmarshal(wireFormat, o, dataIn, bs); - - TransactionInfo info = (TransactionInfo) o; - info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); - info.setType(dataIn.readByte()); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - TransactionInfo info = (TransactionInfo) o; - - int rc = super.tightMarshal1(wireFormat, o, bs); - rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs); - rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs); - - return rc + 1; - } - - /** - * 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 - */ - @Override - public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { - super.tightMarshal2(wireFormat, o, dataOut, bs); - - TransactionInfo info = (TransactionInfo) o; - tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs); - tightMarshalCachedObject2(wireFormat, info.getTransactionId(), dataOut, bs); - 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 - */ - @Override - public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput 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 - */ - @Override - public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput 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()); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/WireFormatInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/WireFormatInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/WireFormatInfoMarshaller.java deleted file mode 100644 index b4168e7..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/WireFormatInfoMarshaller.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BaseDataStreamMarshaller; -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.WireFormatInfo; - -public class WireFormatInfoMarshaller extends BaseDataStreamMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return WireFormatInfo.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - 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 - */ - @Override - 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(dataIn, bs)); - - info.afterUnmarshall(wireFormat); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - 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 - */ - @Override - 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 - */ - @Override - 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(dataIn)); - - info.afterUnmarshall(wireFormat); - } - - /** - * Write the booleans that this object uses to a BooleanStream - */ - @Override - 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); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/XATransactionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/XATransactionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/XATransactionIdMarshaller.java deleted file mode 100644 index 4e0a03c..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v11/XATransactionIdMarshaller.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * 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.codec.v11; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import org.apache.activemq.openwire.codec.BooleanStream; -import org.apache.activemq.openwire.codec.OpenWireFormat; -import org.apache.activemq.openwire.commands.DataStructure; -import org.apache.activemq.openwire.commands.XATransactionId; - -public class XATransactionIdMarshaller extends TransactionIdMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return XATransactionId.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - 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 - */ - @Override - 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 - */ - @Override - 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 - */ - @Override - 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 - */ - @Override - 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 - */ - @Override - 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); - } -}
