activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r789439 - in /activemq/sandbox/activemq-flow: activemq-broker/src/main/java/org/apache/activemq/apollo/broker/ activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/ activemq-util/src/main/java/org/apache/activemq/util/ active...
Date Mon, 29 Jun 2009 20:42:42 GMT
Author: chirino
Date: Mon Jun 29 20:42:42 2009
New Revision: 789439

URL: http://svn.apache.org/viewvc?rev=789439&view=rev
Log:
consolidating more of the util classes.  


Added:
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/URIEditor.java
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java
      - copied, changed from r789377, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayInputStream.java
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java
      - copied, changed from r789377, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayOutputStream.java
Removed:
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/
Modified:
    activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Transaction.java
    activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
    activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java
    activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java
    activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
    activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/PageFile.java
    activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java

Modified: activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Transaction.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Transaction.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Transaction.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-broker/src/main/java/org/apache/activemq/apollo/broker/Transaction.java
Mon Jun 29 20:42:42 2009
@@ -346,9 +346,13 @@
         private final Buffer toBytes() {
             AsciiBuffer queueName = queue.getDescriptor().getQueueName();
             DataByteArrayOutputStream baos = new DataByteArrayOutputStream(2 + queueName.length
+ 8);
-            baos.writeShort(queueName.length);
-            baos.write(queueName.data, queueName.offset, queueName.length);
-            baos.writeLong(queueSequence);
+            try {
+				baos.writeShort(queueName.length);
+				baos.write(queueName.data, queueName.offset, queueName.length);
+				baos.writeLong(queueSequence);
+			} catch (IOException shouldNotHappen) {
+				throw new RuntimeException(shouldNotHappen);
+			}
             return baos.toByteSequence();
         }
 

Modified: activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-kaha/src/main/java/org/apache/activemq/broker/store/kahadb/KahaDBStore.java
Mon Jun 29 20:42:42 2009
@@ -62,6 +62,8 @@
 import org.apache.activemq.util.LockFile;
 import org.apache.activemq.util.buffer.AsciiBuffer;
 import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.DataByteArrayInputStream;
+import org.apache.activemq.util.buffer.DataByteArrayOutputStream;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.kahadb.journal.Journal;
@@ -69,8 +71,6 @@
 import org.apache.kahadb.page.Page;
 import org.apache.kahadb.page.PageFile;
 import org.apache.kahadb.page.Transaction;
-import org.apache.kahadb.util.DataByteArrayInputStream;
-import org.apache.kahadb.util.DataByteArrayOutputStream;
 
 public class KahaDBStore implements Store {
 

Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java
Mon Jun 29 20:42:42 2009
@@ -19,8 +19,6 @@
 
 import java.util.ArrayList;
 
-import org.apache.kahadb.util.IntrospectionSupport;
-
 /**
  * Support utility that can be used to set the properties on any object
  * using command line arguments.

Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/URIEditor.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/URIEditor.java?rev=789439&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/URIEditor.java
(added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/URIEditor.java
Mon Jun 29 20:42:42 2009
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.util;
+
+import java.beans.PropertyEditorSupport;
+import java.net.URI;
+
+public class URIEditor extends PropertyEditorSupport {
+
+    public String getJavaInitializationString() {
+        return "new java.net.URI(\""+getAsText()+"\")";
+    }
+
+    public String getAsText() {
+       return ((URI)getValue()).toString();
+    }
+
+    public void setAsText(String text) throws java.lang.IllegalArgumentException {
+    	try {
+			setValue(new URI(text));
+		} catch (Exception e) {
+            throw new java.lang.IllegalArgumentException(text);
+		}
+    }
+
+}

Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java
(from r789377, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayInputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayInputStream.java&r1=789377&r2=789439&rev=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayInputStream.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java
Mon Jun 29 20:42:42 2009
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kahadb.util;
+package org.apache.activemq.util.buffer;
 
 import java.io.DataInput;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UTFDataFormatException;
 
-import org.apache.activemq.util.buffer.Buffer;
 
 /**
  * Optimized ByteArrayInputStream that can be used more than once

Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java
(from r789377, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayOutputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayOutputStream.java&r1=789377&r2=789439&rev=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DataByteArrayOutputStream.java
(original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java
Mon Jun 29 20:42:42 2009
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kahadb.util;
+package org.apache.activemq.util.buffer;
 
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.UTFDataFormatException;
 
-import org.apache.activemq.util.buffer.Buffer;
 
 /**
  * Optimized ByteArrayOutputStream

Modified: activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java
(original)
+++ activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.java
Mon Jun 29 20:42:42 2009
@@ -26,9 +26,9 @@
 
 import org.apache.activemq.util.IOHelper;
 import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.DataByteArrayOutputStream;
 import org.apache.activemq.util.list.LinkedNode;
 import org.apache.activemq.util.list.LinkedNodeList;
-import org.apache.kahadb.util.DataByteArrayOutputStream;
 
 /**
  * An optimized writer to do batch appends to a data file. This object is thread

Modified: activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
(original)
+++ activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/Journal.java
Mon Jun 29 20:42:42 2009
@@ -37,12 +37,12 @@
 
 import org.apache.activemq.util.Scheduler;
 import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.DataByteArrayInputStream;
 import org.apache.activemq.util.list.LinkedNodeList;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.kahadb.journal.DataFileAppender.WriteCommand;
 import org.apache.kahadb.journal.DataFileAppender.WriteKey;
-import org.apache.kahadb.util.DataByteArrayInputStream;
 
 /**
  * Manages DataFiles

Modified: activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/PageFile.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/PageFile.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/PageFile.java
(original)
+++ activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/PageFile.java
Mon Jun 29 20:42:42 2009
@@ -42,13 +42,13 @@
 import java.util.zip.Checksum;
 
 import org.apache.activemq.util.IOHelper;
+import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.LRUCache;
+import org.apache.activemq.util.buffer.DataByteArrayOutputStream;
 import org.apache.activemq.util.list.Sequence;
 import org.apache.activemq.util.list.SequenceSet;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.kahadb.util.DataByteArrayOutputStream;
-import org.apache.kahadb.util.IntrospectionSupport;
 
 /**
  * A PageFile provides you random access to fixed sized disk pages. This object is not thread
safe and therefore access to it should 

Modified: activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java?rev=789439&r1=789438&r2=789439&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java
(original)
+++ activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java
Mon Jun 29 20:42:42 2009
@@ -26,12 +26,12 @@
 import java.util.NoSuchElementException;
 
 import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.DataByteArrayInputStream;
+import org.apache.activemq.util.buffer.DataByteArrayOutputStream;
 import org.apache.activemq.util.list.Sequence;
 import org.apache.activemq.util.list.SequenceSet;
 import org.apache.activemq.util.marshaller.Marshaller;
 import org.apache.kahadb.page.PageFile.PageWrite;
-import org.apache.kahadb.util.DataByteArrayInputStream;
-import org.apache.kahadb.util.DataByteArrayOutputStream;
 
 /**
  * The class used to read/update a PageFile object.  Using a transaction allows you to



Mime
View raw message