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 22:58:25 UTC
svn commit: r789444 - 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-openwire/src/main/java/org/apache/activemq/command/...
Author: chirino
Date: Mon Jun 29 20:58:24 2009
New Revision: 789444
URL: http://svn.apache.org/viewvc?rev=789444&view=rev
Log:
cleaning up referecnes to ByteBuffer
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-openwire/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/Message.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/WireFormatInfo.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java
activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf-test/src/test/java/com/google/protobuf/TestUtil.java
activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormat.java
activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/transport/stomp/StompWireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java
activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java
activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java
activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java
activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java
activemq/sandbox/activemq-flow/kahadb/src/main/java/org/apache/kahadb/journal/DataFileAppender.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=789444&r1=789443&r2=789444&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:58:24 2009
@@ -353,7 +353,7 @@
} catch (IOException shouldNotHappen) {
throw new RuntimeException(shouldNotHappen);
}
- return baos.toByteSequence();
+ return baos.toBuffer();
}
private final void fromBytes(byte[] bytes) {
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=789444&r1=789443&r2=789444&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:58:24 2009
@@ -564,7 +564,7 @@
long start = System.currentTimeMillis();
final Location location;
synchronized (journal) {
- location = journal.write(os.toByteSequence(), onFlush);
+ location = journal.write(os.toBuffer(), onFlush);
}
long start2 = System.currentTimeMillis();
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQBytesMessage.java Mon Jun 29 20:58:24 2009
@@ -122,7 +122,7 @@
try {
if (dataOut != null) {
dataOut.close();
- Buffer bs = bytesOut.toByteSequence();
+ Buffer bs = bytesOut.toBuffer();
if (compressed) {
int pos = bs.offset;
BufferEditor.writeIntBig(bs, length);
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQMapMessage.java Mon Jun 29 20:58:24 2009
@@ -131,7 +131,7 @@
DataOutputStream dataOut = new DataOutputStream(os);
MarshallingSupport.marshalPrimitiveMap(map, dataOut);
dataOut.close();
- setContent(bytesOut.toByteSequence());
+ setContent(bytesOut.toBuffer());
}
} catch (IOException e) {
throw new RuntimeException(e);
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQObjectMessage.java Mon Jun 29 20:58:24 2009
@@ -99,7 +99,7 @@
objOut.flush();
objOut.reset();
objOut.close();
- setContent(bytesOut.toByteSequence());
+ setContent(bytesOut.toBuffer());
} catch (IOException ioe) {
throw new RuntimeException(ioe.getMessage(), ioe);
}
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQStreamMessage.java Mon Jun 29 20:58:24 2009
@@ -141,7 +141,7 @@
if (dataOut != null) {
try {
dataOut.close();
- setContent(bytesOut.toByteSequence());
+ setContent(bytesOut.toBuffer());
bytesOut = null;
dataOut = null;
} catch (IOException ioe) {
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/ActiveMQTextMessage.java Mon Jun 29 20:58:24 2009
@@ -117,7 +117,7 @@
DataOutputStream dataOut = new DataOutputStream(os);
MarshallingSupport.writeUTF8(dataOut, this.text);
dataOut.close();
- setContent(bytesOut.toByteSequence());
+ setContent(bytesOut.toBuffer());
//see https://issues.apache.org/activemq/browse/AMQ-2103
this.text=null;
}
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/Message.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/Message.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/Message.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/Message.java Mon Jun 29 20:58:24 2009
@@ -196,7 +196,7 @@
DataOutputStream os = new DataOutputStream(baos);
MarshallingSupport.marshalPrimitiveMap(properties, os);
os.close();
- marshalledProperties = baos.toByteSequence();
+ marshalledProperties = baos.toBuffer();
}
}
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/WireFormatInfo.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/WireFormatInfo.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/WireFormatInfo.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/command/WireFormatInfo.java Mon Jun 29 20:58:24 2009
@@ -176,7 +176,7 @@
DataOutputStream os = new DataOutputStream(baos);
MarshallingSupport.marshalPrimitiveMap(properties, os);
os.close();
- marshalledProperties = baos.toByteSequence();
+ marshalledProperties = baos.toBuffer();
}
}
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java Mon Jun 29 20:58:24 2009
@@ -162,7 +162,7 @@
bytesOut.writeByte(type);
bs.marshal(bytesOut);
dsm.tightMarshal2(this, c, bytesOut, bs);
- sequence = bytesOut.toByteSequence();
+ sequence = bytesOut.toBuffer();
} else {
bytesOut.restart();
@@ -173,7 +173,7 @@
}
bytesOut.writeByte(type);
dsm.looseMarshal(this, c, bytesOut);
- sequence = bytesOut.toByteSequence();
+ sequence = bytesOut.toBuffer();
if (!sizePrefixDisabled) {
size = sequence.getLength() - 4;
@@ -187,7 +187,7 @@
bytesOut.restart(5);
bytesOut.writeInt(size);
bytesOut.writeByte(NULL_TYPE);
- sequence = bytesOut.toByteSequence();
+ sequence = bytesOut.toBuffer();
}
// if( ma!=null ) {
@@ -257,7 +257,7 @@
dsm.looseMarshal(this, c, looseOut);
if (!sizePrefixDisabled) {
- Buffer sequence = bytesOut.toByteSequence();
+ Buffer sequence = bytesOut.toBuffer();
dataOut.writeInt(sequence.getLength());
dataOut.write(sequence.getData(), sequence.getOffset(), sequence.getLength());
}
@@ -410,14 +410,8 @@
ds.writeByte(type);
if (o.isMarshallAware() && bs.readBoolean()) {
-
// We should not be doing any caching
throw new IOException("Corrupted stream");
- // MarshallAware ma = (MarshallAware) o;
- // ByteSequence sequence=ma.getCachedMarshalledForm(this);
- // ds.write(sequence.getData(), sequence.getOffset(),
- // sequence.getLength());
-
} else {
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/main/java/org/apache/activemq/openwire/OpenWireFormatFactory.java Mon Jun 29 20:58:24 2009
@@ -138,23 +138,14 @@
this.maxInactivityDurationInitalDelay = maxInactivityDurationInitalDelay;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength()
- */
public int maxWireformatHeaderLength() {
throw new UnsupportedOperationException();
}
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v1/MessageTestSupport.java Mon Jun 29 20:58:24 2009
@@ -60,7 +60,7 @@
DataOutputStream dataOut = new DataOutputStream(baos);
MarshallingSupport.writeUTF8(dataOut, "Content:11");
dataOut.close();
- info.setContent(baos.toByteSequence());
+ info.setContent(baos.toBuffer());
}
{
@@ -70,7 +70,7 @@
DataOutputStream os = new DataOutputStream(baos);
MarshallingSupport.marshalPrimitiveMap(map, os);
os.close();
- info.setMarshalledProperties(baos.toByteSequence());
+ info.setMarshalledProperties(baos.toBuffer());
}
info.setDataStructure(createDataStructure("DataStructure:13"));
Modified: activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-openwire/src/test/java/org/apache/activemq/openwire/v2/MessageTestSupport.java Mon Jun 29 20:58:24 2009
@@ -59,7 +59,7 @@
DataOutputStream dataOut = new DataOutputStream(baos);
MarshallingSupport.writeUTF8(dataOut, "Content:11");
dataOut.close();
- info.setContent(baos.toByteSequence());
+ info.setContent(baos.toBuffer());
}
{
Map map = new HashMap();
@@ -68,7 +68,7 @@
DataOutputStream os = new DataOutputStream(baos);
MarshallingSupport.marshalPrimitiveMap(map, os);
os.close();
- info.setMarshalledProperties(baos.toByteSequence());
+ info.setMarshalledProperties(baos.toBuffer());
}
info.setDataStructure(createDataStructure("DataStructure:13"));
info.setTargetConsumerId(createConsumerId("TargetConsumerId:14"));
Modified: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf-test/src/test/java/com/google/protobuf/TestUtil.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf-test/src/test/java/com/google/protobuf/TestUtil.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf-test/src/test/java/com/google/protobuf/TestUtil.java (original)
+++ activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf-test/src/test/java/com/google/protobuf/TestUtil.java Mon Jun 29 20:58:24 2009
@@ -49,7 +49,7 @@
class TestUtil {
private TestUtil() {}
- /** Helper to convert a String to ByteSequence. */
+ /** Helper to convert a String to Buffer. */
private static Buffer toBytes(String str) {
try {
return new Buffer(str.getBytes("UTF-8"));
Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/Proto2WireFormatFactory.java Mon Jun 29 20:58:24 2009
@@ -268,7 +268,7 @@
public Buffer marshal(Object value) throws IOException {
DataByteArrayOutputStream os = new DataByteArrayOutputStream();
marshal(value, os);
- return os.toByteSequence();
+ return os.toBuffer();
}
public Object unmarshal(Buffer data) throws IOException {
@@ -289,23 +289,14 @@
return new TestWireFormat();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength()
- */
public int maxWireformatHeaderLength() {
throw new UnsupportedOperationException();
}
Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/queue/perf/ProtoWireFormatFactory.java Mon Jun 29 20:58:24 2009
@@ -230,7 +230,7 @@
public Buffer marshal(Object value) throws IOException {
DataByteArrayOutputStream os = new DataByteArrayOutputStream();
marshal(value, os);
- return os.toByteSequence();
+ return os.toBuffer();
}
public Object unmarshal(Buffer data) throws IOException {
@@ -242,9 +242,6 @@
return transport;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormat#getName()
- */
public String getName() {
return WIREFORMAT_NAME;
}
@@ -258,23 +255,14 @@
return new TestWireFormat();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength()
- */
public int maxWireformatHeaderLength() {
throw new UnsupportedOperationException();
}
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -55,7 +55,7 @@
DataOutputStream dos = new DataOutputStream(baos);
marshal(command, dos);
dos.close();
- return baos.toByteSequence();
+ return baos.toBuffer();
}
public Object unmarshal(Buffer packet) throws IOException {
@@ -194,7 +194,7 @@
baos.write(b);
}
baos.close();
- Buffer sequence = baos.toByteSequence();
+ Buffer sequence = baos.toBuffer();
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -28,23 +28,14 @@
return new StompWireFormat();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength()
- */
public int maxWireformatHeaderLength() {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -75,7 +75,7 @@
if (baos == null) {
throw new IllegalStateException("Stream closed.");
}
- data = baos.toByteSequence();
+ data = baos.toBuffer();
baos = null;
}
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -78,7 +78,7 @@
// Try to discriminate what we have read so far.
for (WireFormatFactory wff : wireFormatFactories) {
- if (wff.matchesWireformatHeader(baos.toByteSequence())) {
+ if (wff.matchesWireformatHeader(baos.toBuffer())) {
wireFormat = wff.createWireFormat();
break;
}
@@ -185,33 +185,14 @@
this.wireFormats = formats;
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader
- * (org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength
- * ()
- */
public int maxWireformatHeaderLength() {
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -45,7 +45,7 @@
DataOutputStream ds = new DataOutputStream(baos);
marshal(command, ds);
ds.close();
- return baos.toByteSequence();
+ return baos.toBuffer();
}
public Object unmarshal(Buffer packet) throws IOException {
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -8,23 +8,14 @@
return new ObjectStreamWireFormat();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#isDiscriminatable()
- */
public boolean isDiscriminatable() {
return false;
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#matchesWireformatHeader(org.apache.activemq.util.ByteSequence)
- */
public boolean matchesWireformatHeader(Buffer byteSequence) {
throw new UnsupportedOperationException();
}
- /* (non-Javadoc)
- * @see org.apache.activemq.wireformat.WireFormatFactory#maxWireformatHeaderLength()
- */
public int maxWireformatHeaderLength() {
throw new UnsupportedOperationException();
}
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=789444&r1=789443&r2=789444&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 20:58:24 2009
@@ -42,10 +42,10 @@
/**
* Called to test if this wireformat matches the provided header.
*
- * @param byteSequence The byte sequence representing the herader data read so far.
- * @return True if the ByteSequence matches the wire format header.
+ * @param buffer The byte buffer representing the header data read so far.
+ * @return true if the Buffer matches the wire format header.
*/
- boolean matchesWireformatHeader(Buffer byteSequence);
+ boolean matchesWireformatHeader(Buffer buffer);
}
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/BufferEditor.java Mon Jun 29 20:58:24 2009
@@ -19,7 +19,7 @@
import java.io.IOException;
/**
- * Used to write and read primitives to and from a ByteSequence.
+ * Used to write and read primitives to and from a Buffer.
*/
public final class BufferEditor {
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/ByteArrayOutputStream.java Mon Jun 29 20:58:24 2009
@@ -22,7 +22,7 @@
/**
* Very similar to the java.io.ByteArrayOutputStream but this version
- * is not thread safe and the resulting data is returned in a ByteSequence
+ * is not thread safe and the resulting data is returned in a Buffer
* to avoid an extra byte[] allocation.
*/
public class ByteArrayOutputStream extends OutputStream {
@@ -67,14 +67,12 @@
size = 0;
}
- public Buffer toByteSequence() {
+ public Buffer toBuffer() {
return new Buffer(buffer, 0, size);
}
public byte[] toByteArray() {
- byte rc[] = new byte[size];
- System.arraycopy(buffer, 0, rc, 0, size);
- return rc;
+ return toBuffer().toByteArray();
}
public int size() {
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayInputStream.java Mon Jun 29 20:58:24 2009
@@ -98,7 +98,7 @@
/**
* reset the <code>StoreByteArrayInputStream</code> to use an new
- * ByteSequence
+ * Buffer
*
* @param sequence
*/
Modified: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java?rev=789444&r1=789443&r2=789444&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java (original)
+++ activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/util/buffer/DataByteArrayOutputStream.java Mon Jun 29 20:58:24 2009
@@ -71,11 +71,11 @@
}
/**
- * Get a ByteSequence from the stream
+ * Get a Buffer from the stream
*
* @return the byte sequence
*/
- public Buffer toByteSequence() {
+ public Buffer toBuffer() {
return new Buffer(buf, 0, pos);
}
@@ -279,7 +279,4 @@
onWrite();
}
- public Buffer getByteSequence() {
- return new Buffer(buf, 0, pos);
- }
}
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=789444&r1=789443&r2=789444&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:58:24 2009
@@ -355,7 +355,7 @@
write = write.getNext();
}
- Buffer sequence = buff.toByteSequence();
+ Buffer sequence = buff.toBuffer();
// Now we can fill in the batch control record properly.
buff.reset();