activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r777212 - in /activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb: DestinationEntity.java Marshallers.java MessageKeys.java RootEntity.java
Date Thu, 21 May 2009 18:36:26 GMT
Author: chirino
Date: Thu May 21 18:36:24 2009
New Revision: 777212

URL: http://svn.apache.org/viewvc?rev=777212&view=rev
Log:
Updating store bits to pickup latest interface updates of the kahadb module

Modified:
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/DestinationEntity.java
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/Marshallers.java
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/MessageKeys.java
    activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/RootEntity.java

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/DestinationEntity.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/DestinationEntity.java?rev=777212&r1=777211&r2=777212&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/DestinationEntity.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/DestinationEntity.java
Thu May 21 18:36:24 2009
@@ -37,14 +37,11 @@
 import org.apache.kahadb.page.Transaction;
 import org.apache.kahadb.util.LongMarshaller;
 import org.apache.kahadb.util.Marshaller;
+import org.apache.kahadb.util.VariableMarshaller;
 
 public class DestinationEntity {
 
-    public final static Marshaller<DestinationEntity> MARSHALLER = new Marshaller<DestinationEntity>()
{
-
-        public Class<DestinationEntity> getType() {
-            return DestinationEntity.class;
-        }
+    public final static Marshaller<DestinationEntity> MARSHALLER = new VariableMarshaller<DestinationEntity>()
{
 
         public DestinationEntity readPayload(DataInput dataIn) throws IOException {
             DestinationEntity value = new DestinationEntity();
@@ -61,14 +58,10 @@
             Marshallers.QUEUE_DESCRIPTOR_MARSHALLER.writePayload(value.descriptor, dataOut);
             dataOut.writeLong(value.metaData.getPageId());
         }
-    };
 
-    public final static Marshaller<DestinationMetaData> META_DATA_MARSHALLER = new
Marshaller<DestinationMetaData>() {
-
-        public Class<DestinationMetaData> getType() {
-            return DestinationMetaData.class;
-        }
+    };
 
+    public final static Marshaller<DestinationMetaData> META_DATA_MARSHALLER = new
VariableMarshaller<DestinationMetaData>() {
         public DestinationMetaData readPayload(DataInput dataIn) throws IOException {
             DestinationMetaData value = new DestinationMetaData();
             value.count = dataIn.readInt();

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/Marshallers.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/Marshallers.java?rev=777212&r1=777211&r2=777212&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/Marshallers.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/Marshallers.java
Thu May 21 18:36:24 2009
@@ -26,14 +26,11 @@
 import org.apache.activemq.queue.QueueStore;
 import org.apache.kahadb.journal.Location;
 import org.apache.kahadb.util.Marshaller;
+import org.apache.kahadb.util.VariableMarshaller;
 
 public class Marshallers {
 
-    public final static Marshaller<QueueRecord> QUEUE_RECORD_MARSHALLER = new Marshaller<QueueRecord>()
{
-
-        public Class<QueueRecord> getType() {
-            return QueueRecord.class;
-        }
+    public final static Marshaller<QueueRecord> QUEUE_RECORD_MARSHALLER = new VariableMarshaller<QueueRecord>()
{
 
         public QueueRecord readPayload(DataInput dataIn) throws IOException {
             QueueRecord rc = new QueueRecord();
@@ -72,10 +69,6 @@
 
     public final static Marshaller<Location> LOCATION_MARSHALLER = new Marshaller<Location>()
{
 
-        public Class<Location> getType() {
-            return Location.class;
-        }
-
         public Location readPayload(DataInput dataIn) throws IOException {
             Location rc = new Location();
             rc.setDataFileId(dataIn.readInt());
@@ -87,14 +80,23 @@
             dataOut.writeInt(object.getDataFileId());
             dataOut.writeInt(object.getOffset());
         }
-    };
 
-    public final static Marshaller<AsciiBuffer> ASCII_BUFFER_MARSHALLER = new Marshaller<AsciiBuffer>()
{
+        public boolean isDeepCopySupported() {
+            return true;
+        }
+
+        public Location deepCopy(Location source) {
+            return new Location(source);
+        }
 
-        public Class<AsciiBuffer> getType() {
-            return AsciiBuffer.class;
+        public int getFixedSize() {
+            return 8;
         }
 
+    };
+
+    public final static Marshaller<AsciiBuffer> ASCII_BUFFER_MARSHALLER = new VariableMarshaller<AsciiBuffer>()
{
+
         public AsciiBuffer readPayload(DataInput dataIn) throws IOException {
             byte data[] = new byte[dataIn.readShort()];
             dataIn.readFully(data);
@@ -107,11 +109,7 @@
         }
     };
 
-    public final static Marshaller<Buffer> BUFFER_MARSHALLER = new Marshaller<Buffer>()
{
-
-        public Class<Buffer> getType() {
-            return Buffer.class;
-        }
+    public final static Marshaller<Buffer> BUFFER_MARSHALLER = new VariableMarshaller<Buffer>()
{
 
         public Buffer readPayload(DataInput dataIn) throws IOException {
             byte data[] = new byte[dataIn.readShort()];
@@ -125,11 +123,7 @@
         }
     };
 
-    public final static Marshaller<QueueStore.QueueDescriptor> QUEUE_DESCRIPTOR_MARSHALLER
= new Marshaller<QueueStore.QueueDescriptor>() {
-
-        public Class<QueueStore.QueueDescriptor> getType() {
-            return QueueStore.QueueDescriptor.class;
-        }
+    public final static Marshaller<QueueStore.QueueDescriptor> QUEUE_DESCRIPTOR_MARSHALLER
= new VariableMarshaller<QueueStore.QueueDescriptor>() {
 
         public QueueStore.QueueDescriptor readPayload(DataInput dataIn) throws IOException
{
             QueueStore.QueueDescriptor descriptor = new QueueStore.QueueDescriptor();

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/MessageKeys.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/MessageKeys.java?rev=777212&r1=777211&r2=777212&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/MessageKeys.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/MessageKeys.java
Thu May 21 18:36:24 2009
@@ -23,6 +23,7 @@
 import org.apache.activemq.protobuf.AsciiBuffer;
 import org.apache.kahadb.journal.Location;
 import org.apache.kahadb.util.Marshaller;
+import org.apache.kahadb.util.VariableMarshaller;
 
 public class MessageKeys {
 
@@ -39,11 +40,7 @@
         return "["+messageId+","+location+"]";
     }
     
-    public static final Marshaller<MessageKeys> MARSHALLER = new Marshaller<MessageKeys>()
{
-        public Class<MessageKeys> getType() {
-            return MessageKeys.class;
-        }
-
+    public static final Marshaller<MessageKeys> MARSHALLER = new VariableMarshaller<MessageKeys>()
{
         public MessageKeys readPayload(DataInput dataIn) throws IOException {
             Location location = Marshallers.LOCATION_MARSHALLER.readPayload(dataIn);
             byte data[] = new byte[dataIn.readShort()];

Modified: activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/RootEntity.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/RootEntity.java?rev=777212&r1=777211&r2=777212&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/RootEntity.java
(original)
+++ activemq/sandbox/activemq-flow/src/main/java/org/apache/activemq/broker/store/kahadb/RootEntity.java
Thu May 21 18:36:24 2009
@@ -37,14 +37,11 @@
 import org.apache.kahadb.page.Transaction;
 import org.apache.kahadb.util.LongMarshaller;
 import org.apache.kahadb.util.Marshaller;
+import org.apache.kahadb.util.VariableMarshaller;
 
 public class RootEntity {
 
-    public final static Marshaller<RootEntity> MARSHALLER = new Marshaller<RootEntity>()
{
-        public Class<RootEntity> getType() {
-            return RootEntity.class;
-        }
-
+    public final static Marshaller<RootEntity> MARSHALLER = new VariableMarshaller<RootEntity>()
{
         public RootEntity readPayload(DataInput is) throws IOException {
             RootEntity rc = new RootEntity();
             rc.state = is.readInt();



Mime
View raw message