You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/04/20 01:50:33 UTC

[incubator-servicecomb-java-chassis] 09/09: SCB-483 change asyncBeforeSendResponse to beforeSendResponseAsync

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 719a079592fa3dabd1f251599462df88ef7f68e5
Author: wujimin <wu...@huawei.com>
AuthorDate: Thu Apr 19 14:29:16 2018 +0800

    SCB-483 change asyncBeforeSendResponse to beforeSendResponseAsync
---
 .../org/apache/servicecomb/common/rest/filter/HttpServerFilter.java   | 2 +-
 .../rest/filter/HttpServerFilterBeforeSendResponseExecutor.java       | 2 +-
 .../servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java    | 2 +-
 .../apache/servicecomb/common/rest/filter/TestHttpServerFilter.java   | 4 ++--
 .../rest/filter/TestHttpServerFilterBeforeSendResponseExecutor.java   | 2 +-
 .../common/rest/filter/inner/TestServerRestArgsFilter.java            | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilter.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilter.java
index 594c262..8e56e99 100644
--- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilter.java
+++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilter.java
@@ -41,7 +41,7 @@ public interface HttpServerFilter {
   /**
    * @param invocation maybe null
    */
-  default CompletableFuture<Void> asyncBeforeSendResponse(Invocation invocation, HttpServletResponseEx responseEx) {
+  default CompletableFuture<Void> beforeSendResponseAsync(Invocation invocation, HttpServletResponseEx responseEx) {
     CompletableFuture<Void> future = new CompletableFuture<>();
     try {
       beforeSendResponse(invocation, responseEx);
diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilterBeforeSendResponseExecutor.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilterBeforeSendResponseExecutor.java
index 70889cc..b07485a 100644
--- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilterBeforeSendResponseExecutor.java
+++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/HttpServerFilterBeforeSendResponseExecutor.java
@@ -48,7 +48,7 @@ public class HttpServerFilterBeforeSendResponseExecutor {
 
   protected CompletableFuture<Void> safeInvoke(HttpServerFilter httpServerFilter) {
     try {
-      return httpServerFilter.asyncBeforeSendResponse(invocation, responseEx);
+      return httpServerFilter.beforeSendResponseAsync(invocation, responseEx);
     } catch (Throwable e) {
       CompletableFuture<Void> eFuture = new CompletableFuture<Void>();
       eFuture.completeExceptionally(e);
diff --git a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java
index f740568..c806fc0 100644
--- a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java
+++ b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/filter/inner/ServerRestArgsFilter.java
@@ -54,7 +54,7 @@ public class ServerRestArgsFilter implements HttpServerFilter {
   }
 
   @Override
-  public CompletableFuture<Void> asyncBeforeSendResponse(Invocation invocation, HttpServletResponseEx responseEx) {
+  public CompletableFuture<Void> beforeSendResponseAsync(Invocation invocation, HttpServletResponseEx responseEx) {
     Response response = (Response) responseEx.getAttribute(RestConst.INVOCATION_HANDLER_RESPONSE);
     ProduceProcessor produceProcessor =
         (ProduceProcessor) responseEx.getAttribute(RestConst.INVOCATION_HANDLER_PROCESSOR);
diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilter.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilter.java
index d7b0d01..38c1f97 100644
--- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilter.java
+++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilter.java
@@ -35,7 +35,7 @@ public class TestHttpServerFilter {
   public void asyncSucc() throws InterruptedException, ExecutionException {
     HttpServerFilter filter = new HttpServerFilterBaseForTest();
 
-    CompletableFuture<Void> future = filter.asyncBeforeSendResponse(null, null);
+    CompletableFuture<Void> future = filter.beforeSendResponseAsync(null, null);
     Assert.assertNull(future.get());
   }
 
@@ -51,7 +51,7 @@ public class TestHttpServerFilter {
     expectedException.expect(ExecutionException.class);
     expectedException.expectCause(Matchers.instanceOf(Error.class));
 
-    CompletableFuture<Void> future = filter.asyncBeforeSendResponse(null, null);
+    CompletableFuture<Void> future = filter.beforeSendResponseAsync(null, null);
     future.get();
   }
 }
diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilterBeforeSendResponseExecutor.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilterBeforeSendResponseExecutor.java
index ba565ab..0708f8f 100644
--- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilterBeforeSendResponseExecutor.java
+++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/TestHttpServerFilterBeforeSendResponseExecutor.java
@@ -63,7 +63,7 @@ public class TestHttpServerFilterBeforeSendResponseExecutor {
   public void runFail() throws InterruptedException, ExecutionException {
     httpServerFilters.add(new HttpServerFilterBaseForTest() {
       @Override
-      public CompletableFuture<Void> asyncBeforeSendResponse(Invocation invocation, HttpServletResponseEx responseEx) {
+      public CompletableFuture<Void> beforeSendResponseAsync(Invocation invocation, HttpServletResponseEx responseEx) {
         throw new Error("");
       }
     });
diff --git a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/inner/TestServerRestArgsFilter.java b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/inner/TestServerRestArgsFilter.java
index 9f8ed6c..8a322e0 100644
--- a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/inner/TestServerRestArgsFilter.java
+++ b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/filter/inner/TestServerRestArgsFilter.java
@@ -67,7 +67,7 @@ public class TestServerRestArgsFilter {
       }
     };
 
-    Assert.assertNull(filter.asyncBeforeSendResponse(invocation, responseEx));
+    Assert.assertNull(filter.beforeSendResponseAsync(invocation, responseEx));
     Assert.assertTrue(invokedSendPart);
   }
 }

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.