http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempDestinationMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempDestinationMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempDestinationMarshaller.java deleted file mode 100644 index 6c52a5e..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempDestinationMarshaller.java +++ /dev/null @@ -1,87 +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.v1; - -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; - -public abstract class OpenWireTempDestinationMarshaller extends OpenWireDestinationMarshaller { - - /** - * 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/v1/OpenWireTempQueueMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempQueueMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempQueueMarshaller.java deleted file mode 100644 index 333faa1..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempQueueMarshaller.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.v1; - -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.OpenWireTempQueue; - -public class OpenWireTempQueueMarshaller extends OpenWireTempDestinationMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return OpenWireTempQueue.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new OpenWireTempQueue(); - } - - /** - * 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/v1/OpenWireTempTopicMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempTopicMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempTopicMarshaller.java deleted file mode 100644 index c2838c7..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTempTopicMarshaller.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.v1; - -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.OpenWireTempTopic; - -public class OpenWireTempTopicMarshaller extends OpenWireTempDestinationMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return OpenWireTempTopic.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new OpenWireTempTopic(); - } - - /** - * 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/v1/OpenWireTextMessageMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTextMessageMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTextMessageMarshaller.java deleted file mode 100644 index 89c132b..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTextMessageMarshaller.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.v1; - -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.OpenWireTextMessage; - -public class OpenWireTextMessageMarshaller extends OpenWireMessageMarshaller { - - /** - * Return the type of Data Structure we marshal - * - * @return short representation of the type data structure - */ - @Override - public byte getDataStructureType() { - return OpenWireTextMessage.DATA_STRUCTURE_TYPE; - } - - /** - * @return a new object instance - */ - @Override - public DataStructure createObject() { - return new OpenWireTextMessage(); - } - - /** - * 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/v1/OpenWireTopicMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTopicMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTopicMarshaller.java deleted file mode 100644 index 5685b16..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/OpenWireTopicMarshaller.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.v1; - -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/v1/PartialCommandMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/PartialCommandMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/PartialCommandMarshaller.java deleted file mode 100644 index c6b891c..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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/v1/ProducerIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ProducerIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ProducerIdMarshaller.java deleted file mode 100644 index 9368623..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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/v1/ProducerInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ProducerInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ProducerInfoMarshaller.java deleted file mode 100644 index 6a9d16f..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ProducerInfoMarshaller.java +++ /dev/null @@ -1,156 +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.v1; - -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); - } - } - - /** - * 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); - - 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); - - ProducerInfo info = (ProducerInfo) o; - tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs); - tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); - tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); - } - - /** - * Un-marshal an object instance from the data input stream - * - * @param o - * the object to un-marshal - * @param dataIn - * the data input stream to build the object from - * @throws IOException - */ - @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); - } - } - - /** - * 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); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveInfoMarshaller.java deleted file mode 100644 index 985bf0e..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveInfoMarshaller.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.v1; - -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)); - } - - /** - * 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); - - 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); - } - - /** - * 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)); - } - - /** - * 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); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveSubscriptionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveSubscriptionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveSubscriptionInfoMarshaller.java deleted file mode 100644 index 913b2b2..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/RemoveSubscriptionInfoMarshaller.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.v1; - -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.setSubscriptionName(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.getSubscriptionName(), 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.getSubscriptionName(), 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.setSubscriptionName(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.getSubscriptionName(), 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/v1/ReplayCommandMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ReplayCommandMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ReplayCommandMarshaller.java deleted file mode 100644 index 9f752b5..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ReplayCommandMarshaller.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.v1; - -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/v1/ResponseMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ResponseMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ResponseMarshaller.java deleted file mode 100644 index bc48008..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ResponseMarshaller.java +++ /dev/null @@ -1,119 +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.v1; - -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/v1/SessionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SessionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SessionIdMarshaller.java deleted file mode 100644 index 1132a8e..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SessionIdMarshaller.java +++ /dev/null @@ -1,130 +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.v1; - -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/v1/SessionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SessionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SessionInfoMarshaller.java deleted file mode 100644 index e789944..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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/v1/ShutdownInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ShutdownInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/ShutdownInfoMarshaller.java deleted file mode 100644 index b86fdb7..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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/v1/SubscriptionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SubscriptionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SubscriptionInfoMarshaller.java deleted file mode 100644 index 0eab1a0..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/SubscriptionInfoMarshaller.java +++ /dev/null @@ -1,140 +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.v1; - -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.setSubscriptionName(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 { - 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.getSubscriptionName(), 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); - - SubscriptionInfo info = (SubscriptionInfo) o; - tightMarshalString2(info.getClientId(), dataOut, bs); - tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); - tightMarshalString2(info.getSelector(), dataOut, bs); - tightMarshalString2(info.getSubscriptionName(), 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); - - SubscriptionInfo info = (SubscriptionInfo) o; - info.setClientId(looseUnmarshalString(dataIn)); - info.setDestination((OpenWireDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); - info.setSelector(looseUnmarshalString(dataIn)); - info.setSubscriptionName(looseUnmarshalString(dataIn)); - } - - /** - * 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.getSubscriptionName(), dataOut); - } -} http://git-wip-us.apache.org/repos/asf/activemq-openwire/blob/0c90d2e3/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/TransactionIdMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/TransactionIdMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/TransactionIdMarshaller.java deleted file mode 100644 index b0291e5..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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/v1/TransactionInfoMarshaller.java ---------------------------------------------------------------------- diff --git a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/TransactionInfoMarshaller.java b/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/TransactionInfoMarshaller.java deleted file mode 100644 index 8373ec8..0000000 --- a/openwire-core/src/main/java/org/apache/activemq/openwire/codec/v1/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.v1; - -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()); - } -}
