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 2009/06/29 18:28:56 UTC
svn commit: r789377 [3/4] - in /activemq/sandbox/activemq-flow:
activemq-broker/src/main/java/org/apache/activemq/apollo/broker/
activemq-broker/src/main/java/org/apache/activemq/apollo/broker/path/
activemq-broker/src/main/java/org/apache/activemq/apo...
Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java Mon Jun 29 16:28:18 2009
@@ -52,12 +52,12 @@
import org.apache.activemq.command.ShutdownInfo;
import org.apache.activemq.command.TransactionId;
import org.apache.activemq.command.TransactionInfo;
-import org.apache.activemq.util.ByteArrayOutputStream;
import org.apache.activemq.util.FactoryFinder;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IdGenerator;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.LongSequenceGenerator;
+import org.apache.activemq.util.buffer.ByteArrayOutputStream;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java Mon Jun 29 16:28:18 2009
@@ -27,9 +27,9 @@
import org.apache.activemq.transport.InactivityMonitor;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.ByteArrayInputStream;
+import org.apache.activemq.util.buffer.ByteArrayOutputStream;
import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.wireformat.WireFormatFactory;
@@ -50,7 +50,7 @@
private int version = 1;
public static final String WIREFORMAT_NAME = "stomp";
- public ByteSequence marshal(Object command) throws IOException {
+ public Buffer marshal(Object command) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
marshal(command, dos);
@@ -58,7 +58,7 @@
return baos.toByteSequence();
}
- public Object unmarshal(ByteSequence packet) throws IOException {
+ public Object unmarshal(Buffer packet) throws IOException {
ByteArrayInputStream stream = new ByteArrayInputStream(packet);
DataInputStream dis = new DataInputStream(stream);
return unmarshal(dis);
@@ -194,7 +194,7 @@
baos.write(b);
}
baos.close();
- ByteSequence sequence = baos.toByteSequence();
+ Buffer sequence = baos.toByteSequence();
return new String(sequence.getData(), sequence.getOffset(), sequence.getLength(), "UTF-8");
}
Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -16,7 +16,7 @@
*/
package org.apache.activemq.transport.stomp;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.wireformat.WireFormatFactory;
@@ -31,7 +31,7 @@
/* (non-Javadoc)
* @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
*/
- public boolean matchesWireformatHeader(ByteSequence byteSequence) {
+ public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
Modified: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/wireformat/DiscriminatableStompWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/wireformat/DiscriminatableStompWireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/wireformat/DiscriminatableStompWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/wireformat/DiscriminatableStompWireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -20,7 +20,7 @@
import org.apache.activemq.transport.stomp.Stomp;
import org.apache.activemq.transport.stomp.StompWireFormatFactory;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
public class DiscriminatableStompWireFormatFactory extends StompWireFormatFactory {
@@ -38,7 +38,7 @@
}
}
- public boolean matchesWireformatHeader(ByteSequence byteSequence) {
+ public boolean matchesWireformatHeader(Buffer byteSequence) {
byte[] data = byteSequence.data;
if( byteSequence.length >= MAGIC.length) {
int offset = byteSequence.length - MAGIC.length;
Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java Mon Jun 29 16:28:18 2009
@@ -21,9 +21,9 @@
import java.util.Iterator;
import org.apache.activemq.Service;
-import org.apache.activemq.protobuf.AsciiBuffer;
-import org.apache.activemq.protobuf.Buffer;
import org.apache.activemq.queue.QueueDescriptor;
+import org.apache.activemq.util.buffer.AsciiBuffer;
+import org.apache.activemq.util.buffer.Buffer;
/**
* Interface to persistently store and access data needed by the messaging
Modified: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java Mon Jun 29 16:28:18 2009
@@ -31,12 +31,11 @@
import org.apache.activemq.broker.store.Store.DuplicateKeyException;
import org.apache.activemq.broker.store.Store.Session;
import org.apache.activemq.broker.store.Store.SubscriptionRecord;
-import org.apache.activemq.protobuf.AsciiBuffer;
-import org.apache.activemq.protobuf.Buffer;
import org.apache.activemq.queue.QueueDescriptor;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.util.Comparators;
+import org.apache.activemq.util.buffer.AsciiBuffer;
+import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.ByteArrayOutputStream;
/**
* An in memory implementation of the {@link Store} interface. It does not
@@ -63,7 +62,7 @@
static private class Stream {
private ByteArrayOutputStream baos = new ByteArrayOutputStream();
- private ByteSequence data;
+ private Buffer data;
public void write(Buffer buffer) {
if (baos == null) {
Modified: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java Mon Jun 29 16:28:18 2009
@@ -33,9 +33,9 @@
import org.apache.activemq.metric.MetricAggregator;
import org.apache.activemq.metric.MetricCounter;
import org.apache.activemq.metric.Period;
-import org.apache.activemq.protobuf.AsciiBuffer;
-import org.apache.activemq.protobuf.Buffer;
import org.apache.activemq.queue.QueueDescriptor;
+import org.apache.activemq.util.buffer.AsciiBuffer;
+import org.apache.activemq.util.buffer.Buffer;
public abstract class StorePerformanceBase extends TestCase {
Modified: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java (original)
+++ activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java Mon Jun 29 16:28:18 2009
@@ -29,9 +29,9 @@
import org.apache.activemq.broker.store.Store.Session;
import org.apache.activemq.broker.store.Store.SubscriptionRecord;
import org.apache.activemq.broker.store.Store.VoidCallback;
-import org.apache.activemq.protobuf.AsciiBuffer;
-import org.apache.activemq.protobuf.Buffer;
import org.apache.activemq.queue.QueueDescriptor;
+import org.apache.activemq.util.buffer.AsciiBuffer;
+import org.apache.activemq.util.buffer.Buffer;
public abstract class StoreTestBase extends TestCase {
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java Mon Jun 29 16:28:18 2009
@@ -25,10 +25,10 @@
import org.apache.activemq.transport.TransportListener;
import org.apache.activemq.transport.TransportServer;
import org.apache.activemq.transport.pipe.Pipe.ReadReadyListener;
-import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.activemq.util.IntrospectionSupport;
import org.apache.activemq.util.URISupport;
+import org.apache.activemq.util.buffer.Buffer;
import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.wireformat.WireFormatFactory;
@@ -120,7 +120,7 @@
throw new EOFException();
}
if (wireFormat != null && marshal) {
- listener.onCommand(wireFormat.unmarshal((ByteSequence) o));
+ listener.onCommand(wireFormat.unmarshal((Buffer) o));
} else {
listener.onCommand(o);
}
@@ -142,7 +142,7 @@
throw new EOFException();
} else {
if (wireFormat != null && marshal) {
- listener.onCommand(wireFormat.unmarshal((ByteSequence)value));
+ listener.onCommand(wireFormat.unmarshal((Buffer)value));
} else {
listener.onCommand(value);
}
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -27,10 +27,10 @@
import java.util.Map;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.util.FactoryFinder;
+import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.ByteArrayInputStream;
+import org.apache.activemq.util.buffer.ByteArrayOutputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -107,11 +107,11 @@
wireFormat.marshal(command, out);
}
- public ByteSequence marshal(Object command) throws IOException {
+ public Buffer marshal(Object command) throws IOException {
throw new UnsupportedOperationException();
}
- public Object unmarshal(ByteSequence packet) throws IOException {
+ public Object unmarshal(Buffer packet) throws IOException {
throw new UnsupportedOperationException();
}
@@ -201,7 +201,7 @@
* org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader
* (org.apache.activemq.util.ByteSequence)
*/
- public boolean matchesWireformatHeader(ByteSequence byteSequence) {
+ public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java Mon Jun 29 16:28:18 2009
@@ -27,10 +27,10 @@
import java.util.Map;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteArrayInputStream;
-import org.apache.activemq.util.ByteArrayOutputStream;
-import org.apache.activemq.util.ByteSequence;
import org.apache.activemq.util.ClassLoadingAwareObjectInputStream;
+import org.apache.activemq.util.buffer.Buffer;
+import org.apache.activemq.util.buffer.ByteArrayInputStream;
+import org.apache.activemq.util.buffer.ByteArrayOutputStream;
/**
* A simple implementation which uses Object Stream serialization.
@@ -40,7 +40,7 @@
public class ObjectStreamWireFormat implements WireFormat {
public static final String WIREFORMAT_NAME = "object";
- public ByteSequence marshal(Object command) throws IOException {
+ public Buffer marshal(Object command) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream ds = new DataOutputStream(baos);
marshal(command, ds);
@@ -48,7 +48,7 @@
return baos.toByteSequence();
}
- public Object unmarshal(ByteSequence packet) throws IOException {
+ public Object unmarshal(Buffer packet) throws IOException {
return unmarshal(new DataInputStream(new ByteArrayInputStream(packet)));
}
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -1,6 +1,6 @@
package org.apache.activemq.wireformat;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
public class ObjectStreamWireFormatFactory implements WireFormatFactory {
@@ -18,7 +18,7 @@
/* (non-Javadoc)
* @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
*/
- public boolean matchesWireformatHeader(ByteSequence byteSequence) {
+ public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java Mon Jun 29 16:28:18 2009
@@ -22,7 +22,7 @@
import java.util.Map;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
/**
@@ -36,12 +36,12 @@
/**
* Packet based marshaling
*/
- ByteSequence marshal(Object command) throws IOException;
+ Buffer marshal(Object command) throws IOException;
/**
* Packet based un-marshaling
*/
- Object unmarshal(ByteSequence packet) throws IOException;
+ Object unmarshal(Buffer packet) throws IOException;
/**
* Stream based marshaling
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -16,7 +16,7 @@
*/
package org.apache.activemq.wireformat;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
public interface WireFormatFactory {
@@ -45,7 +45,7 @@
* @param byteSequence The byte sequence representing the herader data read so far.
* @return True if the ByteSequence matches the wire format header.
*/
- boolean matchesWireformatHeader(ByteSequence byteSequence);
+ boolean matchesWireformatHeader(Buffer byteSequence);
}
Modified: activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-transport/src/test/java/org/apache/activemq/wireformat/mock/MockWireFormatFactory.java Mon Jun 29 16:28:18 2009
@@ -6,7 +6,7 @@
import java.util.Map;
import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.buffer.Buffer;
import org.apache.activemq.wireformat.WireFormat;
import org.apache.activemq.wireformat.WireFormatFactory;
@@ -32,7 +32,7 @@
public void setVersion(int version) {
}
- public ByteSequence marshal(Object command) throws IOException {
+ public Buffer marshal(Object command) throws IOException {
throw new UnsupportedOperationException();
}
@@ -40,7 +40,7 @@
throw new UnsupportedOperationException();
}
- public Object unmarshal(ByteSequence packet) throws IOException {
+ public Object unmarshal(Buffer packet) throws IOException {
throw new UnsupportedOperationException();
}
@@ -61,7 +61,7 @@
return false;
}
- public boolean matchesWireformatHeader(ByteSequence byteSequence) {
+ public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/CommandLineSupport.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/CommandLineSupport.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/CommandLineSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/CommandLineSupport.java Mon Jun 29 16:28:18 2009
@@ -15,10 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util;
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.
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Comparators.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Comparators.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Comparators.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Comparators.java Mon Jun 29 16:28:18 2009
@@ -24,9 +24,12 @@
*/
public class Comparators {
+ /**
+ * Compares Long objects for order.
+ */
public static final Comparator<Long> LONG_COMPARATOR = new Comparator<Long>() {
/*
- * (non-Javadoc)
+ * Compares its two arguments for order.
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DiskBenchmark.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DiskBenchmark.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DiskBenchmark.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DiskBenchmark.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DiskBenchmark.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/DiskBenchmark.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DiskBenchmark.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util;
import java.io.File;
import java.io.FileNotFoundException;
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+
/**
* This class is used to get a benchmark the raw disk performance.
*/
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/HashList.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/HashList.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/HashList.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/HashList.java Mon Jun 29 16:28:18 2009
@@ -18,8 +18,8 @@
import java.util.HashMap;
import java.util.Iterator;
-import org.apache.kahadb.util.LinkedNodeList;
-import org.apache.kahadb.util.LinkedNode;
+import org.apache.activemq.util.list.LinkedNode;
+import org.apache.activemq.util.list.LinkedNodeList;
public class HashList<E> {
private HashMap<E, HashListNode> m_index = null;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LockFile.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LockFile.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LockFile.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LockFile.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LockFile.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LockFile.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/LockFile.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util;
import java.io.File;
import java.io.IOException;
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/PriorityLinkedList.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/PriorityLinkedList.java?rev=789377&r1=789376&r2=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/PriorityLinkedList.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/PriorityLinkedList.java Mon Jun 29 16:28:18 2009
@@ -18,8 +18,8 @@
import java.util.ArrayList;
-import org.apache.kahadb.util.LinkedNode;
-import org.apache.kahadb.util.LinkedNodeList;
+import org.apache.activemq.util.list.LinkedNode;
+import org.apache.activemq.util.list.LinkedNodeList;
public class PriorityLinkedList<E extends LinkedNode<E>> {
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Scheduler.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Scheduler.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Scheduler.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Scheduler.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Scheduler.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Scheduler.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/Scheduler.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util;
import java.util.HashMap;
import java.util.Timer;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SchedulerTimerTask.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SchedulerTimerTask.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SchedulerTimerTask.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SchedulerTimerTask.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SchedulerTimerTask.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SchedulerTimerTask.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SchedulerTimerTask.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util;
import java.util.TimerTask;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/AsciiBuffer.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/AsciiBuffer.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/AsciiBuffer.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/AsciiBuffer.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/AsciiBuffer.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/AsciiBuffer.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/AsciiBuffer.java Mon Jun 29 16:28:18 2009
@@ -1,4 +1,6 @@
-package org.apache.activemq.protobuf;
+package org.apache.activemq.util.buffer;
+
+
final public class AsciiBuffer extends Buffer {
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/Buffer.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/Buffer.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/Buffer.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/Buffer.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/Buffer.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/Buffer.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/Buffer.java Mon Jun 29 16:28:18 2009
@@ -15,15 +15,17 @@
* limitations under the License.
*/
-package org.apache.activemq.protobuf;
+package org.apache.activemq.util.buffer;
import java.util.List;
+
+
public class Buffer implements Comparable<Buffer> {
- final public byte[] data;
- final public int offset;
- final public int length;
+ public byte[] data;
+ public int offset;
+ public int length;
public Buffer(Buffer other) {
this(other.data, other.offset, other.length);
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteSequenceData.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteSequenceData.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteSequenceData.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java Mon Jun 29 16:28:18 2009
@@ -14,258 +14,258 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.buffer;
import java.io.IOException;
/**
* Used to write and read primitives to and from a ByteSequence.
*/
-public final class ByteSequenceData {
+public final class BufferEditor {
- private ByteSequenceData() {
+ private BufferEditor() {
}
- public static byte[] toByteArray(ByteSequence packet) {
- if (packet.offset == 0 && packet.length == packet.data.length) {
- return packet.data;
+ public static byte[] toByteArray(Buffer buffer) {
+ if (buffer.offset == 0 && buffer.length == buffer.data.length) {
+ return buffer.data;
}
- byte rc[] = new byte[packet.length];
- System.arraycopy(packet.data, packet.offset, rc, 0, packet.length);
+ byte rc[] = new byte[buffer.length];
+ System.arraycopy(buffer.data, buffer.offset, rc, 0, buffer.length);
return rc;
}
- private static void spaceNeeded(ByteSequence packet, int i) {
- assert packet.offset + i <= packet.length;
+ private static void spaceNeeded(Buffer buffer, int i) {
+ assert buffer.offset + i <= buffer.length;
}
- public static int remaining(ByteSequence packet) {
- return packet.length - packet.offset;
+ public static int remaining(Buffer buffer) {
+ return buffer.length - buffer.offset;
}
- public static int read(ByteSequence packet) {
- return packet.data[packet.offset++] & 0xff;
+ public static int read(Buffer buffer) {
+ return buffer.data[buffer.offset++] & 0xff;
}
- public static void readFully(ByteSequence packet, byte[] b) throws IOException {
- readFully(packet, b, 0, b.length);
+ public static void readFully(Buffer buffer, byte[] b) throws IOException {
+ readFully(buffer, b, 0, b.length);
}
- public static void readFully(ByteSequence packet, byte[] b, int off, int len) throws IOException {
- spaceNeeded(packet, len);
- System.arraycopy(packet.data, packet.offset, b, off, len);
- packet.offset += len;
+ public static void readFully(Buffer buffer, byte[] b, int off, int len) throws IOException {
+ spaceNeeded(buffer, len);
+ System.arraycopy(buffer.data, buffer.offset, b, off, len);
+ buffer.offset += len;
}
- public static int skipBytes(ByteSequence packet, int n) throws IOException {
- int rc = Math.min(n, remaining(packet));
- packet.offset += rc;
+ public static int skipBytes(Buffer buffer, int n) throws IOException {
+ int rc = Math.min(n, remaining(buffer));
+ buffer.offset += rc;
return rc;
}
- public static boolean readBoolean(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 1);
- return read(packet) != 0;
+ public static boolean readBoolean(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 1);
+ return read(buffer) != 0;
}
- public static byte readByte(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 1);
- return (byte)read(packet);
+ public static byte readByte(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 1);
+ return (byte)read(buffer);
}
- public static int readUnsignedByte(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 1);
- return read(packet);
+ public static int readUnsignedByte(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 1);
+ return read(buffer);
}
- public static short readShortBig(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (short)((read(packet) << 8) + (read(packet) << 0));
+ public static short readShortBig(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (short)((read(buffer) << 8) + (read(buffer) << 0));
}
- public static short readShortLittle(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (short)((read(packet) << 0) + (read(packet) << 8));
+ public static short readShortLittle(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (short)((read(buffer) << 0) + (read(buffer) << 8));
}
- public static int readUnsignedShortBig(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (read(packet) << 8) + (read(packet) << 0);
+ public static int readUnsignedShortBig(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (read(buffer) << 8) + (read(buffer) << 0);
}
- public static int readUnsignedShortLittle(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (read(packet) << 0) + (read(packet) << 8);
+ public static int readUnsignedShortLittle(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (read(buffer) << 0) + (read(buffer) << 8);
}
- public static char readCharBig(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (char)((read(packet) << 8) + (read(packet) << 0));
+ public static char readCharBig(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (char)((read(buffer) << 8) + (read(buffer) << 0));
}
- public static char readCharLittle(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 2);
- return (char)((read(packet) << 0) + (read(packet) << 8));
+ public static char readCharLittle(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 2);
+ return (char)((read(buffer) << 0) + (read(buffer) << 8));
}
- public static int readIntBig(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 4);
- return (read(packet) << 24) + (read(packet) << 16) + (read(packet) << 8) + (read(packet) << 0);
+ public static int readIntBig(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 4);
+ return (read(buffer) << 24) + (read(buffer) << 16) + (read(buffer) << 8) + (read(buffer) << 0);
}
- public static int readIntLittle(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 4);
- return (read(packet) << 0) + (read(packet) << 8) + (read(packet) << 16) + (read(packet) << 24);
+ public static int readIntLittle(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 4);
+ return (read(buffer) << 0) + (read(buffer) << 8) + (read(buffer) << 16) + (read(buffer) << 24);
}
- public static long readLongBig(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 8);
- return ((long)read(packet) << 56) + ((long)read(packet) << 48) + ((long)read(packet) << 40) + ((long)read(packet) << 32) + ((long)read(packet) << 24)
- + ((read(packet)) << 16) + ((read(packet)) << 8) + ((read(packet)) << 0);
+ public static long readLongBig(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 8);
+ return ((long)read(buffer) << 56) + ((long)read(buffer) << 48) + ((long)read(buffer) << 40) + ((long)read(buffer) << 32) + ((long)read(buffer) << 24)
+ + ((read(buffer)) << 16) + ((read(buffer)) << 8) + ((read(buffer)) << 0);
}
- public static long readLongLittle(ByteSequence packet) throws IOException {
- spaceNeeded(packet, 8);
- return (read(packet) << 0) + (read(packet) << 8) + (read(packet) << 16) + ((long)read(packet) << 24) + ((long)read(packet) << 32) + ((long)read(packet) << 40)
- + ((long)read(packet) << 48) + ((long)read(packet) << 56);
+ public static long readLongLittle(Buffer buffer) throws IOException {
+ spaceNeeded(buffer, 8);
+ return (read(buffer) << 0) + (read(buffer) << 8) + (read(buffer) << 16) + ((long)read(buffer) << 24) + ((long)read(buffer) << 32) + ((long)read(buffer) << 40)
+ + ((long)read(buffer) << 48) + ((long)read(buffer) << 56);
}
- public static double readDoubleBig(ByteSequence packet) throws IOException {
- return Double.longBitsToDouble(readLongBig(packet));
+ public static double readDoubleBig(Buffer buffer) throws IOException {
+ return Double.longBitsToDouble(readLongBig(buffer));
}
- public static double readDoubleLittle(ByteSequence packet) throws IOException {
- return Double.longBitsToDouble(readLongLittle(packet));
+ public static double readDoubleLittle(Buffer buffer) throws IOException {
+ return Double.longBitsToDouble(readLongLittle(buffer));
}
- public static float readFloatBig(ByteSequence packet) throws IOException {
- return Float.intBitsToFloat(readIntBig(packet));
+ public static float readFloatBig(Buffer buffer) throws IOException {
+ return Float.intBitsToFloat(readIntBig(buffer));
}
- public static float readFloatLittle(ByteSequence packet) throws IOException {
- return Float.intBitsToFloat(readIntLittle(packet));
+ public static float readFloatLittle(Buffer buffer) throws IOException {
+ return Float.intBitsToFloat(readIntLittle(buffer));
}
- public static void write(ByteSequence packet, int b) throws IOException {
- spaceNeeded(packet, 1);
- packet.data[packet.offset++] = (byte)b;
+ public static void write(Buffer buffer, int b) throws IOException {
+ spaceNeeded(buffer, 1);
+ buffer.data[buffer.offset++] = (byte)b;
}
- public static void write(ByteSequence packet, byte[] b) throws IOException {
- write(packet, b, 0, b.length);
+ public static void write(Buffer buffer, byte[] b) throws IOException {
+ write(buffer, b, 0, b.length);
}
- public static void write(ByteSequence packet, byte[] b, int off, int len) throws IOException {
- spaceNeeded(packet, len);
- System.arraycopy(b, off, packet.data, packet.offset, len);
- packet.offset += len;
+ public static void write(Buffer buffer, byte[] b, int off, int len) throws IOException {
+ spaceNeeded(buffer, len);
+ System.arraycopy(b, off, buffer.data, buffer.offset, len);
+ buffer.offset += len;
}
- public static void writeBoolean(ByteSequence packet, boolean v) throws IOException {
- spaceNeeded(packet, 1);
- write(packet, v ? 1 : 0);
+ public static void writeBoolean(Buffer buffer, boolean v) throws IOException {
+ spaceNeeded(buffer, 1);
+ write(buffer, v ? 1 : 0);
}
- public static void writeByte(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 1);
- write(packet, v);
+ public static void writeByte(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 1);
+ write(buffer, v);
}
- public static void writeShortBig(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 2);
- write(packet, (v >>> 8) & 0xFF);
- write(packet, (v >>> 0) & 0xFF);
+ public static void writeShortBig(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 2);
+ write(buffer, (v >>> 8) & 0xFF);
+ write(buffer, (v >>> 0) & 0xFF);
}
- public static void writeShortLittle(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 2);
- write(packet, (v >>> 0) & 0xFF);
- write(packet, (v >>> 8) & 0xFF);
+ public static void writeShortLittle(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 2);
+ write(buffer, (v >>> 0) & 0xFF);
+ write(buffer, (v >>> 8) & 0xFF);
}
- public static void writeCharBig(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 2);
- write(packet, (v >>> 8) & 0xFF);
- write(packet, (v >>> 0) & 0xFF);
+ public static void writeCharBig(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 2);
+ write(buffer, (v >>> 8) & 0xFF);
+ write(buffer, (v >>> 0) & 0xFF);
}
- public static void writeCharLittle(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 2);
- write(packet, (v >>> 0) & 0xFF);
- write(packet, (v >>> 8) & 0xFF);
+ public static void writeCharLittle(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 2);
+ write(buffer, (v >>> 0) & 0xFF);
+ write(buffer, (v >>> 8) & 0xFF);
}
- public static void writeIntBig(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 4);
- write(packet, (v >>> 24) & 0xFF);
- write(packet, (v >>> 16) & 0xFF);
- write(packet, (v >>> 8) & 0xFF);
- write(packet, (v >>> 0) & 0xFF);
+ public static void writeIntBig(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 4);
+ write(buffer, (v >>> 24) & 0xFF);
+ write(buffer, (v >>> 16) & 0xFF);
+ write(buffer, (v >>> 8) & 0xFF);
+ write(buffer, (v >>> 0) & 0xFF);
}
- public static void writeIntLittle(ByteSequence packet, int v) throws IOException {
- spaceNeeded(packet, 4);
- write(packet, (v >>> 0) & 0xFF);
- write(packet, (v >>> 8) & 0xFF);
- write(packet, (v >>> 16) & 0xFF);
- write(packet, (v >>> 24) & 0xFF);
+ public static void writeIntLittle(Buffer buffer, int v) throws IOException {
+ spaceNeeded(buffer, 4);
+ write(buffer, (v >>> 0) & 0xFF);
+ write(buffer, (v >>> 8) & 0xFF);
+ write(buffer, (v >>> 16) & 0xFF);
+ write(buffer, (v >>> 24) & 0xFF);
}
- public static void writeLongBig(ByteSequence packet, long v) throws IOException {
- spaceNeeded(packet, 8);
- write(packet, (int)(v >>> 56) & 0xFF);
- write(packet, (int)(v >>> 48) & 0xFF);
- write(packet, (int)(v >>> 40) & 0xFF);
- write(packet, (int)(v >>> 32) & 0xFF);
- write(packet, (int)(v >>> 24) & 0xFF);
- write(packet, (int)(v >>> 16) & 0xFF);
- write(packet, (int)(v >>> 8) & 0xFF);
- write(packet, (int)(v >>> 0) & 0xFF);
+ public static void writeLongBig(Buffer buffer, long v) throws IOException {
+ spaceNeeded(buffer, 8);
+ write(buffer, (int)(v >>> 56) & 0xFF);
+ write(buffer, (int)(v >>> 48) & 0xFF);
+ write(buffer, (int)(v >>> 40) & 0xFF);
+ write(buffer, (int)(v >>> 32) & 0xFF);
+ write(buffer, (int)(v >>> 24) & 0xFF);
+ write(buffer, (int)(v >>> 16) & 0xFF);
+ write(buffer, (int)(v >>> 8) & 0xFF);
+ write(buffer, (int)(v >>> 0) & 0xFF);
}
- public static void writeLongLittle(ByteSequence packet, long v) throws IOException {
- spaceNeeded(packet, 8);
- write(packet, (int)(v >>> 0) & 0xFF);
- write(packet, (int)(v >>> 8) & 0xFF);
- write(packet, (int)(v >>> 16) & 0xFF);
- write(packet, (int)(v >>> 24) & 0xFF);
- write(packet, (int)(v >>> 32) & 0xFF);
- write(packet, (int)(v >>> 40) & 0xFF);
- write(packet, (int)(v >>> 48) & 0xFF);
- write(packet, (int)(v >>> 56) & 0xFF);
+ public static void writeLongLittle(Buffer buffer, long v) throws IOException {
+ spaceNeeded(buffer, 8);
+ write(buffer, (int)(v >>> 0) & 0xFF);
+ write(buffer, (int)(v >>> 8) & 0xFF);
+ write(buffer, (int)(v >>> 16) & 0xFF);
+ write(buffer, (int)(v >>> 24) & 0xFF);
+ write(buffer, (int)(v >>> 32) & 0xFF);
+ write(buffer, (int)(v >>> 40) & 0xFF);
+ write(buffer, (int)(v >>> 48) & 0xFF);
+ write(buffer, (int)(v >>> 56) & 0xFF);
}
- public static void writeDoubleBig(ByteSequence packet, double v) throws IOException {
- writeLongBig(packet, Double.doubleToLongBits(v));
+ public static void writeDoubleBig(Buffer buffer, double v) throws IOException {
+ writeLongBig(buffer, Double.doubleToLongBits(v));
}
- public static void writeDoubleLittle(ByteSequence packet, double v) throws IOException {
- writeLongLittle(packet, Double.doubleToLongBits(v));
+ public static void writeDoubleLittle(Buffer buffer, double v) throws IOException {
+ writeLongLittle(buffer, Double.doubleToLongBits(v));
}
- public static void writeFloatBig(ByteSequence packet, float v) throws IOException {
- writeIntBig(packet, Float.floatToIntBits(v));
+ public static void writeFloatBig(Buffer buffer, float v) throws IOException {
+ writeIntBig(buffer, Float.floatToIntBits(v));
}
- public static void writeFloatLittle(ByteSequence packet, float v) throws IOException {
- writeIntLittle(packet, Float.floatToIntBits(v));
+ public static void writeFloatLittle(Buffer buffer, float v) throws IOException {
+ writeIntLittle(buffer, Float.floatToIntBits(v));
}
- public static void writeRawDoubleBig(ByteSequence packet, double v) throws IOException {
- writeLongBig(packet, Double.doubleToRawLongBits(v));
+ public static void writeRawDoubleBig(Buffer buffer, double v) throws IOException {
+ writeLongBig(buffer, Double.doubleToRawLongBits(v));
}
- public static void writeRawDoubleLittle(ByteSequence packet, double v) throws IOException {
- writeLongLittle(packet, Double.doubleToRawLongBits(v));
+ public static void writeRawDoubleLittle(Buffer buffer, double v) throws IOException {
+ writeLongLittle(buffer, Double.doubleToRawLongBits(v));
}
- public static void writeRawFloatBig(ByteSequence packet, float v) throws IOException {
- writeIntBig(packet, Float.floatToRawIntBits(v));
+ public static void writeRawFloatBig(Buffer buffer, float v) throws IOException {
+ writeIntBig(buffer, Float.floatToRawIntBits(v));
}
- public static void writeRawFloatLittle(ByteSequence packet, float v) throws IOException {
- writeIntLittle(packet, Float.floatToRawIntBits(v));
+ public static void writeRawFloatLittle(Buffer buffer, float v) throws IOException {
+ writeIntLittle(buffer, Float.floatToRawIntBits(v));
}
}
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferInputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferInputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferInputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferInputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferInputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferInputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferInputStream.java Mon Jun 29 16:28:18 2009
@@ -14,11 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.protobuf;
+package org.apache.activemq.util.buffer;
import java.io.IOException;
import java.io.InputStream;
+
/**
* Very similar to the java.io.ByteArrayInputStream but this version is not
* thread safe.
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferOutputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferOutputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferOutputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferOutputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferOutputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/BufferOutputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferOutputStream.java Mon Jun 29 16:28:18 2009
@@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.protobuf;
+package org.apache.activemq.util.buffer;
import java.io.EOFException;
import java.io.IOException;
import java.io.OutputStream;
+
/**
* Very similar to the java.io.ByteArrayOutputStream but this version
* is not thread safe and the resulting data is returned in a Buffer
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayInputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayInputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayInputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayInputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayInputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayInputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayInputStream.java Mon Jun 29 16:28:18 2009
@@ -14,11 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.buffer;
import java.io.IOException;
import java.io.InputStream;
+
/**
* Very similar to the java.io.ByteArrayInputStream but this version is not
* thread safe.
@@ -34,7 +35,7 @@
this(data, 0, data.length);
}
- public ByteArrayInputStream(ByteSequence sequence) {
+ public ByteArrayInputStream(Buffer sequence) {
this(sequence.getData(), sequence.getOffset(), sequence.getLength());
}
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayOutputStream.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayOutputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/ByteArrayOutputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java Mon Jun 29 16:28:18 2009
@@ -14,11 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.buffer;
import java.io.OutputStream;
+
/**
* Very similar to the java.io.ByteArrayOutputStream but this version
* is not thread safe and the resulting data is returned in a ByteSequence
@@ -66,8 +67,8 @@
size = 0;
}
- public ByteSequence toByteSequence() {
- return new ByteSequence(buffer, 0, size);
+ public Buffer toByteSequence() {
+ return new Buffer(buffer, 0, size);
}
public byte[] toByteArray() {
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/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/activemq/util/DataByteArrayInputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java Mon Jun 29 16:28:18 2009
@@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.buffer;
import java.io.DataInput;
import java.io.IOException;
import java.io.InputStream;
import java.io.UTFDataFormatException;
+
/**
* Optimized ByteArrayInputStream that can be used more than once
*
@@ -47,7 +48,7 @@
*
* @param sequence the input buffer.
*/
- public DataByteArrayInputStream(ByteSequence sequence) {
+ public DataByteArrayInputStream(Buffer sequence) {
this.buf = sequence.getData();
this.offset = sequence.getOffset();
this.pos = this.offset;
@@ -92,7 +93,7 @@
*
* @param sequence
*/
- public void restart(ByteSequence sequence) {
+ public void restart(Buffer sequence) {
this.buf = sequence.getData();
this.pos = sequence.getOffset();
}
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/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/activemq/util/DataByteArrayOutputStream.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/DataByteArrayOutputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java Mon Jun 29 16:28:18 2009
@@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.buffer;
import java.io.DataOutput;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UTFDataFormatException;
+
/**
* Optimized ByteArrayOutputStream
*
@@ -74,8 +75,8 @@
*
* @return the byte sequence
*/
- public ByteSequence toByteSequence() {
- return new ByteSequence(buf, 0, pos);
+ public Buffer toByteSequence() {
+ return new Buffer(buf, 0, pos);
}
/**
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/UTF8Buffer.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/UTF8Buffer.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/UTF8Buffer.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/UTF8Buffer.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/UTF8Buffer.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/UTF8Buffer.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/UTF8Buffer.java Mon Jun 29 16:28:18 2009
@@ -1,7 +1,9 @@
-package org.apache.activemq.protobuf;
+package org.apache.activemq.util.buffer;
import java.io.UnsupportedEncodingException;
+
+
final public class UTF8Buffer extends Buffer {
int hashCode;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNode.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNode.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNode.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNode.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNode.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNode.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNode.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util.list;
/**
* Provides a base class for you to extend when you want object to maintain a
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNodeList.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNodeList.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNodeList.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNodeList.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNodeList.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/LinkedNodeList.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/LinkedNodeList.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util.list;
import java.util.ArrayList;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/Sequence.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Sequence.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/Sequence.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/Sequence.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Sequence.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/Sequence.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/Sequence.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util.list;
+
/**
* Represents a range of numbers.
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SequenceSet.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SequenceSet.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SequenceSet.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SequenceSet.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SequenceSet.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/kahadb/util/SequenceSet.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SequenceSet.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.kahadb.util;
+package org.apache.activemq.util.list;
import java.io.DataInput;
import java.io.DataOutput;
@@ -23,6 +23,8 @@
import java.util.List;
import java.util.NoSuchElementException;
+import org.apache.activemq.util.marshaller.Marshaller;
+
/**
* Keeps track of a added long values. Collapses ranges of numbers using a
* Sequence representation. Use to keep track of received message ids to find
@@ -32,7 +34,7 @@
*/
public class SequenceSet extends LinkedNodeList<Sequence> {
- public static class Marshaller implements org.apache.kahadb.util.Marshaller<SequenceSet> {
+ public static class Marshaller implements org.apache.activemq.util.marshaller.Marshaller<SequenceSet> {
public static final Marshaller INSTANCE = new Marshaller();
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedList.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedList.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedList.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedList.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedList.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedList.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedList.java Mon Jun 29 16:28:18 2009
@@ -14,11 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.list;
import java.util.ArrayList;
import java.util.Map.Entry;
+import org.apache.activemq.util.Comparators;
+import org.apache.activemq.util.TreeMap;
+
public class SortedLinkedList<T extends SortedLinkedListNode<T>> {
protected final TreeMap<Long, T> index;
Copied: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedListNode.java (from r789362, activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedListNode.java)
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedListNode.java?p2=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedListNode.java&p1=activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedListNode.java&r1=789362&r2=789377&rev=789377&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/SortedLinkedListNode.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/list/SortedLinkedListNode.java Mon Jun 29 16:28:18 2009
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.activemq.util;
+package org.apache.activemq.util.list;
public abstract class SortedLinkedListNode<T extends SortedLinkedListNode<T>> {
Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java?rev=789377&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java Mon Jun 29 16:28:18 2009
@@ -0,0 +1,55 @@
+/**
+ * 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.marshaller;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * Implementation of a Marshaller for byte arrays
+ *
+ * @version $Revision$
+ */
+public class BytesMarshaller implements Marshaller<byte[]> {
+
+ public void writePayload(byte[] data, DataOutput dataOut) throws IOException {
+ dataOut.writeInt(data.length);
+ dataOut.write(data);
+ }
+
+ public byte[] readPayload(DataInput dataIn) throws IOException {
+ int size = dataIn.readInt();
+ byte[] data = new byte[size];
+ dataIn.readFully(data);
+ return data;
+ }
+
+ public int getFixedSize() {
+ return -1;
+ }
+
+ public byte[] deepCopy(byte[] source) {
+ byte []rc = new byte[source.length];
+ System.arraycopy(source, 0, rc, 0, source.length);
+ return rc;
+ }
+
+ public boolean isDeepCopySupported() {
+ return true;
+ }
+}
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/BytesMarshaller.java
------------------------------------------------------------------------------
svn:mergeinfo =
Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java?rev=789377&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java Mon Jun 29 16:28:18 2009
@@ -0,0 +1,55 @@
+/**
+ * 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.marshaller;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * Implementation of a Marshaller for a Integer
+ *
+ * @version $Revision$
+ */
+public class IntegerMarshaller implements Marshaller<Integer> {
+
+ public static final IntegerMarshaller INSTANCE = new IntegerMarshaller();
+
+ public void writePayload(Integer object, DataOutput dataOut) throws IOException {
+ dataOut.writeInt(object);
+ }
+
+ public Integer readPayload(DataInput dataIn) throws IOException {
+ return dataIn.readInt();
+ }
+
+ public int getFixedSize() {
+ return 4;
+ }
+
+
+ /**
+ * @return the source object since integers are immutable.
+ */
+ public Integer deepCopy(Integer source) {
+ return source;
+ }
+
+ public boolean isDeepCopySupported() {
+ return true;
+ }
+}
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/IntegerMarshaller.java
------------------------------------------------------------------------------
svn:mergeinfo =
Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java?rev=789377&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java Mon Jun 29 16:28:18 2009
@@ -0,0 +1,51 @@
+/**
+ * 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.marshaller;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * Implementation of a Marshaller for a Long
+ *
+ * @version $Revision$
+ */
+public class LongMarshaller implements Marshaller<Long> {
+
+ public static final LongMarshaller INSTANCE = new LongMarshaller();
+
+ public void writePayload(Long object, DataOutput dataOut) throws IOException {
+ dataOut.writeLong(object);
+ }
+
+ public Long readPayload(DataInput dataIn) throws IOException {
+ return dataIn.readLong();
+ }
+
+ public int getFixedSize() {
+ return 8;
+ }
+
+ public Long deepCopy(Long source) {
+ return source;
+ }
+
+ public boolean isDeepCopySupported() {
+ return true;
+ }
+}
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/LongMarshaller.java
------------------------------------------------------------------------------
svn:mergeinfo =
Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java?rev=789377&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java Mon Jun 29 16:28:18 2009
@@ -0,0 +1,63 @@
+/**
+ * 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.marshaller;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * @version $Revision$
+ */
+public interface Marshaller<T> {
+
+ /**
+ * Write the payload of the object to the DataOutput stream.
+ *
+ * @param object
+ * @param dataOut
+ * @throws IOException
+ */
+ void writePayload(T object, DataOutput dataOut) throws IOException;
+
+
+ /**
+ * Read the payload of the object from the DataInput stream.
+ *
+ * @param dataIn
+ * @return unmarshalled object
+ * @throws IOException
+ */
+ T readPayload(DataInput dataIn) throws IOException;
+
+ /**
+ * @return -1 if the object do not always marshall to a fixed size, otherwise return that fixed size.
+ */
+ int getFixedSize();
+
+ /**
+ *
+ * @return true if the {@link #deepCopy(Object)} operations is supported.
+ */
+ boolean isDeepCopySupported();
+
+ /**
+ * @return a deep copy of the source object.
+ */
+ T deepCopy(T source);
+
+}
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/Marshaller.java
------------------------------------------------------------------------------
svn:mergeinfo =
Added: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/ObjectMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/ObjectMarshaller.java?rev=789377&view=auto
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/ObjectMarshaller.java (added)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/marshaller/ObjectMarshaller.java Mon Jun 29 16:28:18 2009
@@ -0,0 +1,57 @@
+/**
+ * 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.marshaller;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * Implementation of a Marshaller for Objects
+ *
+ * @version $Revision$
+ */
+public class ObjectMarshaller extends VariableMarshaller<Object> {
+
+ public void writePayload(Object object, DataOutput dataOut) throws IOException {
+ ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
+ ObjectOutputStream objectOut = new ObjectOutputStream(bytesOut);
+ objectOut.writeObject(object);
+ objectOut.close();
+ byte[] data = bytesOut.toByteArray();
+ dataOut.writeInt(data.length);
+ dataOut.write(data);
+ }
+
+ public Object readPayload(DataInput dataIn) throws IOException {
+ int size = dataIn.readInt();
+ byte[] data = new byte[size];
+ dataIn.readFully(data);
+ ByteArrayInputStream bytesIn = new ByteArrayInputStream(data);
+ ObjectInputStream objectIn = new ObjectInputStream(bytesIn);
+ try {
+ return objectIn.readObject();
+ } catch (ClassNotFoundException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+}