Author: gaohoward
Date: 2011-11-22 02:23:59 -0500 (Tue, 22 Nov 2011)
New Revision: 11738
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/VersionedStompFrameHandler.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v11/StompFrameHandlerV11.java
Log:
code refactor
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/VersionedStompFrameHandler.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/VersionedStompFrameHandler.java 2011-11-22
04:12:00 UTC (rev 11737)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/VersionedStompFrameHandler.java 2011-11-22
07:23:59 UTC (rev 11738)
@@ -132,8 +132,6 @@
return receipt;
}
-
- public abstract StompFrame postprocess(StompFrame request);
public abstract StompFrame createMessageFrame(ServerMessage serverMessage,
StompSubscription subscription, int deliveryCount) throws Exception;
@@ -278,4 +276,26 @@
return response;
}
+ public StompFrame postprocess(StompFrame request)
+ {
+ StompFrame response = null;
+ if (request.hasHeader(Stomp.Headers.RECEIPT_REQUESTED))
+ {
+ response = handleReceipt(request.getHeader(Stomp.Headers.RECEIPT_REQUESTED));
+ if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
+ {
+ response.setNeedsDisconnect(true);
+ }
+ }
+ else
+ {
+ //request null, disconnect if so.
+ if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
+ {
+ this.connection.disconnect();
+ }
+ }
+ return response;
+ }
+
}
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java 2011-11-22
04:12:00 UTC (rev 11737)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v10/StompFrameHandlerV10.java 2011-11-22
07:23:59 UTC (rev 11738)
@@ -246,28 +246,5 @@
// TODO Auto-generated method stub
}
-
- @Override
- public StompFrame postprocess(StompFrame request)
- {
- StompFrame response = null;
- if (request.hasHeader(Stomp.Headers.RECEIPT_REQUESTED))
- {
- response = handleReceipt(request.getHeader(Stomp.Headers.RECEIPT_REQUESTED));
- if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
- {
- response.setNeedsDisconnect(true);
- }
- }
- else
- {
- //request null, disconnect if so.
- if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
- {
- this.connection.disconnect();
- }
- }
- return response;
- }
}
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v11/StompFrameHandlerV11.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v11/StompFrameHandlerV11.java 2011-11-22
04:12:00 UTC (rev 11737)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/protocol/stomp/v11/StompFrameHandlerV11.java 2011-11-22
07:23:59 UTC (rev 11738)
@@ -166,29 +166,6 @@
}
return null;
}
-
- @Override
- public StompFrame postprocess(StompFrame request)
- {
- StompFrame response = null;
- if (request.hasHeader(Stomp.Headers.RECEIPT_REQUESTED))
- {
- response = handleReceipt(request.getHeader(Stomp.Headers.RECEIPT_REQUESTED));
- if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
- {
- response.setNeedsDisconnect(true);
- }
- }
- else
- {
- //request null, disconnect if so.
- if (request.getCommand().equals(Stomp.Commands.DISCONNECT))
- {
- this.connection.disconnect();
- }
- }
- return response;
- }
@Override
public StompFrame onUnsubscribe(StompFrame request)