Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 24342 invoked from network); 1 Mar 2006 06:31:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Mar 2006 06:31:17 -0000 Received: (qmail 89012 invoked by uid 500); 1 Mar 2006 06:32:02 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 88851 invoked by uid 500); 1 Mar 2006 06:32:01 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 88679 invoked by uid 99); 1 Mar 2006 06:31:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Feb 2006 22:31:59 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 28 Feb 2006 22:31:48 -0800 Received: (qmail 23892 invoked by uid 65534); 1 Mar 2006 06:30:41 -0000 Message-ID: <20060301063041.23891.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r381926 [4/8] - in /incubator/activemq/trunk: activemq-core/src/gram/java/org/apache/activemq/openwire/tool/ activemq-core/src/gram/script/ activemq-core/src/main/java/org/apache/activemq/command/ activemq-core/src/main/java/org/apache/acti... Date: Wed, 01 Mar 2006 06:29:57 -0000 To: activemq-commits@geronimo.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageDispatchNotificationMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,14 +60,14 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageDispatchNotification info = (MessageDispatchNotification)o; - info.setConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setDeliverySequenceId(unmarshalLong(wireFormat, dataIn, bs)); - info.setMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); + info.setConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); } @@ -75,15 +75,15 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageDispatchNotification info = (MessageDispatchNotification)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getConsumerId(), bs); - rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); - rc+=marshal1Long(wireFormat, info.getDeliverySequenceId(), bs); - rc += marshal1NestedObject(wireFormat, info.getMessageId(), bs); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getConsumerId(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs); + rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs); + rc += tightMarshalNestedObject1(wireFormat, info.getMessageId(), bs); return rc + 0; } @@ -95,14 +95,48 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); MessageDispatchNotification info = (MessageDispatchNotification)o; - marshal2CachedObject(wireFormat, info.getConsumerId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); - marshal2Long(wireFormat, info.getDeliverySequenceId(), dataOut, bs); - marshal2NestedObject(wireFormat, info.getMessageId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getConsumerId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getDeliverySequenceId(), dataOut, bs); + tightMarshalNestedObject2(wireFormat, info.getMessageId(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + MessageDispatchNotification info = (MessageDispatchNotification)o; + info.setConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn)); + info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + MessageDispatchNotification info = (MessageDispatchNotification)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getConsumerId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); + looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut); + looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageIdMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public class MessageIdMarshaller extends DataStreamMarshaller { +public class MessageIdMarshaller extends BaseDataStreamMarshaller { /** * Return the type of Data Structure we marshal @@ -60,13 +60,13 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageId info = (MessageId)o; - info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setProducerSequenceId(unmarshalLong(wireFormat, dataIn, bs)); - info.setBrokerSequenceId(unmarshalLong(wireFormat, dataIn, bs)); + info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setProducerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setBrokerSequenceId(tightUnmarshalLong(wireFormat, dataIn, bs)); } @@ -74,14 +74,14 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageId info = (MessageId)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); - rc+=marshal1Long(wireFormat, info.getProducerSequenceId(), bs); - rc+=marshal1Long(wireFormat, info.getBrokerSequenceId(), bs); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs); + rc+=tightMarshalLong1(wireFormat, info.getProducerSequenceId(), bs); + rc+=tightMarshalLong1(wireFormat, info.getBrokerSequenceId(), bs); return rc + 0; } @@ -93,13 +93,45 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); MessageId info = (MessageId)o; - marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); - marshal2Long(wireFormat, info.getProducerSequenceId(), dataOut, bs); - marshal2Long(wireFormat, info.getBrokerSequenceId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getProducerSequenceId(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getBrokerSequenceId(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + MessageId info = (MessageId)o; + info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setProducerSequenceId(looseUnmarshalLong(wireFormat, dataIn)); + info.setBrokerSequenceId(looseUnmarshalLong(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + MessageId info = (MessageId)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut); + looseMarshalLong(wireFormat, info.getProducerSequenceId(), dataOut); + looseMarshalLong(wireFormat, info.getBrokerSequenceId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/MessageMarshaller.java Tue Feb 28 22:29:45 2006 @@ -45,46 +45,32 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); Message info = (Message)o; info.beforeUnmarshall(wireFormat); - info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setOriginalDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setMessageId((MessageId) unmarsalNestedObject(wireFormat, dataIn, bs)); - info.setOriginalTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setGroupID(readString(dataIn, bs)); + info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setOriginalDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setMessageId((MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + info.setOriginalTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setGroupID(tightUnmarshalString(dataIn, bs)); info.setGroupSequence(dataIn.readInt()); - info.setCorrelationId(readString(dataIn, bs)); + info.setCorrelationId(tightUnmarshalString(dataIn, bs)); info.setPersistent(bs.readBoolean()); - info.setExpiration(unmarshalLong(wireFormat, dataIn, bs)); + info.setExpiration(tightUnmarshalLong(wireFormat, dataIn, bs)); info.setPriority(dataIn.readByte()); - info.setReplyTo((ActiveMQDestination) unmarsalNestedObject(wireFormat, dataIn, bs)); - info.setTimestamp(unmarshalLong(wireFormat, dataIn, bs)); - info.setType(readString(dataIn, bs)); - if( bs.readBoolean() ) { - int size = dataIn.readInt(); - byte data[] = new byte[size]; - dataIn.readFully(data); - info.setContent(new org.activeio.ByteSequence(data,0,size)); - } else { - info.setContent(null); - } - if( bs.readBoolean() ) { - int size = dataIn.readInt(); - byte data[] = new byte[size]; - dataIn.readFully(data); - info.setMarshalledProperties(new org.activeio.ByteSequence(data,0,size)); - } else { - info.setMarshalledProperties(null); - } - info.setDataStructure((DataStructure) unmarsalNestedObject(wireFormat, dataIn, bs)); - info.setTargetConsumerId((ConsumerId) unmarsalCachedObject(wireFormat, dataIn, bs)); + info.setReplyTo((ActiveMQDestination) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + info.setTimestamp(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setType(tightUnmarshalString(dataIn, bs)); + info.setContent(tightUnmarshalByteSequence(dataIn, bs)); + info.setMarshalledProperties(tightUnmarshalByteSequence(dataIn, bs)); + info.setDataStructure((DataStructure) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); + info.setTargetConsumerId((ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setCompressed(bs.readBoolean()); info.setRedeliveryCounter(dataIn.readInt()); @@ -92,15 +78,15 @@ short size = dataIn.readShort(); BrokerId value[] = new BrokerId[size]; for( int i=0; i < size; i++ ) { - value[i] = (BrokerId) unmarsalNestedObject(wireFormat,dataIn, bs); + value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } else { info.setBrokerPath(null); } - info.setArrival(unmarshalLong(wireFormat, dataIn, bs)); - info.setUserID(readString(dataIn, bs)); + info.setArrival(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setUserID(tightUnmarshalString(dataIn, bs)); info.setRecievedByDFBridge(bs.readBoolean()); info.afterUnmarshall(wireFormat); @@ -111,39 +97,37 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { Message info = (Message)o; info.beforeMarshall(wireFormat); - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); - rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); - rc += marshal1CachedObject(wireFormat, info.getTransactionId(), bs); - rc += marshal1CachedObject(wireFormat, info.getOriginalDestination(), bs); - rc += marshal1NestedObject(wireFormat, info.getMessageId(), bs); - rc += marshal1CachedObject(wireFormat, info.getOriginalTransactionId(), bs); - rc += writeString(info.getGroupID(), bs); - rc += writeString(info.getCorrelationId(), bs); - bs.writeBoolean(info.isPersistent()); - rc+=marshal1Long(wireFormat, info.getExpiration(), bs); - rc += marshal1NestedObject(wireFormat, info.getReplyTo(), bs); - rc+=marshal1Long(wireFormat, info.getTimestamp(), bs); - rc += writeString(info.getType(), bs); - bs.writeBoolean(info.getContent()!=null); - rc += info.getContent()==null ? 0 : info.getContent().getLength()+4; - bs.writeBoolean(info.getMarshalledProperties()!=null); - rc += info.getMarshalledProperties()==null ? 0 : info.getMarshalledProperties().getLength()+4; - rc += marshal1NestedObject(wireFormat, info.getDataStructure(), bs); - rc += marshal1CachedObject(wireFormat, info.getTargetConsumerId(), bs); - bs.writeBoolean(info.isCompressed()); - rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); - rc+=marshal1Long(wireFormat, info.getArrival(), bs); - rc += writeString(info.getUserID(), bs); - bs.writeBoolean(info.isRecievedByDFBridge()); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getProducerId(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getDestination(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getOriginalDestination(), bs); + rc += tightMarshalNestedObject1(wireFormat, info.getMessageId(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getOriginalTransactionId(), bs); + rc += tightMarshalString1(info.getGroupID(), bs); + rc += tightMarshalString1(info.getCorrelationId(), bs); + bs.writeBoolean(info.isPersistent()); + rc+=tightMarshalLong1(wireFormat, info.getExpiration(), bs); + rc += tightMarshalNestedObject1(wireFormat, info.getReplyTo(), bs); + rc+=tightMarshalLong1(wireFormat, info.getTimestamp(), bs); + rc += tightMarshalString1(info.getType(), bs); + rc += tightMarshalByteSequence1(info.getContent(), bs); + rc += tightMarshalByteSequence1(info.getMarshalledProperties(), bs); + rc += tightMarshalNestedObject1(wireFormat, info.getDataStructure(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getTargetConsumerId(), bs); + bs.writeBoolean(info.isCompressed()); + rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); + rc+=tightMarshalLong1(wireFormat, info.getArrival(), bs); + rc += tightMarshalString1(info.getUserID(), bs); + bs.writeBoolean(info.isRecievedByDFBridge()); - return rc + 3; + return rc + 9; } /** @@ -153,45 +137,131 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); + + Message info = (Message)o; + tightMarshalCachedObject2(wireFormat, info.getProducerId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getTransactionId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getOriginalDestination(), dataOut, bs); + tightMarshalNestedObject2(wireFormat, info.getMessageId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getOriginalTransactionId(), dataOut, bs); + tightMarshalString2(info.getGroupID(), dataOut, bs); + dataOut.writeInt(info.getGroupSequence()); + tightMarshalString2(info.getCorrelationId(), dataOut, bs); + bs.readBoolean(); + tightMarshalLong2(wireFormat, info.getExpiration(), dataOut, bs); + dataOut.writeByte(info.getPriority()); + tightMarshalNestedObject2(wireFormat, info.getReplyTo(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getTimestamp(), dataOut, bs); + tightMarshalString2(info.getType(), dataOut, bs); + tightMarshalByteSequence2(info.getContent(), dataOut, bs); + tightMarshalByteSequence2(info.getMarshalledProperties(), dataOut, bs); + tightMarshalNestedObject2(wireFormat, info.getDataStructure(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getTargetConsumerId(), dataOut, bs); + bs.readBoolean(); + dataOut.writeInt(info.getRedeliveryCounter()); + tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs); + tightMarshalLong2(wireFormat, info.getArrival(), dataOut, bs); + tightMarshalString2(info.getUserID(), dataOut, bs); + bs.readBoolean(); + + info.afterMarshall(wireFormat); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); Message info = (Message)o; - marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getTransactionId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getOriginalDestination(), dataOut, bs); - marshal2NestedObject(wireFormat, info.getMessageId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getOriginalTransactionId(), dataOut, bs); - writeString(info.getGroupID(), dataOut, bs); - dataOut.writeInt(info.getGroupSequence()); - writeString(info.getCorrelationId(), dataOut, bs); - bs.readBoolean(); - marshal2Long(wireFormat, info.getExpiration(), dataOut, bs); - dataOut.writeByte(info.getPriority()); - marshal2NestedObject(wireFormat, info.getReplyTo(), dataOut, bs); - marshal2Long(wireFormat, info.getTimestamp(), dataOut, bs); - writeString(info.getType(), dataOut, bs); - if(bs.readBoolean()) { - org.activeio.ByteSequence data = info.getContent(); - dataOut.writeInt(data.getLength()); - dataOut.write(data.getData(), data.getOffset(), data.getLength()); + + info.beforeUnmarshall(wireFormat); + + info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setOriginalDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setMessageId((MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); + info.setOriginalTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setGroupID(looseUnmarshalString(dataIn)); + info.setGroupSequence(dataIn.readInt()); + info.setCorrelationId(looseUnmarshalString(dataIn)); + info.setPersistent(dataIn.readBoolean()); + info.setExpiration(looseUnmarshalLong(wireFormat, dataIn)); + info.setPriority(dataIn.readByte()); + info.setReplyTo((ActiveMQDestination) looseUnmarsalNestedObject(wireFormat, dataIn)); + info.setTimestamp(looseUnmarshalLong(wireFormat, dataIn)); + info.setType(looseUnmarshalString(dataIn)); + info.setContent(looseUnmarshalByteSequence(dataIn)); + info.setMarshalledProperties(looseUnmarshalByteSequence(dataIn)); + info.setDataStructure((DataStructure) looseUnmarsalNestedObject(wireFormat, dataIn)); + info.setTargetConsumerId((ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setCompressed(dataIn.readBoolean()); + info.setRedeliveryCounter(dataIn.readInt()); + + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for( int i=0; i < size; i++ ) { + value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setBrokerPath(value); } - if(bs.readBoolean()) { - org.activeio.ByteSequence data = info.getMarshalledProperties(); - dataOut.writeInt(data.getLength()); - dataOut.write(data.getData(), data.getOffset(), data.getLength()); + else { + info.setBrokerPath(null); } - marshal2NestedObject(wireFormat, info.getDataStructure(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getTargetConsumerId(), dataOut, bs); - bs.readBoolean(); - dataOut.writeInt(info.getRedeliveryCounter()); - marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); - marshal2Long(wireFormat, info.getArrival(), dataOut, bs); - writeString(info.getUserID(), dataOut, bs); - bs.readBoolean(); + info.setArrival(looseUnmarshalLong(wireFormat, dataIn)); + info.setUserID(looseUnmarshalString(dataIn)); + info.setRecievedByDFBridge(dataIn.readBoolean()); - info.afterMarshall(wireFormat); + info.afterUnmarshall(wireFormat); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + Message info = (Message)o; + + info.beforeMarshall(wireFormat); + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); + looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getOriginalDestination(), dataOut); + looseMarshalNestedObject(wireFormat, info.getMessageId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getOriginalTransactionId(), dataOut); + looseMarshalString(info.getGroupID(), dataOut); + dataOut.writeInt(info.getGroupSequence()); + looseMarshalString(info.getCorrelationId(), dataOut); + dataOut.writeBoolean(info.isPersistent()); + looseMarshalLong(wireFormat, info.getExpiration(), dataOut); + dataOut.writeByte(info.getPriority()); + looseMarshalNestedObject(wireFormat, info.getReplyTo(), dataOut); + looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); + looseMarshalString(info.getType(), dataOut); + looseMarshalByteSequence(wireFormat, info.getContent(), dataOut); + looseMarshalByteSequence(wireFormat, info.getMarshalledProperties(), dataOut); + looseMarshalNestedObject(wireFormat, info.getDataStructure(), dataOut); + looseMarshalCachedObject(wireFormat, info.getTargetConsumerId(), dataOut); + dataOut.writeBoolean(info.isCompressed()); + dataOut.writeInt(info.getRedeliveryCounter()); + looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); + looseMarshalLong(wireFormat, info.getArrival(), dataOut); + looseMarshalString(info.getUserID(), dataOut); + dataOut.writeBoolean(info.isRecievedByDFBridge()); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerIdMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public class ProducerIdMarshaller extends DataStreamMarshaller { +public class ProducerIdMarshaller extends BaseDataStreamMarshaller { /** * Return the type of Data Structure we marshal @@ -60,13 +60,13 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); ProducerId info = (ProducerId)o; - info.setConnectionId(readString(dataIn, bs)); - info.setValue(unmarshalLong(wireFormat, dataIn, bs)); - info.setSessionId(unmarshalLong(wireFormat, dataIn, bs)); + info.setConnectionId(tightUnmarshalString(dataIn, bs)); + info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs)); + info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs)); } @@ -74,14 +74,14 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ProducerId info = (ProducerId)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += writeString(info.getConnectionId(), bs); - rc+=marshal1Long(wireFormat, info.getValue(), bs); - rc+=marshal1Long(wireFormat, info.getSessionId(), bs); + 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; } @@ -93,13 +93,45 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); ProducerId info = (ProducerId)o; - writeString(info.getConnectionId(), dataOut, bs); - marshal2Long(wireFormat, info.getValue(), dataOut, bs); - marshal2Long(wireFormat, info.getSessionId(), dataOut, bs); + 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 + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + ProducerId info = (ProducerId)o; + info.setConnectionId(looseUnmarshalString(dataIn)); + info.setValue(looseUnmarshalLong(wireFormat, dataIn)); + info.setSessionId(looseUnmarshalLong(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + ProducerId info = (ProducerId)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalString(info.getConnectionId(), dataOut); + looseMarshalLong(wireFormat, info.getValue(), dataOut); + looseMarshalLong(wireFormat, info.getSessionId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ProducerInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,18 +60,18 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); ProducerInfo info = (ProducerInfo)o; - info.setProducerId((ProducerId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); + info.setProducerId((ProducerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setDestination((ActiveMQDestination) 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) unmarsalNestedObject(wireFormat,dataIn, bs); + value[i] = (BrokerId) tightUnmarsalNestedObject(wireFormat,dataIn, bs); } info.setBrokerPath(value); } @@ -85,14 +85,14 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { ProducerInfo info = (ProducerInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getProducerId(), bs); - rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); - rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs); + 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; } @@ -104,13 +104,56 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); ProducerInfo info = (ProducerInfo)o; - marshal2CachedObject(wireFormat, info.getProducerId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); - marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs); + 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 + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + ProducerInfo info = (ProducerInfo)o; + info.setProducerId((ProducerId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + + if (dataIn.readBoolean()) { + short size = dataIn.readShort(); + BrokerId value[] = new BrokerId[size]; + for( int i=0; i < size; i++ ) { + value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); + } + info.setBrokerPath(value); + } + else { + info.setBrokerPath(null); + } + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + ProducerInfo info = (ProducerInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getProducerId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); + looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,11 +60,11 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); RemoveInfo info = (RemoveInfo)o; - info.setObjectId((DataStructure) unmarsalCachedObject(wireFormat, dataIn, bs)); + info.setObjectId((DataStructure) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); } @@ -72,12 +72,12 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveInfo info = (RemoveInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getObjectId(), bs); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getObjectId(), bs); return rc + 0; } @@ -89,11 +89,39 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveInfo info = (RemoveInfo)o; - marshal2CachedObject(wireFormat, info.getObjectId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getObjectId(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + RemoveInfo info = (RemoveInfo)o; + info.setObjectId((DataStructure) looseUnmarsalCachedObject(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + RemoveInfo info = (RemoveInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getObjectId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/RemoveSubscriptionInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,13 +60,13 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; - info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setSubcriptionName(readString(dataIn, bs)); - info.setClientId(readString(dataIn, bs)); + info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setSubcriptionName(tightUnmarshalString(dataIn, bs)); + info.setClientId(tightUnmarshalString(dataIn, bs)); } @@ -74,14 +74,14 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); - rc += writeString(info.getSubcriptionName(), bs); - rc += writeString(info.getClientId(), bs); + 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; } @@ -93,13 +93,45 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; - marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); - writeString(info.getSubcriptionName(), dataOut, bs); - writeString(info.getClientId(), dataOut, bs); + 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 + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; + info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setSubcriptionName(looseUnmarshalString(dataIn)); + info.setClientId(looseUnmarshalString(dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + RemoveSubscriptionInfo info = (RemoveSubscriptionInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut); + looseMarshalString(info.getSubcriptionName(), dataOut); + looseMarshalString(info.getClientId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ResponseMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,8 +60,8 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); Response info = (Response)o; info.setCorrelationId(dataIn.readShort()); @@ -72,13 +72,13 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { Response info = (Response)o; - int rc = super.marshal1(wireFormat, o, bs); - - return rc + 1; + int rc = super.tightMarshal1(wireFormat, o, bs); + + return rc + 2; } /** @@ -88,11 +88,39 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); Response info = (Response)o; - dataOut.writeShort(info.getCorrelationId()); + dataOut.writeShort(info.getCorrelationId()); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + Response info = (Response)o; + info.setCorrelationId(dataIn.readShort()); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + Response info = (Response)o; + + super.looseMarshal(wireFormat, o, dataOut); + dataOut.writeShort(info.getCorrelationId()); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionIdMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public class SessionIdMarshaller extends DataStreamMarshaller { +public class SessionIdMarshaller extends BaseDataStreamMarshaller { /** * Return the type of Data Structure we marshal @@ -60,12 +60,12 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); SessionId info = (SessionId)o; - info.setConnectionId(readString(dataIn, bs)); - info.setValue(unmarshalLong(wireFormat, dataIn, bs)); + info.setConnectionId(tightUnmarshalString(dataIn, bs)); + info.setValue(tightUnmarshalLong(wireFormat, dataIn, bs)); } @@ -73,13 +73,13 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { SessionId info = (SessionId)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += writeString(info.getConnectionId(), bs); - rc+=marshal1Long(wireFormat, info.getValue(), bs); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalString1(info.getConnectionId(), bs); + rc+=tightMarshalLong1(wireFormat, info.getValue(), bs); return rc + 0; } @@ -91,12 +91,42 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); SessionId info = (SessionId)o; - writeString(info.getConnectionId(), dataOut, bs); - marshal2Long(wireFormat, info.getValue(), dataOut, bs); + 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 + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + SessionId info = (SessionId)o; + info.setConnectionId(looseUnmarshalString(dataIn)); + info.setValue(looseUnmarshalLong(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + SessionId info = (SessionId)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalString(info.getConnectionId(), dataOut); + looseMarshalLong(wireFormat, info.getValue(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SessionInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,11 +60,11 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); SessionInfo info = (SessionInfo)o; - info.setSessionId((SessionId) unmarsalCachedObject(wireFormat, dataIn, bs)); + info.setSessionId((SessionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); } @@ -72,12 +72,12 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { SessionInfo info = (SessionInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getSessionId(), bs); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getSessionId(), bs); return rc + 0; } @@ -89,11 +89,39 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); SessionInfo info = (SessionInfo)o; - marshal2CachedObject(wireFormat, info.getSessionId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getSessionId(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + SessionInfo info = (SessionInfo)o; + info.setSessionId((SessionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + SessionInfo info = (SessionInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getSessionId(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ShutdownInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,8 +60,8 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); } @@ -69,9 +69,9 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - int rc = super.marshal1(wireFormat, o, bs); + int rc = super.tightMarshal1(wireFormat, o, bs); return rc + 0; } @@ -83,8 +83,30 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + super.looseMarshal(wireFormat, o, dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/SubscriptionInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public class SubscriptionInfoMarshaller extends DataStreamMarshaller { +public class SubscriptionInfoMarshaller extends BaseDataStreamMarshaller { /** * Return the type of Data Structure we marshal @@ -60,14 +60,14 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); SubscriptionInfo info = (SubscriptionInfo)o; - info.setClientId(readString(dataIn, bs)); - info.setDestination((ActiveMQDestination) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setSelector(readString(dataIn, bs)); - info.setSubcriptionName(readString(dataIn, bs)); + info.setClientId(tightUnmarshalString(dataIn, bs)); + info.setDestination((ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setSelector(tightUnmarshalString(dataIn, bs)); + info.setSubcriptionName(tightUnmarshalString(dataIn, bs)); } @@ -75,15 +75,15 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { SubscriptionInfo info = (SubscriptionInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += writeString(info.getClientId(), bs); - rc += marshal1CachedObject(wireFormat, info.getDestination(), bs); - rc += writeString(info.getSelector(), bs); - rc += writeString(info.getSubcriptionName(), bs); + 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); return rc + 0; } @@ -95,14 +95,48 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); SubscriptionInfo info = (SubscriptionInfo)o; - writeString(info.getClientId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getDestination(), dataOut, bs); - writeString(info.getSelector(), dataOut, bs); - writeString(info.getSubcriptionName(), dataOut, bs); + tightMarshalString2(info.getClientId(), dataOut, bs); + tightMarshalCachedObject2(wireFormat, info.getDestination(), dataOut, bs); + tightMarshalString2(info.getSelector(), dataOut, bs); + tightMarshalString2(info.getSubcriptionName(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + SubscriptionInfo info = (SubscriptionInfo)o; + info.setClientId(looseUnmarshalString(dataIn)); + info.setDestination((ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setSelector(looseUnmarshalString(dataIn)); + info.setSubcriptionName(looseUnmarshalString(dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + SubscriptionInfo info = (SubscriptionInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalString(info.getClientId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getDestination(), dataOut); + looseMarshalString(info.getSelector(), dataOut); + looseMarshalString(info.getSubcriptionName(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionIdMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public abstract class TransactionIdMarshaller extends DataStreamMarshaller { +public abstract class TransactionIdMarshaller extends BaseDataStreamMarshaller { /** * Un-marshal an object instance from the data input stream @@ -45,8 +45,8 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); } @@ -54,9 +54,9 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { - int rc = super.marshal1(wireFormat, o, bs); + int rc = super.tightMarshal1(wireFormat, o, bs); return rc + 0; } @@ -68,8 +68,30 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + super.looseMarshal(wireFormat, o, dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/TransactionInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,12 +60,12 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); TransactionInfo info = (TransactionInfo)o; - info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs)); - info.setTransactionId((TransactionId) unmarsalCachedObject(wireFormat, dataIn, bs)); + info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); + info.setTransactionId((TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setType(dataIn.readByte()); } @@ -74,14 +74,14 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { TransactionInfo info = (TransactionInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs); - rc += marshal1CachedObject(wireFormat, info.getTransactionId(), bs); - + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs); + rc += tightMarshalCachedObject1(wireFormat, info.getTransactionId(), bs); + return rc + 1; } @@ -92,13 +92,45 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); TransactionInfo info = (TransactionInfo)o; - marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs); - marshal2CachedObject(wireFormat, info.getTransactionId(), dataOut, bs); - dataOut.writeByte(info.getType()); + 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 + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + TransactionInfo info = (TransactionInfo)o; + info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setTransactionId((TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); + info.setType(dataIn.readByte()); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + TransactionInfo info = (TransactionInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut); + looseMarshalCachedObject(wireFormat, info.getTransactionId(), dataOut); + dataOut.writeByte(info.getType()); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/WireFormatInfoMarshaller.java Tue Feb 28 22:29:45 2006 @@ -36,7 +36,7 @@ * * @version $Revision$ */ -public class WireFormatInfoMarshaller extends DataStreamMarshaller { +public class WireFormatInfoMarshaller extends BaseDataStreamMarshaller { /** * Return the type of Data Structure we marshal @@ -60,20 +60,17 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); WireFormatInfo info = (WireFormatInfo)o; - { - byte data[] = new byte[8]; - dataIn.readFully(data); - info.setMagic(data); - } + info.setMagic(tightUnmarshalConstByteArray(dataIn, bs, 8)); info.setVersion(dataIn.readInt()); info.setCacheEnabled(bs.readBoolean()); - info.setCompressionEnabled(bs.readBoolean()); info.setStackTraceEnabled(bs.readBoolean()); info.setTcpNoDelayEnabled(bs.readBoolean()); + info.setPrefixPacketSize(bs.readBoolean()); + info.setTightEncodingEnabled(bs.readBoolean()); } @@ -81,17 +78,19 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { WireFormatInfo info = (WireFormatInfo)o; - int rc = super.marshal1(wireFormat, o, bs); - bs.writeBoolean(info.isCacheEnabled()); - bs.writeBoolean(info.isCompressionEnabled()); - bs.writeBoolean(info.isStackTraceEnabled()); - bs.writeBoolean(info.isTcpNoDelayEnabled()); + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalConstByteArray1(info.getMagic(), bs, 8); + bs.writeBoolean(info.isCacheEnabled()); + bs.writeBoolean(info.isStackTraceEnabled()); + bs.writeBoolean(info.isTcpNoDelayEnabled()); + bs.writeBoolean(info.isPrefixPacketSize()); + bs.writeBoolean(info.isTightEncodingEnabled()); - return rc + 9; + return rc + 4; } /** @@ -101,16 +100,57 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); WireFormatInfo info = (WireFormatInfo)o; - dataOut.write(info.getMagic(), 0, 8); - dataOut.writeInt(info.getVersion()); - bs.readBoolean(); - bs.readBoolean(); - bs.readBoolean(); - bs.readBoolean(); + tightMarshalConstByteArray2(info.getMagic(), dataOut, bs, 8); + dataOut.writeInt(info.getVersion()); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + bs.readBoolean(); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + WireFormatInfo info = (WireFormatInfo)o; + info.setMagic(looseUnmarshalConstByteArray(dataIn, 8)); + info.setVersion(dataIn.readInt()); + info.setCacheEnabled(dataIn.readBoolean()); + info.setStackTraceEnabled(dataIn.readBoolean()); + info.setTcpNoDelayEnabled(dataIn.readBoolean()); + info.setPrefixPacketSize(dataIn.readBoolean()); + info.setTightEncodingEnabled(dataIn.readBoolean()); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + WireFormatInfo info = (WireFormatInfo)o; + + super.looseMarshal(wireFormat, o, dataOut); + looseMarshalConstByteArray(wireFormat, info.getMagic(), dataOut, 8); + dataOut.writeInt(info.getVersion()); + dataOut.writeBoolean(info.isCacheEnabled()); + dataOut.writeBoolean(info.isStackTraceEnabled()); + dataOut.writeBoolean(info.isTcpNoDelayEnabled()); + dataOut.writeBoolean(info.isPrefixPacketSize()); + dataOut.writeBoolean(info.isTightEncodingEnabled()); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/XATransactionIdMarshaller.java Tue Feb 28 22:29:45 2006 @@ -60,27 +60,13 @@ * @param dataIn the data input stream to build the object from * @throws IOException */ - public void unmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { - super.unmarshal(wireFormat, o, dataIn, bs); + public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException { + super.tightUnmarshal(wireFormat, o, dataIn, bs); XATransactionId info = (XATransactionId)o; info.setFormatId(dataIn.readInt()); - if( bs.readBoolean() ) { - int size = dataIn.readInt(); - byte data[] = new byte[size]; - dataIn.readFully(data); - info.setGlobalTransactionId(data); - } else { - info.setGlobalTransactionId(null); - } - if( bs.readBoolean() ) { - int size = dataIn.readInt(); - byte data[] = new byte[size]; - dataIn.readFully(data); - info.setBranchQualifier(data); - } else { - info.setBranchQualifier(null); - } + info.setGlobalTransactionId(tightUnmarshalByteArray(dataIn, bs)); + info.setBranchQualifier(tightUnmarshalByteArray(dataIn, bs)); } @@ -88,17 +74,15 @@ /** * Write the booleans that this object uses to a BooleanStream */ - public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { + public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { XATransactionId info = (XATransactionId)o; - int rc = super.marshal1(wireFormat, o, bs); - bs.writeBoolean(info.getGlobalTransactionId()!=null); - rc += info.getGlobalTransactionId()==null ? 0 : info.getGlobalTransactionId().length+4; - bs.writeBoolean(info.getBranchQualifier()!=null); - rc += info.getBranchQualifier()==null ? 0 : info.getBranchQualifier().length+4; + int rc = super.tightMarshal1(wireFormat, o, bs); + rc += tightMarshalByteArray1(info.getGlobalTransactionId(), bs); + rc += tightMarshalByteArray1(info.getBranchQualifier(), bs); - return rc + 1; + return rc + 4; } /** @@ -108,19 +92,45 @@ * @param dataOut the output stream * @throws IOException thrown if an error occurs */ - public void marshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { - super.marshal2(wireFormat, o, dataOut, bs); + public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException { + super.tightMarshal2(wireFormat, o, dataOut, bs); XATransactionId info = (XATransactionId)o; - dataOut.writeInt(info.getFormatId()); - if(bs.readBoolean()) { - dataOut.writeInt(info.getGlobalTransactionId().length); - dataOut.write(info.getGlobalTransactionId()); - } - if(bs.readBoolean()) { - dataOut.writeInt(info.getBranchQualifier().length); - dataOut.write(info.getBranchQualifier()); - } + dataOut.writeInt(info.getFormatId()); + tightMarshalByteArray2(info.getGlobalTransactionId(), dataOut, bs); + tightMarshalByteArray2(info.getBranchQualifier(), dataOut, bs); + + } + + /** + * Un-marshal an object instance from the data input stream + * + * @param o the object to un-marshal + * @param dataIn the data input stream to build the object from + * @throws IOException + */ + public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException { + super.looseUnmarshal(wireFormat, o, dataIn); + + XATransactionId info = (XATransactionId)o; + info.setFormatId(dataIn.readInt()); + info.setGlobalTransactionId(looseUnmarshalByteArray(dataIn)); + info.setBranchQualifier(looseUnmarshalByteArray(dataIn)); + + } + + + /** + * Write the booleans that this object uses to a BooleanStream + */ + public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException { + + XATransactionId info = (XATransactionId)o; + + super.looseMarshal(wireFormat, o, dataOut); + dataOut.writeInt(info.getFormatId()); + looseMarshalByteArray(wireFormat, info.getGlobalTransactionId(), dataOut); + looseMarshalByteArray(wireFormat, info.getBranchQualifier(), dataOut); } } Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/WireFormatNegotiator.java Tue Feb 28 22:29:45 2006 @@ -76,6 +76,8 @@ info.setStackTraceEnabled(((OpenWireFormat)wireFormat).isStackTraceEnabled()); info.setTcpNoDelayEnabled(((OpenWireFormat)wireFormat).isTcpNoDelayEnabled()); info.setCacheEnabled(((OpenWireFormat)wireFormat).isCacheEnabled()); + info.setPrefixPacketSize(((OpenWireFormat)wireFormat).isPrefixPacketSize()); + info.setTightEncodingEnabled(((OpenWireFormat)wireFormat).isTightEncodingEnabled()); } return info; } @@ -84,7 +86,7 @@ if( command.isWireFormatInfo() ) { WireFormatInfo info = (WireFormatInfo) command; if (log.isDebugEnabled()) { - log.debug("Received WireFormat: " + info + " with version: 0x" + Integer.toString(info.getVersion(), 16)); + log.debug("Received WireFormat: " + info); } if( !info.isValid() ) { @@ -104,6 +106,12 @@ } if( !info.isCacheEnabled() ) { ((OpenWireFormat)wireFormat).setCacheEnabled(false); + } + if( !info.isPrefixPacketSize() ) { + ((OpenWireFormat)wireFormat).setPrefixPacketSize(false); + } + if( !info.isTightEncodingEnabled() ) { + ((OpenWireFormat)wireFormat).setTightEncodingEnabled(false); } } Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java?rev=381926&r1=381925&r2=381926&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java (original) +++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/openwire/v1/WireFormatInfoTest.java Tue Feb 28 22:29:45 2006 @@ -33,7 +33,7 @@ * under src/gram/script and then use maven openwire:generate to regenerate * this file. * - * @version $Revision: $ + * @version $Revision$ */ public class WireFormatInfoTest extends DataFileGeneratorTestSupport { @@ -52,9 +52,10 @@ WireFormatInfo info = (WireFormatInfo) object; info.setVersion(1); info.setCacheEnabled(true); - info.setCompressionEnabled(false); - info.setStackTraceEnabled(true); - info.setTcpNoDelayEnabled(false); + info.setStackTraceEnabled(false); + info.setTcpNoDelayEnabled(true); + info.setPrefixPacketSize(false); + info.setTightEncodingEnabled(true); } }