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/03 21:20:33 UTC
svn commit: r781514 [5/6] - in /activemq/sandbox/activemq-flow: ./
activemq-all/ activemq-bio/ activemq-bio/src/main/java/org/apache/activemq/
activemq-bio/src/main/java/org/apache/activemq/transport/tcp/
activemq-broker/ activemq-broker/src/main/java/...
Modified: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CommandLineSupport.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CommandLineSupport.java?rev=781514&r1=781513&r2=781514&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CommandLineSupport.java (original)
+++ activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CommandLineSupport.java Wed Jun 3 19:20:13 2009
@@ -1,115 +1,115 @@
-/**
- *
- * 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.protobuf.compiler;
-
-import java.util.ArrayList;
-
-/**
- * Support utility that can be used to set the properties on any object
- * using command line arguments.
- *
- * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
- */
-public class CommandLineSupport {
-
- /**
- * Sets the properties of an object given the command line args.
- *
- * if args contains: --ack-mode=AUTO --url=tcp://localhost:61616 --persistent
- *
- * then it will try to call the following setters on the target object.
- *
- * target.setAckMode("AUTO");
- * target.setURL(new URI("tcp://localhost:61616") );
- * target.setPersistent(true);
- *
- * Notice the the proper conversion for the argument is determined by examining the
- * setter argument type.
- *
- * @param target the object that will have it's properties set
- * @param args the command line options
- * @return any arguments that are not valid options for the target
- */
- static public String[] setOptions(Object target, String []args) {
- ArrayList rc = new ArrayList();
-
- for (int i = 0; i < args.length; i++) {
- if( args[i] == null )
- continue;
-
- if( args[i].startsWith("--") ) {
-
- // --options without a specified value are considered boolean flags that are enabled.
- String value="true";
- String name = args[i].substring(2);
-
- // if --option=value case
- int p = name.indexOf("=");
- if( p > 0 ) {
- value = name.substring(p+1);
- name = name.substring(0,p);
- }
-
- // name not set, then it's an unrecognized option
- if( name.length()==0 ) {
- rc.add(args[i]);
- continue;
- }
-
- String propName = convertOptionToPropertyName(name);
- if( !IntrospectionSupport.setProperty(target, propName, value) ) {
- rc.add(args[i]);
- continue;
- }
- } else {
- rc.add(args[i]);
- }
-
- }
-
- String r[] = new String[rc.size()];
- rc.toArray(r);
- return r;
- }
-
- /**
- * converts strings like: test-enabled to testEnabled
- * @param name
- * @return
- */
- private static String convertOptionToPropertyName(String name) {
- String rc="";
-
- // Look for '-' and strip and then convert the subsequent char to uppercase
- int p = name.indexOf("-");
- while( p > 0 ) {
- // strip
- rc += name.substring(0, p);
- name = name.substring(p+1);
-
- // can I convert the next char to upper?
- if( name.length() >0 ) {
- rc += name.substring(0,1).toUpperCase();
- name = name.substring(1);
- }
-
- p = name.indexOf("-");
- }
- return rc+name;
- }
-}
+/**
+ *
+ * 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.protobuf.compiler;
+
+import java.util.ArrayList;
+
+/**
+ * Support utility that can be used to set the properties on any object
+ * using command line arguments.
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+public class CommandLineSupport {
+
+ /**
+ * Sets the properties of an object given the command line args.
+ *
+ * if args contains: --ack-mode=AUTO --url=tcp://localhost:61616 --persistent
+ *
+ * then it will try to call the following setters on the target object.
+ *
+ * target.setAckMode("AUTO");
+ * target.setURL(new URI("tcp://localhost:61616") );
+ * target.setPersistent(true);
+ *
+ * Notice the the proper conversion for the argument is determined by examining the
+ * setter argument type.
+ *
+ * @param target the object that will have it's properties set
+ * @param args the command line options
+ * @return any arguments that are not valid options for the target
+ */
+ static public String[] setOptions(Object target, String []args) {
+ ArrayList rc = new ArrayList();
+
+ for (int i = 0; i < args.length; i++) {
+ if( args[i] == null )
+ continue;
+
+ if( args[i].startsWith("--") ) {
+
+ // --options without a specified value are considered boolean flags that are enabled.
+ String value="true";
+ String name = args[i].substring(2);
+
+ // if --option=value case
+ int p = name.indexOf("=");
+ if( p > 0 ) {
+ value = name.substring(p+1);
+ name = name.substring(0,p);
+ }
+
+ // name not set, then it's an unrecognized option
+ if( name.length()==0 ) {
+ rc.add(args[i]);
+ continue;
+ }
+
+ String propName = convertOptionToPropertyName(name);
+ if( !IntrospectionSupport.setProperty(target, propName, value) ) {
+ rc.add(args[i]);
+ continue;
+ }
+ } else {
+ rc.add(args[i]);
+ }
+
+ }
+
+ String r[] = new String[rc.size()];
+ rc.toArray(r);
+ return r;
+ }
+
+ /**
+ * converts strings like: test-enabled to testEnabled
+ * @param name
+ * @return
+ */
+ private static String convertOptionToPropertyName(String name) {
+ String rc="";
+
+ // Look for '-' and strip and then convert the subsequent char to uppercase
+ int p = name.indexOf("-");
+ while( p > 0 ) {
+ // strip
+ rc += name.substring(0, p);
+ name = name.substring(p+1);
+
+ // can I convert the next char to upper?
+ if( name.length() >0 ) {
+ rc += name.substring(0,1).toUpperCase();
+ name = name.substring(1);
+ }
+
+ p = name.indexOf("-");
+ }
+ return rc+name;
+ }
+}
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CommandLineSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/CompilerException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/EnumDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/EnumFieldDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/ExtensionsDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/FieldDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/IntrospectionSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/JavaGenerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/MessageDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/MethodDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/OptionDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/ParserSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/ProtoDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/ProtoMojo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/ServiceDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/TextFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/activemq-protobuf/src/main/java/org/apache/activemq/protobuf/compiler/TypeDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-protobuf/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/AbstractFlowQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/AbstractFlowRelay.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/CursoredQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/ExclusivePersistentQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/ExclusivePriorityQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/ExclusiveQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IAsynchronousFlowSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IBlockingFlowSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IFlowQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IPartitionedQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IPollableFlowSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/IQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/MultiFlowQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/PartitionedQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/PersistencePolicy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/QueueDescriptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/QueueDispatchTarget.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/QueueStore.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/RestoreListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/RestoredElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/SaveableQueueElement.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/SharedPriorityQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/SharedQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/SharedQueueOld.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/SingleFlowRelay.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/main/java/org/apache/activemq/queue/Subscription.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/AbstractTestConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/BrokerConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ClientConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Message.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/MessageGenerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/MockBroker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/MockBrokerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/MockClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/MockQueue.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Proto2WireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Proto2WireFormatFactory.java?rev=781514&r1=781513&r2=781514&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Proto2WireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Proto2WireFormatFactory.java Wed Jun 3 19:20:13 2009
@@ -1,277 +1,277 @@
-package org.apache.activemq.flow;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.util.Map;
-
-import org.apache.activemq.flow.Commands.Destination.DestinationBean;
-import org.apache.activemq.flow.Commands.Destination.DestinationBuffer;
-import org.apache.activemq.flow.Commands.FlowControl.FlowControlBean;
-import org.apache.activemq.flow.Commands.FlowControl.FlowControlBuffer;
-import org.apache.activemq.flow.Commands.Message.MessageBean;
-import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.DataByteArrayInputStream;
-import org.apache.activemq.util.DataByteArrayOutputStream;
-import org.apache.activemq.util.IOExceptionSupport;
-import org.apache.activemq.wireformat.StatefulWireFormat;
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.wireformat.WireFormatFactory;
-
-public class Proto2WireFormatFactory implements WireFormatFactory {
-
- public class TestWireFormat implements StatefulWireFormat {
- private ByteBuffer currentOut;
- private byte outType;
-
- private ByteBuffer currentIn;
- private byte inType;
-
- public void marshal(Object value, DataOutput out) throws IOException {
- if( value.getClass() == Message.class ) {
- out.writeByte(0);
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- MessageBean proto = ((Message)value).getProto().copy();
- proto.writeExternal(baos);
- out.writeInt(baos.size());
- out.write(baos.getData(), 0, baos.size());
- } else if( value.getClass() == String.class ) {
- out.writeByte(1);
- String value2 = (String) value;
- byte[] bytes = value2.getBytes("UTF-8");
- out.writeInt(bytes.length);
- out.write(bytes);
- } else if( value.getClass() == DestinationBuffer.class ) {
- out.writeByte(2);
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- DestinationBean proto = ((DestinationBuffer)value).copy();
- proto.writeExternal(baos);
- out.writeInt(baos.size());
- out.write(baos.getData(), 0, baos.size());
- }else if( value.getClass() == FlowControlBuffer.class ) {
- out.writeByte(3);
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- FlowControlBean proto = ((FlowControlBuffer)value).copy();
- proto.writeExternal(baos);
- out.writeInt(baos.size());
- out.write(baos.getData(), 0, baos.size());
-
- } else {
- throw new IOException("Unsupported type: "+value.getClass());
- }
- }
-
- public Object unmarshal(DataInput in) throws IOException {
- byte type = in.readByte();
- int size = in.readInt();
- switch(type) {
- case 0: {
- MessageBean proto = new MessageBean();
- proto.readExternal(in);
- return new Message(proto.freeze());
- }
- case 1: {
- byte data[] = new byte[size];
- in.readFully(data);
- return new String(data, "UTF-8");
- } case 2: {
- DestinationBean proto = new DestinationBean();
- proto.readExternal(in);
- return proto.freeze();
- } case 3: {
- FlowControlBean proto = new FlowControlBean();
- proto.readExternal(in);
- return proto.freeze();
- }
- default:
- throw new IOException("Unknonw type byte: ");
- }
- }
-
- public boolean marshal(Object value, ByteBuffer target) throws IOException
- {
- if(currentOut == null)
- {
- //Ensure room for type byte and length byte:
- if(target.remaining() < 5)
- {
- return false;
- }
-
- if( value.getClass() == Message.class ) {
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- MessageBean proto = ((Message)value).getProto().copy();
- proto.writeExternal(baos);
- currentOut = ByteBuffer.wrap(baos.getData(), 0, baos.size());
- outType = 0;
- } else if( value.getClass() == String.class ) {
- outType = 1;
- try {
- currentOut = ByteBuffer.wrap(((String)value).getBytes("utf-8"));
- } catch (UnsupportedEncodingException e) {
- //Shouldn't happen.
- throw IOExceptionSupport.create(e);
- }
- } else if( value.getClass() == DestinationBuffer.class ) {
- outType = 2;
-
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- DestinationBean proto = ((DestinationBuffer)value).copy();
- proto.writeExternal(baos);
- currentOut = ByteBuffer.wrap(baos.getData(), 0, baos.size());
- }else if( value.getClass() == FlowControlBuffer.class ) {
- outType = 3;
- DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
- FlowControlBean proto = ((FlowControlBuffer)value).copy();
- proto.writeExternal(baos);
- }else {
- throw new IOException("Unsupported type: "+value.getClass());
- }
-
- //Write type:
- target.put(outType);
- //Write length:
- target.putInt(currentOut.remaining());
- if(currentOut.remaining() > 1024*1024)
- {
- throw new IOException("Packet exceeded max memory size!");
- }
- }
-
- //Avoid overflow:
- if(currentOut.remaining() > target.remaining())
- {
- int limit = currentOut.limit();
- currentOut.limit(currentOut.position() + target.remaining());
- target.put(currentOut);
- currentOut.limit(limit);
- }
- else
- {
- target.put(currentOut);
- }
-
- if(!currentOut.hasRemaining())
- {
- currentOut = null;
- return true;
- }
- return false;
- }
-
- /**
- * Unmarshals an object. When the object is read it is returned.
- * @param source
- * @return The object when unmarshalled, null otherwise
- */
- public Object unMarshal(ByteBuffer source) throws IOException
- {
- if(currentIn == null)
- {
- if(source.remaining() < 5)
- {
- return null;
- }
-
- inType = source.get();
- int length = source.getInt();
- if(length > 1024*1024)
- {
- throw new IOException("Packet exceeded max memory size!");
- }
- currentIn = ByteBuffer.wrap(new byte[length]);
-
- }
-
- if(!source.hasRemaining())
- {
- return null;
- }
-
- if(source.remaining() > currentIn.remaining())
- {
- int limit = source.limit();
- source.limit(source.position() + currentIn.remaining());
- currentIn.put(source);
- source.limit(limit);
- }
- else
- {
- currentIn.put(source);
- }
-
- //If we haven't finished the packet return to get more data:
- if(currentIn.hasRemaining())
- {
- return null;
- }
-
- Object ret = null;
- switch(inType) {
- case 0: {
- DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
- MessageBean proto = new MessageBean();
- proto.readExternal(in);
- ret = new Message(proto.freeze());
- break;
- }
- case 1: {
- ret = new String(currentIn.array(), "utf-8");
- break;
- }
- case 2: {
- DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
- DestinationBean proto = new DestinationBean();
- proto.readExternal(in);
- ret = proto.freeze();
- break;
- }
- case 3: {
- DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
- FlowControlBean proto = new FlowControlBean();
- proto.readExternal(in);
- ret = proto.freeze();
- break;
- }
- default:
- throw new IOException("Unknown type byte: " + inType);
- }
-
- currentIn = null;
- return ret;
- }
-
- public int getVersion() {
- return 0;
- }
- public void setVersion(int version) {
- }
-
- public boolean inReceive() {
- return false;
- }
-
- public ByteSequence marshal(Object value) throws IOException {
- DataByteArrayOutputStream os = new DataByteArrayOutputStream();
- marshal(value, os);
- return os.toByteSequence();
- }
-
- public Object unmarshal(ByteSequence data) throws IOException {
- DataByteArrayInputStream is = new DataByteArrayInputStream(data);
- return unmarshal(is);
- }
-
- public Transport createTransportFilters(Transport transport, Map options) {
- return transport;
- }
- }
-
- public WireFormat createWireFormat() {
- return new TestWireFormat();
- }
-
-}
+package org.apache.activemq.flow;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.util.Map;
+
+import org.apache.activemq.flow.Commands.Destination.DestinationBean;
+import org.apache.activemq.flow.Commands.Destination.DestinationBuffer;
+import org.apache.activemq.flow.Commands.FlowControl.FlowControlBean;
+import org.apache.activemq.flow.Commands.FlowControl.FlowControlBuffer;
+import org.apache.activemq.flow.Commands.Message.MessageBean;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.DataByteArrayInputStream;
+import org.apache.activemq.util.DataByteArrayOutputStream;
+import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.wireformat.StatefulWireFormat;
+import org.apache.activemq.wireformat.WireFormat;
+import org.apache.activemq.wireformat.WireFormatFactory;
+
+public class Proto2WireFormatFactory implements WireFormatFactory {
+
+ public class TestWireFormat implements StatefulWireFormat {
+ private ByteBuffer currentOut;
+ private byte outType;
+
+ private ByteBuffer currentIn;
+ private byte inType;
+
+ public void marshal(Object value, DataOutput out) throws IOException {
+ if( value.getClass() == Message.class ) {
+ out.writeByte(0);
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ MessageBean proto = ((Message)value).getProto().copy();
+ proto.writeExternal(baos);
+ out.writeInt(baos.size());
+ out.write(baos.getData(), 0, baos.size());
+ } else if( value.getClass() == String.class ) {
+ out.writeByte(1);
+ String value2 = (String) value;
+ byte[] bytes = value2.getBytes("UTF-8");
+ out.writeInt(bytes.length);
+ out.write(bytes);
+ } else if( value.getClass() == DestinationBuffer.class ) {
+ out.writeByte(2);
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ DestinationBean proto = ((DestinationBuffer)value).copy();
+ proto.writeExternal(baos);
+ out.writeInt(baos.size());
+ out.write(baos.getData(), 0, baos.size());
+ }else if( value.getClass() == FlowControlBuffer.class ) {
+ out.writeByte(3);
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ FlowControlBean proto = ((FlowControlBuffer)value).copy();
+ proto.writeExternal(baos);
+ out.writeInt(baos.size());
+ out.write(baos.getData(), 0, baos.size());
+
+ } else {
+ throw new IOException("Unsupported type: "+value.getClass());
+ }
+ }
+
+ public Object unmarshal(DataInput in) throws IOException {
+ byte type = in.readByte();
+ int size = in.readInt();
+ switch(type) {
+ case 0: {
+ MessageBean proto = new MessageBean();
+ proto.readExternal(in);
+ return new Message(proto.freeze());
+ }
+ case 1: {
+ byte data[] = new byte[size];
+ in.readFully(data);
+ return new String(data, "UTF-8");
+ } case 2: {
+ DestinationBean proto = new DestinationBean();
+ proto.readExternal(in);
+ return proto.freeze();
+ } case 3: {
+ FlowControlBean proto = new FlowControlBean();
+ proto.readExternal(in);
+ return proto.freeze();
+ }
+ default:
+ throw new IOException("Unknonw type byte: ");
+ }
+ }
+
+ public boolean marshal(Object value, ByteBuffer target) throws IOException
+ {
+ if(currentOut == null)
+ {
+ //Ensure room for type byte and length byte:
+ if(target.remaining() < 5)
+ {
+ return false;
+ }
+
+ if( value.getClass() == Message.class ) {
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ MessageBean proto = ((Message)value).getProto().copy();
+ proto.writeExternal(baos);
+ currentOut = ByteBuffer.wrap(baos.getData(), 0, baos.size());
+ outType = 0;
+ } else if( value.getClass() == String.class ) {
+ outType = 1;
+ try {
+ currentOut = ByteBuffer.wrap(((String)value).getBytes("utf-8"));
+ } catch (UnsupportedEncodingException e) {
+ //Shouldn't happen.
+ throw IOExceptionSupport.create(e);
+ }
+ } else if( value.getClass() == DestinationBuffer.class ) {
+ outType = 2;
+
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ DestinationBean proto = ((DestinationBuffer)value).copy();
+ proto.writeExternal(baos);
+ currentOut = ByteBuffer.wrap(baos.getData(), 0, baos.size());
+ }else if( value.getClass() == FlowControlBuffer.class ) {
+ outType = 3;
+ DataByteArrayOutputStream baos = new DataByteArrayOutputStream();
+ FlowControlBean proto = ((FlowControlBuffer)value).copy();
+ proto.writeExternal(baos);
+ }else {
+ throw new IOException("Unsupported type: "+value.getClass());
+ }
+
+ //Write type:
+ target.put(outType);
+ //Write length:
+ target.putInt(currentOut.remaining());
+ if(currentOut.remaining() > 1024*1024)
+ {
+ throw new IOException("Packet exceeded max memory size!");
+ }
+ }
+
+ //Avoid overflow:
+ if(currentOut.remaining() > target.remaining())
+ {
+ int limit = currentOut.limit();
+ currentOut.limit(currentOut.position() + target.remaining());
+ target.put(currentOut);
+ currentOut.limit(limit);
+ }
+ else
+ {
+ target.put(currentOut);
+ }
+
+ if(!currentOut.hasRemaining())
+ {
+ currentOut = null;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Unmarshals an object. When the object is read it is returned.
+ * @param source
+ * @return The object when unmarshalled, null otherwise
+ */
+ public Object unMarshal(ByteBuffer source) throws IOException
+ {
+ if(currentIn == null)
+ {
+ if(source.remaining() < 5)
+ {
+ return null;
+ }
+
+ inType = source.get();
+ int length = source.getInt();
+ if(length > 1024*1024)
+ {
+ throw new IOException("Packet exceeded max memory size!");
+ }
+ currentIn = ByteBuffer.wrap(new byte[length]);
+
+ }
+
+ if(!source.hasRemaining())
+ {
+ return null;
+ }
+
+ if(source.remaining() > currentIn.remaining())
+ {
+ int limit = source.limit();
+ source.limit(source.position() + currentIn.remaining());
+ currentIn.put(source);
+ source.limit(limit);
+ }
+ else
+ {
+ currentIn.put(source);
+ }
+
+ //If we haven't finished the packet return to get more data:
+ if(currentIn.hasRemaining())
+ {
+ return null;
+ }
+
+ Object ret = null;
+ switch(inType) {
+ case 0: {
+ DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
+ MessageBean proto = new MessageBean();
+ proto.readExternal(in);
+ ret = new Message(proto.freeze());
+ break;
+ }
+ case 1: {
+ ret = new String(currentIn.array(), "utf-8");
+ break;
+ }
+ case 2: {
+ DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
+ DestinationBean proto = new DestinationBean();
+ proto.readExternal(in);
+ ret = proto.freeze();
+ break;
+ }
+ case 3: {
+ DataByteArrayInputStream in = new DataByteArrayInputStream(currentIn.array());
+ FlowControlBean proto = new FlowControlBean();
+ proto.readExternal(in);
+ ret = proto.freeze();
+ break;
+ }
+ default:
+ throw new IOException("Unknown type byte: " + inType);
+ }
+
+ currentIn = null;
+ return ret;
+ }
+
+ public int getVersion() {
+ return 0;
+ }
+ public void setVersion(int version) {
+ }
+
+ public boolean inReceive() {
+ return false;
+ }
+
+ public ByteSequence marshal(Object value) throws IOException {
+ DataByteArrayOutputStream os = new DataByteArrayOutputStream();
+ marshal(value, os);
+ return os.toByteSequence();
+ }
+
+ public Object unmarshal(ByteSequence data) throws IOException {
+ DataByteArrayInputStream is = new DataByteArrayInputStream(data);
+ return unmarshal(is);
+ }
+
+ public Transport createTransportFilters(Transport transport, Map options) {
+ return transport;
+ }
+ }
+
+ public WireFormat createWireFormat() {
+ return new TestWireFormat();
+ }
+
+}
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Proto2WireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ProtoWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ProtoWireFormatFactory.java?rev=781514&r1=781513&r2=781514&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ProtoWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ProtoWireFormatFactory.java Wed Jun 3 19:20:13 2009
@@ -1,249 +1,249 @@
-package org.apache.activemq.flow;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.util.Map;
-
-import org.apache.activemq.flow.Commands.Destination.DestinationBuffer;
-import org.apache.activemq.flow.Commands.FlowControl.FlowControlBuffer;
-import org.apache.activemq.flow.Commands.Message.MessageBuffer;
-import org.apache.activemq.protobuf.Buffer;
-import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.DataByteArrayInputStream;
-import org.apache.activemq.util.DataByteArrayOutputStream;
-import org.apache.activemq.util.IOExceptionSupport;
-import org.apache.activemq.wireformat.StatefulWireFormat;
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.wireformat.WireFormatFactory;
-
-public class ProtoWireFormatFactory implements WireFormatFactory {
-
- public class TestWireFormat implements StatefulWireFormat {
- private ByteBuffer currentOut;
- private byte outType;
-
- private ByteBuffer currentIn;
- private byte inType;
-
- public void marshal(Object value, DataOutput out) throws IOException {
- if( value.getClass() == Message.class ) {
- out.writeByte(0);
- MessageBuffer proto = ((Message)value).getProto();
- Buffer buffer = proto.toUnframedBuffer();
- out.writeInt(buffer.getLength());
- out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
- } else if( value.getClass() == String.class ) {
- out.writeByte(1);
- String value2 = (String) value;
- byte[] bytes = value2.getBytes("UTF-8");
- out.writeInt(bytes.length);
- out.write(bytes);
- } else if( value.getClass() == DestinationBuffer.class ) {
- out.writeByte(2);
- DestinationBuffer proto = (DestinationBuffer)value;
- Buffer buffer = proto.toUnframedBuffer();
- out.writeInt(buffer.getLength());
- out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
- }else if( value.getClass() == FlowControlBuffer.class ) {
- out.writeByte(3);
- FlowControlBuffer proto = (FlowControlBuffer)value;
- Buffer buffer = proto.toUnframedBuffer();
- out.writeInt(buffer.getLength());
- out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
- } else {
- throw new IOException("Unsupported type: "+value.getClass());
- }
- }
-
- public Object unmarshal(DataInput in) throws IOException {
- byte type = in.readByte();
- int size = in.readInt();
- byte data[] = new byte[size];
- in.readFully(data);
- switch(type) {
- case 0:
- MessageBuffer m = MessageBuffer.parseUnframed(data);
- return new Message(m);
- case 1:
- return new String(data, "UTF-8");
- case 2:
- DestinationBuffer d = DestinationBuffer.parseUnframed(data);
- return d;
- case 3:
- FlowControlBuffer fc = FlowControlBuffer.parseUnframed(data);
- return fc;
- default:
- throw new IOException("Unknonw type byte: ");
- }
- }
-
- public boolean marshal(Object value, ByteBuffer target) throws IOException
- {
- if(currentOut == null)
- {
- //Ensure room for type byte and length byte:
- if(target.remaining() < 5)
- {
- return false;
- }
-
- if( value.getClass() == Message.class ) {
-
- currentOut = ByteBuffer.wrap(((Message)value).getProto().toUnframedByteArray());
- outType = 0;
- } else if( value.getClass() == String.class ) {
- outType = 1;
- try {
- currentOut = ByteBuffer.wrap(((String)value).getBytes("utf-8"));
- } catch (UnsupportedEncodingException e) {
- //Shouldn't happen.
- throw IOExceptionSupport.create(e);
- }
- } else if( value.getClass() == DestinationBuffer.class ) {
- outType = 2;
- currentOut = ByteBuffer.wrap(((DestinationBuffer)value).toUnframedByteArray());
- }else if( value.getClass() == FlowControlBuffer.class ) {
- outType = 3;
- currentOut = ByteBuffer.wrap(((FlowControlBuffer)value).toUnframedByteArray());
- }else {
- throw new IOException("Unsupported type: "+value.getClass());
- }
-
- //Write type:
- target.put(outType);
- //Write length:
- target.putInt(currentOut.remaining());
- if(currentOut.remaining() > 1024*1024)
- {
- throw new IOException("Packet exceeded max memory size!");
- }
- }
-
- //Avoid overflow:
- if(currentOut.remaining() > target.remaining())
- {
- int limit = currentOut.limit();
- currentOut.limit(currentOut.position() + target.remaining());
- target.put(currentOut);
- currentOut.limit(limit);
- }
- else
- {
- target.put(currentOut);
- }
-
- if(!currentOut.hasRemaining())
- {
- currentOut = null;
- return true;
- }
- return false;
- }
-
- /**
- * Unmarshals an object. When the object is read it is returned.
- * @param source
- * @return The object when unmarshalled, null otherwise
- */
- public Object unMarshal(ByteBuffer source) throws IOException
- {
- if(currentIn == null)
- {
- if(source.remaining() < 5)
- {
- return null;
- }
-
- inType = source.get();
- int length = source.getInt();
- if(length > 1024*1024)
- {
- throw new IOException("Packet exceeded max memory size!");
- }
- currentIn = ByteBuffer.wrap(new byte[length]);
-
- }
-
- if(!source.hasRemaining())
- {
- return null;
- }
-
- if(source.remaining() > currentIn.remaining())
- {
- int limit = source.limit();
- source.limit(source.position() + currentIn.remaining());
- currentIn.put(source);
- source.limit(limit);
- }
- else
- {
- currentIn.put(source);
- }
-
- //If we haven't finished the packet return to get more data:
- if(currentIn.hasRemaining())
- {
- return null;
- }
-
- Object ret = null;
- switch(inType) {
- case 0:
- MessageBuffer m = MessageBuffer.parseUnframed(currentIn.array());
- ret = new Message(m);
- break;
- case 1:
- ret = new String(currentIn.array(), "utf-8");
- break;
- case 2:
- DestinationBuffer d = DestinationBuffer.parseUnframed(currentIn.array());
- ret = d;
- break;
- case 3:
- FlowControlBuffer c = FlowControlBuffer.parseUnframed(currentIn.array());
- ret = c;
- break;
- default:
- throw new IOException("Unknown type byte: " + inType);
- }
-
- currentIn = null;
- return ret;
- }
-
- public int getVersion() {
- return 0;
- }
- public void setVersion(int version) {
- }
-
- public boolean inReceive() {
- return false;
- }
-
- public ByteSequence marshal(Object value) throws IOException {
- DataByteArrayOutputStream os = new DataByteArrayOutputStream();
- marshal(value, os);
- return os.toByteSequence();
- }
-
- public Object unmarshal(ByteSequence data) throws IOException {
- DataByteArrayInputStream is = new DataByteArrayInputStream(data);
- return unmarshal(is);
- }
-
- public Transport createTransportFilters(Transport transport, Map options) {
- return transport;
- }
- }
-
- public WireFormat createWireFormat() {
- return new TestWireFormat();
- }
-
-}
+package org.apache.activemq.flow;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.ByteBuffer;
+import java.util.Map;
+
+import org.apache.activemq.flow.Commands.Destination.DestinationBuffer;
+import org.apache.activemq.flow.Commands.FlowControl.FlowControlBuffer;
+import org.apache.activemq.flow.Commands.Message.MessageBuffer;
+import org.apache.activemq.protobuf.Buffer;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.DataByteArrayInputStream;
+import org.apache.activemq.util.DataByteArrayOutputStream;
+import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.wireformat.StatefulWireFormat;
+import org.apache.activemq.wireformat.WireFormat;
+import org.apache.activemq.wireformat.WireFormatFactory;
+
+public class ProtoWireFormatFactory implements WireFormatFactory {
+
+ public class TestWireFormat implements StatefulWireFormat {
+ private ByteBuffer currentOut;
+ private byte outType;
+
+ private ByteBuffer currentIn;
+ private byte inType;
+
+ public void marshal(Object value, DataOutput out) throws IOException {
+ if( value.getClass() == Message.class ) {
+ out.writeByte(0);
+ MessageBuffer proto = ((Message)value).getProto();
+ Buffer buffer = proto.toUnframedBuffer();
+ out.writeInt(buffer.getLength());
+ out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
+ } else if( value.getClass() == String.class ) {
+ out.writeByte(1);
+ String value2 = (String) value;
+ byte[] bytes = value2.getBytes("UTF-8");
+ out.writeInt(bytes.length);
+ out.write(bytes);
+ } else if( value.getClass() == DestinationBuffer.class ) {
+ out.writeByte(2);
+ DestinationBuffer proto = (DestinationBuffer)value;
+ Buffer buffer = proto.toUnframedBuffer();
+ out.writeInt(buffer.getLength());
+ out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
+ }else if( value.getClass() == FlowControlBuffer.class ) {
+ out.writeByte(3);
+ FlowControlBuffer proto = (FlowControlBuffer)value;
+ Buffer buffer = proto.toUnframedBuffer();
+ out.writeInt(buffer.getLength());
+ out.write(buffer.getData(), buffer.getOffset(), buffer.getLength());
+ } else {
+ throw new IOException("Unsupported type: "+value.getClass());
+ }
+ }
+
+ public Object unmarshal(DataInput in) throws IOException {
+ byte type = in.readByte();
+ int size = in.readInt();
+ byte data[] = new byte[size];
+ in.readFully(data);
+ switch(type) {
+ case 0:
+ MessageBuffer m = MessageBuffer.parseUnframed(data);
+ return new Message(m);
+ case 1:
+ return new String(data, "UTF-8");
+ case 2:
+ DestinationBuffer d = DestinationBuffer.parseUnframed(data);
+ return d;
+ case 3:
+ FlowControlBuffer fc = FlowControlBuffer.parseUnframed(data);
+ return fc;
+ default:
+ throw new IOException("Unknonw type byte: ");
+ }
+ }
+
+ public boolean marshal(Object value, ByteBuffer target) throws IOException
+ {
+ if(currentOut == null)
+ {
+ //Ensure room for type byte and length byte:
+ if(target.remaining() < 5)
+ {
+ return false;
+ }
+
+ if( value.getClass() == Message.class ) {
+
+ currentOut = ByteBuffer.wrap(((Message)value).getProto().toUnframedByteArray());
+ outType = 0;
+ } else if( value.getClass() == String.class ) {
+ outType = 1;
+ try {
+ currentOut = ByteBuffer.wrap(((String)value).getBytes("utf-8"));
+ } catch (UnsupportedEncodingException e) {
+ //Shouldn't happen.
+ throw IOExceptionSupport.create(e);
+ }
+ } else if( value.getClass() == DestinationBuffer.class ) {
+ outType = 2;
+ currentOut = ByteBuffer.wrap(((DestinationBuffer)value).toUnframedByteArray());
+ }else if( value.getClass() == FlowControlBuffer.class ) {
+ outType = 3;
+ currentOut = ByteBuffer.wrap(((FlowControlBuffer)value).toUnframedByteArray());
+ }else {
+ throw new IOException("Unsupported type: "+value.getClass());
+ }
+
+ //Write type:
+ target.put(outType);
+ //Write length:
+ target.putInt(currentOut.remaining());
+ if(currentOut.remaining() > 1024*1024)
+ {
+ throw new IOException("Packet exceeded max memory size!");
+ }
+ }
+
+ //Avoid overflow:
+ if(currentOut.remaining() > target.remaining())
+ {
+ int limit = currentOut.limit();
+ currentOut.limit(currentOut.position() + target.remaining());
+ target.put(currentOut);
+ currentOut.limit(limit);
+ }
+ else
+ {
+ target.put(currentOut);
+ }
+
+ if(!currentOut.hasRemaining())
+ {
+ currentOut = null;
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Unmarshals an object. When the object is read it is returned.
+ * @param source
+ * @return The object when unmarshalled, null otherwise
+ */
+ public Object unMarshal(ByteBuffer source) throws IOException
+ {
+ if(currentIn == null)
+ {
+ if(source.remaining() < 5)
+ {
+ return null;
+ }
+
+ inType = source.get();
+ int length = source.getInt();
+ if(length > 1024*1024)
+ {
+ throw new IOException("Packet exceeded max memory size!");
+ }
+ currentIn = ByteBuffer.wrap(new byte[length]);
+
+ }
+
+ if(!source.hasRemaining())
+ {
+ return null;
+ }
+
+ if(source.remaining() > currentIn.remaining())
+ {
+ int limit = source.limit();
+ source.limit(source.position() + currentIn.remaining());
+ currentIn.put(source);
+ source.limit(limit);
+ }
+ else
+ {
+ currentIn.put(source);
+ }
+
+ //If we haven't finished the packet return to get more data:
+ if(currentIn.hasRemaining())
+ {
+ return null;
+ }
+
+ Object ret = null;
+ switch(inType) {
+ case 0:
+ MessageBuffer m = MessageBuffer.parseUnframed(currentIn.array());
+ ret = new Message(m);
+ break;
+ case 1:
+ ret = new String(currentIn.array(), "utf-8");
+ break;
+ case 2:
+ DestinationBuffer d = DestinationBuffer.parseUnframed(currentIn.array());
+ ret = d;
+ break;
+ case 3:
+ FlowControlBuffer c = FlowControlBuffer.parseUnframed(currentIn.array());
+ ret = c;
+ break;
+ default:
+ throw new IOException("Unknown type byte: " + inType);
+ }
+
+ currentIn = null;
+ return ret;
+ }
+
+ public int getVersion() {
+ return 0;
+ }
+ public void setVersion(int version) {
+ }
+
+ public boolean inReceive() {
+ return false;
+ }
+
+ public ByteSequence marshal(Object value) throws IOException {
+ DataByteArrayOutputStream os = new DataByteArrayOutputStream();
+ marshal(value, os);
+ return os.toByteSequence();
+ }
+
+ public Object unmarshal(ByteSequence data) throws IOException {
+ DataByteArrayInputStream is = new DataByteArrayInputStream(data);
+ return unmarshal(is);
+ }
+
+ public Transport createTransportFilters(Transport transport, Map options) {
+ return transport;
+ }
+ }
+
+ public WireFormat createWireFormat() {
+ return new TestWireFormat();
+ }
+
+}
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/ProtoWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/RemoteConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/RemoteProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/Router.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestFlowManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestWireFormatFactory.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestWireFormatFactory.java?rev=781514&r1=781513&r2=781514&view=diff
==============================================================================
--- activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestWireFormatFactory.java (original)
+++ activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestWireFormatFactory.java Wed Jun 3 19:20:13 2009
@@ -1,72 +1,72 @@
-package org.apache.activemq.flow;
-
-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;
-import java.util.Map;
-
-import org.apache.activemq.transport.Transport;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.IOExceptionSupport;
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.wireformat.WireFormatFactory;
-
-public class TestWireFormatFactory implements WireFormatFactory {
-
- static public class TestWireFormat implements WireFormat {
-
- public void marshal(Object value, DataOutput out) throws IOException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.writeObject(value);
- oos.close();
-
- byte[] data = baos.toByteArray();
- out.writeInt(data.length);
- out.write(data);
- }
-
- public Object unmarshal(DataInput in) throws IOException {
- byte data[] = new byte[in.readInt()];
- in.readFully(data);
-
- ByteArrayInputStream is = new ByteArrayInputStream(data);
- ObjectInputStream ois = new ObjectInputStream(is);
- try {
- return ois.readObject();
- } catch (ClassNotFoundException e) {
- throw IOExceptionSupport.create(e);
- }
- }
-
- public int getVersion() {
- return 0;
- }
- public void setVersion(int version) {
- }
-
- public boolean inReceive() {
- return false;
- }
-
- public ByteSequence marshal(Object value) throws IOException {
- return null;
- }
- public Object unmarshal(ByteSequence data) throws IOException {
- return null;
- }
-
- public Transport createTransportFilters(Transport transport, Map options) {
- return transport;
- }
- }
-
- public WireFormat createWireFormat() {
- return new TestWireFormat();
- }
-
-}
+package org.apache.activemq.flow;
+
+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;
+import java.util.Map;
+
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.util.ByteSequence;
+import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.wireformat.WireFormat;
+import org.apache.activemq.wireformat.WireFormatFactory;
+
+public class TestWireFormatFactory implements WireFormatFactory {
+
+ static public class TestWireFormat implements WireFormat {
+
+ public void marshal(Object value, DataOutput out) throws IOException {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(value);
+ oos.close();
+
+ byte[] data = baos.toByteArray();
+ out.writeInt(data.length);
+ out.write(data);
+ }
+
+ public Object unmarshal(DataInput in) throws IOException {
+ byte data[] = new byte[in.readInt()];
+ in.readFully(data);
+
+ ByteArrayInputStream is = new ByteArrayInputStream(data);
+ ObjectInputStream ois = new ObjectInputStream(is);
+ try {
+ return ois.readObject();
+ } catch (ClassNotFoundException e) {
+ throw IOExceptionSupport.create(e);
+ }
+ }
+
+ public int getVersion() {
+ return 0;
+ }
+ public void setVersion(int version) {
+ }
+
+ public boolean inReceive() {
+ return false;
+ }
+
+ public ByteSequence marshal(Object value) throws IOException {
+ return null;
+ }
+ public Object unmarshal(ByteSequence data) throws IOException {
+ return null;
+ }
+
+ public Transport createTransportFilters(Transport transport, Map options) {
+ return transport;
+ }
+ }
+
+ public WireFormat createWireFormat() {
+ return new TestWireFormat();
+ }
+
+}
Propchange: activemq/sandbox/activemq-flow/activemq-queue/src/test/java/org/apache/activemq/flow/TestWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/ArithmeticExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/BinaryExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/BooleanExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/ComparisonExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/ConstantExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/Expression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/FilterException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/LogicExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/MessageEvaluationContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/PropertyExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/UnaryExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/XPathExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/XQueryExpression.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-selector/src/main/java/org/apache/activemq/filter/XalanXPathEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/FrameTranslator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/JmsFrameTranslator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/LegacyFrameTranslator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageDelivery.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompMessageEvaluationContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/broker/stomp/StompProtocolHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/main/java/org/apache/activemq/wireformat/DiscriminatableStompWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/test/java/org/apache/activemq/broker/openwire/stomp/StompBrokerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/test/java/org/apache/activemq/broker/openwire/stomp/StompRemoteConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-stomp/src/test/java/org/apache/activemq/broker/openwire/stomp/StompRemoteProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/Store.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/StoreFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/main/java/org/apache/activemq/broker/store/memory/MemoryStore.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StorePerformanceBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/StoreTestBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-store/src/test/java/org/apache/activemq/broker/store/memory/MemoryStoreTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/ThreadPriorities.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/broker/SslContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/AsyncTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/CompositeTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/DefaultTransportListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/DispatchableTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/DispatchableTransportServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/FutureResponse.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/InactivityIOException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/MonitoredTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/MutexTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/ResponseCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/ThreadNameFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/Transport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportAcceptListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportDisposedIOException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportServerSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/TransportThreadSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/WriteTimeoutFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/discovery/DiscoveryAgentFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/discovery/DiscoveryEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/discovery/DiscoveryListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/Pipe.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/transport/pipe/PipeTransportFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ConcatInputStream.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/DiscriminatableWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/MultiWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/ObjectStreamWireFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/StatefulWireFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-transport/src/main/java/org/apache/activemq/wireformat/WireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/Service.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/JNDIBaseStorable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/JNDIReferenceFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/JNDIStorableInterface.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/LazyCreateContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/NameParserImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/jndi/ReadOnlyContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/metric/Metric.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/metric/MetricAggregator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/metric/MetricCounter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/metric/Period.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: activemq/sandbox/activemq-flow/activemq-util/src/main/java/org/apache/activemq/protobuf/AsciiBuffer.java
------------------------------------------------------------------------------
svn:eol-style = native