You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/03/01 07:29:57 UTC
svn commit: r381926 [2/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...
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMapMessageMarshaller.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/ActiveMQMessageMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQMessageMarshaller.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/ActiveMQObjectMessageMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQObjectMessageMarshaller.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/ActiveMQQueueMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQQueueMarshaller.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/ActiveMQStreamMessageMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQStreamMessageMarshaller.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/ActiveMQTempDestinationMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempDestinationMarshaller.java Tue Feb 28 22:29:45 2006
@@ -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/ActiveMQTempQueueMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempQueueMarshaller.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/ActiveMQTempTopicMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTempTopicMarshaller.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/ActiveMQTextMessageMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTextMessageMarshaller.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/ActiveMQTopicMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ActiveMQTopicMarshaller.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/BaseCommandMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseCommandMarshaller.java Tue Feb 28 22:29:45 2006
@@ -36,7 +36,7 @@
*
* @version $Revision$
*/
-public abstract class BaseCommandMarshaller extends DataStreamMarshaller {
+public abstract class BaseCommandMarshaller 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);
BaseCommand info = (BaseCommand)o;
info.setCommandId(dataIn.readShort());
@@ -58,14 +58,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 {
BaseCommand info = (BaseCommand)o;
- int rc = super.marshal1(wireFormat, o, bs);
- bs.writeBoolean(info.isResponseRequired());
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ bs.writeBoolean(info.isResponseRequired());
- return rc + 1;
+ return rc + 2;
}
/**
@@ -75,12 +75,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);
BaseCommand info = (BaseCommand)o;
- dataOut.writeShort(info.getCommandId());
- bs.readBoolean();
+ dataOut.writeShort(info.getCommandId());
+ bs.readBoolean();
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ BaseCommand info = (BaseCommand)o;
+ info.setCommandId(dataIn.readShort());
+ info.setResponseRequired(dataIn.readBoolean());
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ BaseCommand info = (BaseCommand)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ dataOut.writeShort(info.getCommandId());
+ dataOut.writeBoolean(info.isResponseRequired());
}
}
Added: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java?rev=381926&view=auto
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java (added)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java Tue Feb 28 22:29:45 2006
@@ -0,0 +1,592 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.openwire.v1;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+
+import org.activeio.ByteSequence;
+import org.activeio.command.ClassLoading;
+import org.apache.activemq.command.DataStructure;
+import org.apache.activemq.openwire.BooleanStream;
+import org.apache.activemq.openwire.DataStreamMarshaller;
+import org.apache.activemq.openwire.OpenWireFormat;
+
+abstract public class BaseDataStreamMarshaller implements DataStreamMarshaller {
+
+ static final public Constructor STACK_TRACE_ELEMENT_CONSTRUCTOR;
+
+ static {
+ Constructor constructor=null;
+ try {
+ constructor = StackTraceElement.class.getConstructor(new Class[]{String.class, String.class, String.class, int.class});
+ } catch (Throwable e) {
+ }
+ STACK_TRACE_ELEMENT_CONSTRUCTOR = constructor;
+ }
+
+
+ abstract public byte getDataStructureType();
+ abstract public DataStructure createObject();
+
+ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
+ return 0;
+ }
+ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ }
+ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn, BooleanStream bs) throws IOException {
+ }
+
+ public int tightMarshalLong1(OpenWireFormat wireFormat, long o, BooleanStream bs) throws IOException {
+ if( o == 0 ) {
+ bs.writeBoolean(false);
+ bs.writeBoolean(false);
+ return 0;
+ } else if ( (o & 0xFFFFFFFFFFFF0000l ) == 0 ) {
+ bs.writeBoolean(false);
+ bs.writeBoolean(true);
+ return 2;
+ } else if ( (o & 0xFFFFFFFF00000000l ) == 0) {
+ bs.writeBoolean(true);
+ bs.writeBoolean(false);
+ return 4;
+ } else {
+ bs.writeBoolean(true);
+ bs.writeBoolean(true);
+ return 8;
+ }
+ }
+ public void tightMarshalLong2(OpenWireFormat wireFormat, long o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ if( bs.readBoolean() ) {
+ dataOut.writeLong(o);
+ } else {
+ dataOut.writeInt((int) o);
+ }
+ } else {
+ if( bs.readBoolean() ) {
+ dataOut.writeShort((int) o);
+ }
+ }
+ }
+ public long tightUnmarshalLong(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ if( bs.readBoolean() ) {
+ return dataIn.readLong();
+ } else {
+ return dataIn.readInt();
+ }
+ } else {
+ if( bs.readBoolean() ) {
+ return dataIn.readShort();
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ protected DataStructure tightUnmarsalNestedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
+ return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
+ }
+ protected int tightMarshalNestedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
+ return wireFormat.tightMarshalNestedObject1(o, bs);
+ }
+
+ protected void tightMarshalNestedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
+ }
+
+ protected DataStructure tightUnmarsalCachedObject(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
+ if( wireFormat.isCacheEnabled() ) {
+ if( bs.readBoolean() ) {
+ short index = dataIn.readShort();
+ DataStructure object = wireFormat.tightUnmarshalNestedObject(dataIn, bs);
+ wireFormat.setInUnmarshallCache(index, object);
+ return object;
+ } else {
+ short index = dataIn.readShort();
+ return wireFormat.getFromUnmarshallCache(index);
+ }
+ } else {
+ return wireFormat.tightUnmarshalNestedObject(dataIn, bs);
+ }
+ }
+ protected int tightMarshalCachedObject1(OpenWireFormat wireFormat, DataStructure o, BooleanStream bs) throws IOException {
+ if( wireFormat.isCacheEnabled() ) {
+ Short index = wireFormat.getMarshallCacheIndex(o);
+ bs.writeBoolean(index == null);
+ if( index == null ) {
+ int rc = wireFormat.tightMarshalNestedObject1(o, bs);
+ wireFormat.addToMarshallCache(o);
+ return 2+rc;
+ } else {
+ return 2;
+ }
+ } else {
+ return wireFormat.tightMarshalNestedObject1(o, bs);
+ }
+ }
+ protected void tightMarshalCachedObject2(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( wireFormat.isCacheEnabled() ) {
+ Short index = wireFormat.getMarshallCacheIndex(o);
+ if( bs.readBoolean() ) {
+ dataOut.writeShort(index.shortValue());
+ wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
+ } else {
+ dataOut.writeShort(index.shortValue());
+ }
+ } else {
+ wireFormat.tightMarshalNestedObject2(o, dataOut, bs);
+ }
+ }
+
+ protected Throwable tightUnmarsalThrowable(OpenWireFormat wireFormat, DataInputStream dataIn, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ String clazz = tightUnmarshalString(dataIn, bs);
+ String message = tightUnmarshalString(dataIn, bs);
+ Throwable o = createThrowable(clazz, message);
+ if( wireFormat.isStackTraceEnabled() ) {
+ if( STACK_TRACE_ELEMENT_CONSTRUCTOR!=null) {
+ StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
+ for (int i = 0; i < ss.length; i++) {
+ try {
+ ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
+ tightUnmarshalString(dataIn, bs),
+ tightUnmarshalString(dataIn, bs),
+ tightUnmarshalString(dataIn, bs),
+ new Integer(dataIn.readInt())
+ });
+ } catch (IOException e) {
+ throw e;
+ } catch (Throwable e) {
+ }
+ }
+ o.setStackTrace(ss);
+ } else {
+ short size = dataIn.readShort();
+ for (int i = 0; i < size; i++) {
+ tightUnmarshalString(dataIn, bs);
+ tightUnmarshalString(dataIn, bs);
+ tightUnmarshalString(dataIn, bs);
+ dataIn.readInt();
+ }
+ }
+ o.initCause(tightUnmarsalThrowable(wireFormat, dataIn, bs));
+
+ }
+ return o;
+ } else {
+ return null;
+ }
+ }
+
+ private Throwable createThrowable(String className, String message) {
+ try {
+ Class clazz = ClassLoading.loadClass(className, BaseDataStreamMarshaller.class.getClassLoader());
+ Constructor constructor = clazz.getConstructor(new Class[]{String.class});
+ return (Throwable) constructor.newInstance(new Object[]{message});
+ } catch (Throwable e) {
+ return new Throwable(className+": "+message);
+ }
+ }
+
+ protected int tightMarshalThrowable1(OpenWireFormat wireFormat, Throwable o, BooleanStream bs) throws IOException {
+ if( o==null ) {
+ bs.writeBoolean(false);
+ return 0;
+ } else {
+ int rc=0;
+ bs.writeBoolean(true);
+ rc += tightMarshalString1(o.getClass().getName(), bs);
+ rc += tightMarshalString1(o.getMessage(), bs);
+ if( wireFormat.isStackTraceEnabled() ) {
+ rc += 2;
+ StackTraceElement[] stackTrace = o.getStackTrace();
+ for (int i = 0; i < stackTrace.length; i++) {
+ StackTraceElement element = stackTrace[i];
+ rc += tightMarshalString1(element.getClassName(), bs);
+ rc += tightMarshalString1(element.getMethodName(), bs);
+ rc += tightMarshalString1(element.getFileName(), bs);
+ rc += 4;
+ }
+ rc += tightMarshalThrowable1(wireFormat, o.getCause(), bs);
+ }
+ return rc;
+ }
+ }
+
+ protected void tightMarshalThrowable2(OpenWireFormat wireFormat, Throwable o, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ tightMarshalString2(o.getClass().getName(), dataOut, bs);
+ tightMarshalString2(o.getMessage(), dataOut, bs);
+ if( wireFormat.isStackTraceEnabled() ) {
+ StackTraceElement[] stackTrace = o.getStackTrace();
+ dataOut.writeShort(stackTrace.length);
+ for (int i = 0; i < stackTrace.length; i++) {
+ StackTraceElement element = stackTrace[i];
+ tightMarshalString2(element.getClassName(), dataOut, bs);
+ tightMarshalString2(element.getMethodName(), dataOut, bs);
+ tightMarshalString2(element.getFileName(), dataOut, bs);
+ dataOut.writeInt(element.getLineNumber());
+ }
+ tightMarshalThrowable2(wireFormat, o.getCause(), dataOut, bs);
+ }
+ }
+ }
+
+ protected String tightUnmarshalString(DataInputStream dataIn, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ if( bs.readBoolean() ) {
+ int size = dataIn.readShort();
+ byte data[] = new byte[size];
+ dataIn.readFully(data);
+ return new String(data,0); // Yes deprecated, but we know what we are doing.
+ } else {
+ return dataIn.readUTF();
+ }
+ } else {
+ return null;
+ }
+ }
+
+ protected int tightMarshalString1(String value, BooleanStream bs) throws IOException {
+ bs.writeBoolean(value!=null);
+ if( value!=null ) {
+
+ int strlen = value.length();
+ int utflen = 0;
+ char[] charr = new char[strlen];
+ int c, count = 0;
+ boolean isOnlyAscii=true;
+
+ value.getChars(0, strlen, charr, 0);
+
+ for (int i = 0; i < strlen; i++) {
+ c = charr[i];
+ if ((c >= 0x0001) && (c <= 0x007F)) {
+ utflen++;
+ } else if (c > 0x07FF) {
+ utflen += 3;
+ isOnlyAscii=false;
+ } else {
+ isOnlyAscii=false;
+ utflen += 2;
+ }
+ }
+
+ if( utflen >= Short.MAX_VALUE )
+ throw new IOException("Encountered a String value that is too long to encode.");
+
+ bs.writeBoolean(isOnlyAscii);
+ return utflen+2;
+
+ } else {
+ return 0;
+ }
+ }
+
+ protected void tightMarshalString2(String value, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ // If we verified it only holds ascii values
+ if( bs.readBoolean() ) {
+ dataOut.writeShort(value.length());
+ dataOut.writeBytes(value);
+ } else {
+ dataOut.writeUTF(value);
+ }
+ }
+ }
+
+ protected int tightMarshalObjectArray1(OpenWireFormat wireFormat, DataStructure[] objects, BooleanStream bs) throws IOException {
+ if( objects != null ) {
+ int rc=0;
+ bs.writeBoolean(true);
+ rc += 2;
+ for( int i=0; i < objects.length; i++ ) {
+ rc += tightMarshalNestedObject1(wireFormat,objects[i], bs);
+ }
+ return rc;
+ } else {
+ bs.writeBoolean(false);
+ return 0;
+ }
+ }
+
+ protected void tightMarshalObjectArray2(OpenWireFormat wireFormat, DataStructure[] objects, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ) {
+ dataOut.writeShort(objects.length);
+ for( int i=0; i < objects.length; i++ ) {
+ tightMarshalNestedObject2(wireFormat,objects[i], dataOut, bs);
+ }
+ }
+ }
+
+ protected int tightMarshalConstByteArray1(byte[] data, BooleanStream bs, int i) throws IOException {
+ return i;
+ }
+ protected void tightMarshalConstByteArray2(byte[] data, DataOutputStream dataOut, BooleanStream bs, int i) throws IOException {
+ dataOut.write(data, 0, i);
+ }
+
+ protected byte[] tightUnmarshalConstByteArray(DataInputStream dataIn, BooleanStream bs, int i) throws IOException {
+ byte data[] = new byte[i];
+ dataIn.readFully(data);
+ return data;
+ }
+
+ protected int tightMarshalByteArray1(byte[] data, BooleanStream bs) throws IOException {
+ bs.writeBoolean(data!=null);
+ if( data!=null ){
+ return data.length+4;
+ } else {
+ return 0;
+ }
+ }
+
+ protected void tightMarshalByteArray2(byte[] data, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ){
+ dataOut.writeInt(data.length);
+ dataOut.write(data);
+ }
+ }
+
+ protected byte[] tightUnmarshalByteArray(DataInputStream dataIn, BooleanStream bs) throws IOException {
+ byte rc[]=null;
+ if( bs.readBoolean() ) {
+ int size = dataIn.readInt();
+ rc = new byte[size];
+ dataIn.readFully(rc);
+ }
+ return rc;
+ }
+
+ protected int tightMarshalByteSequence1(ByteSequence data, BooleanStream bs) throws IOException {
+ bs.writeBoolean(data!=null);
+ if( data!=null ){
+ return data.getLength()+4;
+ } else {
+ return 0;
+ }
+ }
+
+ protected void tightMarshalByteSequence2(ByteSequence data, DataOutputStream dataOut, BooleanStream bs) throws IOException {
+ if( bs.readBoolean() ){
+ dataOut.writeInt(data.getLength());
+ dataOut.write(data.getData(), data.getOffset(), data.getLength());
+ }
+ }
+
+ protected ByteSequence tightUnmarshalByteSequence(DataInputStream dataIn, BooleanStream bs) throws IOException {
+ ByteSequence rc=null;
+ if( bs.readBoolean() ) {
+ int size = dataIn.readInt();
+ byte[] t = new byte[size];
+ dataIn.readFully(t);
+ return new ByteSequence(t, 0, size);
+ }
+ return rc;
+ }
+
+ //
+ // The loose marshaling logic
+ //
+
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+ }
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ }
+
+ public void looseMarshalLong(OpenWireFormat wireFormat, long o, DataOutputStream dataOut) throws IOException {
+ dataOut.writeLong(o);
+ }
+ public long looseUnmarshalLong(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
+ return dataIn.readLong();
+ }
+
+ protected DataStructure looseUnmarsalNestedObject(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
+ return wireFormat.looseUnmarshalNestedObject(dataIn);
+ }
+ protected void looseMarshalNestedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut) throws IOException {
+ wireFormat.looseMarshalNestedObject(o, dataOut);
+ }
+
+ protected DataStructure looseUnmarsalCachedObject(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
+ if( wireFormat.isCacheEnabled() ) {
+ if( dataIn.readBoolean() ) {
+ short index = dataIn.readShort();
+ DataStructure object = wireFormat.looseUnmarshalNestedObject(dataIn);
+ wireFormat.setInUnmarshallCache(index, object);
+ return object;
+ } else {
+ short index = dataIn.readShort();
+ return wireFormat.getFromUnmarshallCache(index);
+ }
+ } else {
+ return wireFormat.looseUnmarshalNestedObject(dataIn);
+ }
+ }
+ protected void looseMarshalCachedObject(OpenWireFormat wireFormat, DataStructure o, DataOutputStream dataOut) throws IOException {
+ if( wireFormat.isCacheEnabled() ) {
+ Short index = wireFormat.getMarshallCacheIndex(o);
+ dataOut.writeBoolean(index == null);
+ if( index == null ) {
+ index = wireFormat.addToMarshallCache(o);
+ dataOut.writeShort(index.shortValue());
+ wireFormat.looseMarshalNestedObject(o, dataOut);
+ } else {
+ dataOut.writeShort(index.shortValue());
+ }
+ } else {
+ wireFormat.looseMarshalNestedObject(o, dataOut);
+ }
+ }
+
+ protected Throwable looseUnmarsalThrowable(OpenWireFormat wireFormat, DataInputStream dataIn) throws IOException {
+ if( dataIn.readBoolean() ) {
+ String clazz = looseUnmarshalString(dataIn);
+ String message = looseUnmarshalString(dataIn);
+ Throwable o = createThrowable(clazz, message);
+ if( wireFormat.isStackTraceEnabled() ) {
+ if( STACK_TRACE_ELEMENT_CONSTRUCTOR!=null) {
+ StackTraceElement ss[] = new StackTraceElement[dataIn.readShort()];
+ for (int i = 0; i < ss.length; i++) {
+ try {
+ ss[i] = (StackTraceElement) STACK_TRACE_ELEMENT_CONSTRUCTOR.newInstance(new Object[]{
+ looseUnmarshalString(dataIn),
+ looseUnmarshalString(dataIn),
+ looseUnmarshalString(dataIn),
+ new Integer(dataIn.readInt())
+ });
+ } catch (IOException e) {
+ throw e;
+ } catch (Throwable e) {
+ }
+ }
+ o.setStackTrace(ss);
+ } else {
+ short size = dataIn.readShort();
+ for (int i = 0; i < size; i++) {
+ looseUnmarshalString(dataIn);
+ looseUnmarshalString(dataIn);
+ looseUnmarshalString(dataIn);
+ dataIn.readInt();
+ }
+ }
+ o.initCause(looseUnmarsalThrowable(wireFormat, dataIn));
+
+ }
+ return o;
+ } else {
+ return null;
+ }
+ }
+
+
+ protected void looseMarshalThrowable(OpenWireFormat wireFormat, Throwable o, DataOutputStream dataOut) throws IOException {
+ dataOut.writeBoolean(o!=null);
+ if( o!=null ) {
+ looseMarshalString(o.getClass().getName(), dataOut);
+ looseMarshalString(o.getMessage(), dataOut);
+ if( wireFormat.isStackTraceEnabled() ) {
+ StackTraceElement[] stackTrace = o.getStackTrace();
+ dataOut.writeShort(stackTrace.length);
+ for (int i = 0; i < stackTrace.length; i++) {
+ StackTraceElement element = stackTrace[i];
+ looseMarshalString(element.getClassName(), dataOut);
+ looseMarshalString(element.getMethodName(), dataOut);
+ looseMarshalString(element.getFileName(), dataOut);
+ dataOut.writeInt(element.getLineNumber());
+ }
+ looseMarshalThrowable(wireFormat, o.getCause(), dataOut);
+ }
+ }
+ }
+
+ protected String looseUnmarshalString(DataInputStream dataIn) throws IOException {
+ if( dataIn.readBoolean() ) {
+ return dataIn.readUTF();
+ } else {
+ return null;
+ }
+ }
+
+ protected void looseMarshalString(String value, DataOutputStream dataOut) throws IOException {
+ dataOut.writeBoolean(value!=null);
+ if( value!=null ) {
+ dataOut.writeUTF(value);
+ }
+ }
+
+ protected void looseMarshalObjectArray(OpenWireFormat wireFormat, DataStructure[] objects, DataOutputStream dataOut) throws IOException {
+ dataOut.writeBoolean(objects!=null);
+ if( objects!=null ) {
+ dataOut.writeShort(objects.length);
+ for( int i=0; i < objects.length; i++ ) {
+ looseMarshalNestedObject(wireFormat,objects[i], dataOut);
+ }
+ }
+ }
+
+ protected void looseMarshalConstByteArray(OpenWireFormat wireFormat, byte[] data, DataOutputStream dataOut, int i) throws IOException {
+ dataOut.write(data, 0, i);
+ }
+
+ protected byte[] looseUnmarshalConstByteArray(DataInputStream dataIn, int i) throws IOException {
+ byte data[] = new byte[i];
+ dataIn.readFully(data);
+ return data;
+ }
+
+ protected void looseMarshalByteArray(OpenWireFormat wireFormat, byte[] data, DataOutputStream dataOut) throws IOException {
+ dataOut.writeBoolean(data!=null);
+ if( data!=null ){
+ dataOut.writeInt(data.length);
+ dataOut.write(data);
+ }
+ }
+
+ protected byte[] looseUnmarshalByteArray(DataInputStream dataIn) throws IOException {
+ byte rc[]=null;
+ if( dataIn.readBoolean() ) {
+ int size = dataIn.readInt();
+ rc = new byte[size];
+ dataIn.readFully(rc);
+ }
+ return rc;
+ }
+
+ protected void looseMarshalByteSequence(OpenWireFormat wireFormat, ByteSequence data, DataOutputStream dataOut) throws IOException {
+ dataOut.writeBoolean(data!=null);
+ if( data!=null ){
+ dataOut.writeInt(data.getLength());
+ dataOut.write(data.getData(), data.getOffset(), data.getLength());
+ }
+ }
+
+ protected ByteSequence looseUnmarshalByteSequence(DataInputStream dataIn) throws IOException {
+ ByteSequence rc=null;
+ if( dataIn.readBoolean() ) {
+ int size = dataIn.readInt();
+ byte[] t = new byte[size];
+ dataIn.readFully(t);
+ rc = new ByteSequence(t, 0, size);
+ }
+ return rc;
+ }
+}
Propchange: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BaseDataStreamMarshaller.java
------------------------------------------------------------------------------
svn:executable = *
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerIdMarshaller.java Tue Feb 28 22:29:45 2006
@@ -36,7 +36,7 @@
*
* @version $Revision$
*/
-public class BrokerIdMarshaller extends DataStreamMarshaller {
+public class BrokerIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
@@ -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);
BrokerId info = (BrokerId)o;
- info.setValue(readString(dataIn, bs));
+ info.setValue(tightUnmarshalString(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 {
BrokerId info = (BrokerId)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += writeString(info.getValue(), bs);
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalString1(info.getValue(), 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);
BrokerId info = (BrokerId)o;
- writeString(info.getValue(), dataOut, bs);
+ tightMarshalString2(info.getValue(), dataOut, bs);
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ BrokerId info = (BrokerId)o;
+ info.setValue(looseUnmarshalString(dataIn));
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ BrokerId info = (BrokerId)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalString(info.getValue(), dataOut);
}
}
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/BrokerInfoMarshaller.java Tue Feb 28 22:29:45 2006
@@ -60,25 +60,25 @@
* @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);
BrokerInfo info = (BrokerInfo)o;
- info.setBrokerId((BrokerId) unmarsalCachedObject(wireFormat, dataIn, bs));
- info.setBrokerURL(readString(dataIn, bs));
+ info.setBrokerId((BrokerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setBrokerURL(tightUnmarshalString(dataIn, bs));
if (bs.readBoolean()) {
short size = dataIn.readShort();
BrokerInfo value[] = new BrokerInfo[size];
for( int i=0; i < size; i++ ) {
- value[i] = (BrokerInfo) unmarsalNestedObject(wireFormat,dataIn, bs);
+ value[i] = (BrokerInfo) tightUnmarsalNestedObject(wireFormat,dataIn, bs);
}
info.setPeerBrokerInfos(value);
}
else {
info.setPeerBrokerInfos(null);
}
- info.setBrokerName(readString(dataIn, bs));
+ info.setBrokerName(tightUnmarshalString(dataIn, bs));
info.setSlaveBroker(bs.readBoolean());
}
@@ -87,16 +87,16 @@
/**
* Write the booleans that this object uses to a BooleanStream
*/
- public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
+ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
BrokerInfo info = (BrokerInfo)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += marshal1CachedObject(wireFormat, info.getBrokerId(), bs);
- rc += writeString(info.getBrokerURL(), bs);
- rc += marshalObjectArray(wireFormat, info.getPeerBrokerInfos(), bs);
- rc += writeString(info.getBrokerName(), bs);
- bs.writeBoolean(info.isSlaveBroker());
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalCachedObject1(wireFormat, info.getBrokerId(), bs);
+ rc += tightMarshalString1(info.getBrokerURL(), bs);
+ rc += tightMarshalObjectArray1(wireFormat, info.getPeerBrokerInfos(), bs);
+ rc += tightMarshalString1(info.getBrokerName(), bs);
+ bs.writeBoolean(info.isSlaveBroker());
return rc + 0;
}
@@ -108,15 +108,62 @@
* @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);
BrokerInfo info = (BrokerInfo)o;
- marshal2CachedObject(wireFormat, info.getBrokerId(), dataOut, bs);
- writeString(info.getBrokerURL(), dataOut, bs);
- marshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
- writeString(info.getBrokerName(), dataOut, bs);
- bs.readBoolean();
+ tightMarshalCachedObject2(wireFormat, info.getBrokerId(), dataOut, bs);
+ tightMarshalString2(info.getBrokerURL(), dataOut, bs);
+ tightMarshalObjectArray2(wireFormat, info.getPeerBrokerInfos(), dataOut, bs);
+ tightMarshalString2(info.getBrokerName(), dataOut, bs);
+ bs.readBoolean();
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ BrokerInfo info = (BrokerInfo)o;
+ info.setBrokerId((BrokerId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setBrokerURL(looseUnmarshalString(dataIn));
+
+ if (dataIn.readBoolean()) {
+ short size = dataIn.readShort();
+ BrokerInfo value[] = new BrokerInfo[size];
+ for( int i=0; i < size; i++ ) {
+ value[i] = (BrokerInfo) looseUnmarsalNestedObject(wireFormat,dataIn);
+ }
+ info.setPeerBrokerInfos(value);
+ }
+ else {
+ info.setPeerBrokerInfos(null);
+ }
+ info.setBrokerName(looseUnmarshalString(dataIn));
+ info.setSlaveBroker(dataIn.readBoolean());
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ BrokerInfo info = (BrokerInfo)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalCachedObject(wireFormat, info.getBrokerId(), dataOut);
+ looseMarshalString(info.getBrokerURL(), dataOut);
+ looseMarshalObjectArray(wireFormat, info.getPeerBrokerInfos(), dataOut);
+ looseMarshalString(info.getBrokerName(), dataOut);
+ dataOut.writeBoolean(info.isSlaveBroker());
}
}
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionErrorMarshaller.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);
ConnectionError info = (ConnectionError)o;
- info.setException((Throwable) unmarsalThrowable(wireFormat, dataIn, bs));
- info.setConnectionId((ConnectionId) unmarsalNestedObject(wireFormat, dataIn, bs));
+ info.setException((Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs));
+ info.setConnectionId((ConnectionId) tightUnmarsalNestedObject(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 {
ConnectionError info = (ConnectionError)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += marshalThrowable(wireFormat, info.getException(), bs);
- rc += marshal1NestedObject(wireFormat, info.getConnectionId(), bs);
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalThrowable1(wireFormat, info.getException(), bs);
+ rc += tightMarshalNestedObject1(wireFormat, info.getConnectionId(), 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);
ConnectionError info = (ConnectionError)o;
- marshalThrowable(wireFormat, info.getException(), dataOut, bs);
- marshal2NestedObject(wireFormat, info.getConnectionId(), dataOut, bs);
+ tightMarshalThrowable2(wireFormat, info.getException(), dataOut, bs);
+ tightMarshalNestedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ ConnectionError info = (ConnectionError)o;
+ info.setException((Throwable) looseUnmarsalThrowable(wireFormat, dataIn));
+ info.setConnectionId((ConnectionId) looseUnmarsalNestedObject(wireFormat, dataIn));
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ ConnectionError info = (ConnectionError)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalThrowable(wireFormat, info.getException(), dataOut);
+ looseMarshalNestedObject(wireFormat, info.getConnectionId(), dataOut);
}
}
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionIdMarshaller.java Tue Feb 28 22:29:45 2006
@@ -36,7 +36,7 @@
*
* @version $Revision$
*/
-public class ConnectionIdMarshaller extends DataStreamMarshaller {
+public class ConnectionIdMarshaller extends BaseDataStreamMarshaller {
/**
* Return the type of Data Structure we marshal
@@ -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);
ConnectionId info = (ConnectionId)o;
- info.setValue(readString(dataIn, bs));
+ info.setValue(tightUnmarshalString(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 {
ConnectionId info = (ConnectionId)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += writeString(info.getValue(), bs);
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalString1(info.getValue(), 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);
ConnectionId info = (ConnectionId)o;
- writeString(info.getValue(), dataOut, bs);
+ tightMarshalString2(info.getValue(), dataOut, bs);
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ ConnectionId info = (ConnectionId)o;
+ info.setValue(looseUnmarshalString(dataIn));
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ ConnectionId info = (ConnectionId)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalString(info.getValue(), dataOut);
}
}
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConnectionInfoMarshaller.java Tue Feb 28 22:29:45 2006
@@ -60,20 +60,20 @@
* @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);
ConnectionInfo info = (ConnectionInfo)o;
- info.setConnectionId((ConnectionId) unmarsalCachedObject(wireFormat, dataIn, bs));
- info.setClientId(readString(dataIn, bs));
- info.setPassword(readString(dataIn, bs));
- info.setUserName(readString(dataIn, bs));
+ info.setConnectionId((ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs));
+ info.setClientId(tightUnmarshalString(dataIn, bs));
+ info.setPassword(tightUnmarshalString(dataIn, bs));
+ info.setUserName(tightUnmarshalString(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);
}
@@ -87,16 +87,16 @@
/**
* Write the booleans that this object uses to a BooleanStream
*/
- public int marshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
+ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException {
ConnectionInfo info = (ConnectionInfo)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += marshal1CachedObject(wireFormat, info.getConnectionId(), bs);
- rc += writeString(info.getClientId(), bs);
- rc += writeString(info.getPassword(), bs);
- rc += writeString(info.getUserName(), bs);
- rc += marshalObjectArray(wireFormat, info.getBrokerPath(), bs);
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalCachedObject1(wireFormat, info.getConnectionId(), bs);
+ rc += tightMarshalString1(info.getClientId(), bs);
+ rc += tightMarshalString1(info.getPassword(), bs);
+ rc += tightMarshalString1(info.getUserName(), bs);
+ rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs);
return rc + 0;
}
@@ -108,15 +108,62 @@
* @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);
ConnectionInfo info = (ConnectionInfo)o;
- marshal2CachedObject(wireFormat, info.getConnectionId(), dataOut, bs);
- writeString(info.getClientId(), dataOut, bs);
- writeString(info.getPassword(), dataOut, bs);
- writeString(info.getUserName(), dataOut, bs);
- marshalObjectArray(wireFormat, info.getBrokerPath(), dataOut, bs);
+ tightMarshalCachedObject2(wireFormat, info.getConnectionId(), dataOut, bs);
+ tightMarshalString2(info.getClientId(), dataOut, bs);
+ tightMarshalString2(info.getPassword(), dataOut, bs);
+ tightMarshalString2(info.getUserName(), dataOut, bs);
+ tightMarshalObjectArray2(wireFormat, info.getBrokerPath(), dataOut, bs);
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ ConnectionInfo info = (ConnectionInfo)o;
+ info.setConnectionId((ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn));
+ info.setClientId(looseUnmarshalString(dataIn));
+ info.setPassword(looseUnmarshalString(dataIn));
+ info.setUserName(looseUnmarshalString(dataIn));
+
+ if (dataIn.readBoolean()) {
+ short size = dataIn.readShort();
+ BrokerId value[] = new BrokerId[size];
+ for( int i=0; i < size; i++ ) {
+ value[i] = (BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn);
+ }
+ info.setBrokerPath(value);
+ }
+ else {
+ info.setBrokerPath(null);
+ }
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ ConnectionInfo info = (ConnectionInfo)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalCachedObject(wireFormat, info.getConnectionId(), dataOut);
+ looseMarshalString(info.getClientId(), dataOut);
+ looseMarshalString(info.getPassword(), dataOut);
+ looseMarshalString(info.getUserName(), dataOut);
+ looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
}
}
Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java?rev=381926&r1=381925&r2=381926&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/v1/ConsumerIdMarshaller.java Tue Feb 28 22:29:45 2006
@@ -36,7 +36,7 @@
*
* @version $Revision$
*/
-public class ConsumerIdMarshaller extends DataStreamMarshaller {
+public class ConsumerIdMarshaller 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);
ConsumerId info = (ConsumerId)o;
- info.setConnectionId(readString(dataIn, bs));
- info.setSessionId(unmarshalLong(wireFormat, dataIn, bs));
- info.setValue(unmarshalLong(wireFormat, dataIn, bs));
+ info.setConnectionId(tightUnmarshalString(dataIn, bs));
+ info.setSessionId(tightUnmarshalLong(wireFormat, dataIn, bs));
+ info.setValue(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 {
ConsumerId info = (ConsumerId)o;
- int rc = super.marshal1(wireFormat, o, bs);
- rc += writeString(info.getConnectionId(), bs);
- rc+=marshal1Long(wireFormat, info.getSessionId(), bs);
- rc+=marshal1Long(wireFormat, info.getValue(), bs);
+ int rc = super.tightMarshal1(wireFormat, o, bs);
+ rc += tightMarshalString1(info.getConnectionId(), bs);
+ rc+=tightMarshalLong1(wireFormat, info.getSessionId(), bs);
+ rc+=tightMarshalLong1(wireFormat, info.getValue(), 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);
ConsumerId info = (ConsumerId)o;
- writeString(info.getConnectionId(), dataOut, bs);
- marshal2Long(wireFormat, info.getSessionId(), dataOut, bs);
- marshal2Long(wireFormat, info.getValue(), dataOut, bs);
+ tightMarshalString2(info.getConnectionId(), dataOut, bs);
+ tightMarshalLong2(wireFormat, info.getSessionId(), dataOut, bs);
+ tightMarshalLong2(wireFormat, info.getValue(), dataOut, bs);
+
+ }
+
+ /**
+ * Un-marshal an object instance from the data input stream
+ *
+ * @param o the object to un-marshal
+ * @param dataIn the data input stream to build the object from
+ * @throws IOException
+ */
+ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInputStream dataIn) throws IOException {
+ super.looseUnmarshal(wireFormat, o, dataIn);
+
+ ConsumerId info = (ConsumerId)o;
+ info.setConnectionId(looseUnmarshalString(dataIn));
+ info.setSessionId(looseUnmarshalLong(wireFormat, dataIn));
+ info.setValue(looseUnmarshalLong(wireFormat, dataIn));
+
+ }
+
+
+ /**
+ * Write the booleans that this object uses to a BooleanStream
+ */
+ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutputStream dataOut) throws IOException {
+
+ ConsumerId info = (ConsumerId)o;
+
+ super.looseMarshal(wireFormat, o, dataOut);
+ looseMarshalString(info.getConnectionId(), dataOut);
+ looseMarshalLong(wireFormat, info.getSessionId(), dataOut);
+ looseMarshalLong(wireFormat, info.getValue(), dataOut);
}
}