You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by tr...@apache.org on 2007/05/16 10:44:25 UTC

svn commit: r538482 - /mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java

Author: trustin
Date: Wed May 16 01:44:24 2007
New Revision: 538482

URL: http://svn.apache.org/viewvc?view=rev&rev=538482
Log:
Added Request.hasResponse() method

Modified:
    mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java

Modified: mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java
URL: http://svn.apache.org/viewvc/mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java?view=diff&rev=538482&r1=538481&r2=538482
==============================================================================
--- mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java (original)
+++ mina/trunk/core/src/main/java/org/apache/mina/filter/reqres/Request.java Wed May 16 01:44:24 2007
@@ -92,6 +92,11 @@
         return useResponseQueue;
     }
     
+    public boolean hasResponse() {
+        checkUseResponseQueue();
+        return !responses.isEmpty();
+    }
+    
     public Response awaitResponse() throws RequestTimeoutException, InterruptedException {
         checkUseResponseQueue();
         chechEndOfResponses();
@@ -134,7 +139,7 @@
 
     private void checkUseResponseQueue() {
         if (!useResponseQueue) {
-            throw new IllegalStateException(
+            throw new UnsupportedOperationException(
                     "Response queue is not available; useResponseQueue is false.");
         }
     }