activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: Create versioned instead of generic frames from STOMP decoder
Date Tue, 14 Jul 2015 13:53:46 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master f17991e58 -> 4167c5f2c


Create versioned instead of generic frames from STOMP decoder


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3deb20f0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3deb20f0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3deb20f0

Branch: refs/heads/master
Commit: 3deb20f049bec05c4c559b3654c36989924e643d
Parents: f17991e
Author: Ville Skyttä <ville.skytta@iki.fi>
Authored: Tue Jul 14 11:53:14 2015 +0300
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Jul 14 09:53:35 2015 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/protocol/stomp/StompDecoder.java  | 9 +++++++--
 .../activemq/artemis/core/protocol/stomp/StompFrame.java    | 2 +-
 .../core/protocol/stomp/v10/StompFrameHandlerV10.java       | 2 +-
 .../core/protocol/stomp/v11/StompFrameHandlerV11.java       | 7 ++++++-
 .../core/protocol/stomp/v12/StompFrameHandlerV12.java       | 8 +++++---
 5 files changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3deb20f0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
index 19e7dda..3bbe88f 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java
@@ -162,8 +162,11 @@ public class StompDecoder
    //max len of EOL (default is 1 for '\n')
    protected int eolLen = 1;
 
-   public StompDecoder()
+   private final VersionedStompFrameHandler handler;
+
+   public StompDecoder(VersionedStompFrameHandler handler)
    {
+      this.handler = handler;
    }
 
    public boolean hasBytes()
@@ -276,7 +279,9 @@ public class StompDecoder
 
          // reset
 
-         StompFrame ret = new StompFrame(command, headers, content);
+         StompFrame ret = handler.createStompFrame(command);
+         ret.headers = headers;
+         ret.setByteBody(content);
 
          init();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3deb20f0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
index 491c6a9..cb6ede5 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompFrame.java
@@ -33,7 +33,7 @@ public class StompFrame
 
    protected final String command;
 
-   protected final Map<String, String> headers;
+   protected Map<String, String> headers;
 
    private String body;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3deb20f0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
index 7cbf771..e492060 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v10/StompFrameHandlerV10.java
@@ -35,7 +35,7 @@ public class StompFrameHandlerV10 extends VersionedStompFrameHandler implements
    public StompFrameHandlerV10(StompConnection connection)
    {
       super(connection);
-      decoder = new StompDecoder();
+      decoder = new StompDecoder(this);
       decoder.init();
       connection.addStompEventListener(this);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3deb20f0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
index 656ed8d..e30742e 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v11/StompFrameHandlerV11.java
@@ -41,7 +41,7 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler implements
    {
       super(connection);
       connection.addStompEventListener(this);
-      decoder = new StompDecoderV11();
+      decoder = new StompDecoderV11(this);
       decoder.init();
    }
 
@@ -428,6 +428,11 @@ public class StompFrameHandlerV11 extends VersionedStompFrameHandler
implements
       protected boolean isEscaping = false;
       protected SimpleBytes holder = new SimpleBytes(1024);
 
+      public StompDecoderV11(StompFrameHandlerV11 handler)
+      {
+         super(handler);
+      }
+
       @Override
       public void init(StompDecoder decoder)
       {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3deb20f0/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java
b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java
index ca9b6fe..b1632e7 100644
--- a/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java
+++ b/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/v12/StompFrameHandlerV12.java
@@ -35,7 +35,7 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements
FrameE
    public StompFrameHandlerV12(StompConnection connection)
    {
       super(connection);
-      decoder = new StompDecoderV12();
+      decoder = new StompDecoderV12(this);
       decoder.init();
    }
 
@@ -99,9 +99,11 @@ public class StompFrameHandlerV12 extends StompFrameHandlerV11 implements
FrameE
    {
       protected boolean nextEOLChar = false;
 
-      public StompDecoderV12()
+      public StompDecoderV12(StompFrameHandlerV12 handler)
       {
-         //1.2 allow '\r\n'
+         super(handler);
+
+         //1.2 allows '\r\n'
          eolLen = 2;
       }
 


Mime
View raw message