tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1044692 - in /tomcat/trunk/java/org/apache: catalina/core/AsyncContextImpl.java coyote/AsyncContextCallback.java coyote/AsyncStateMachine.java coyote/ajp/AbstractAjpProcessor.java coyote/http11/AbstractHttp11Processor.java
Date Sat, 11 Dec 2010 18:27:16 GMT
Author: markt
Date: Sat Dec 11 18:27:15 2010
New Revision: 1044692

URL: http://svn.apache.org/viewvc?rev=1044692&view=rev
Log:
Coyote should not depend on Catalina

Added:
    tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java   (with props)
Modified:
    tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
    tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1044692&r1=1044691&r2=1044692&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Sat Dec 11 18:27:15 2010
@@ -43,6 +43,7 @@ import org.apache.catalina.Context;
 import org.apache.catalina.Globals;
 import org.apache.catalina.connector.Request;
 import org.apache.coyote.ActionCode;
+import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.RequestInfo;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -52,7 +53,7 @@ import org.apache.tomcat.InstanceManager
  * @author fhanik
  *
  */
-public class AsyncContextImpl implements AsyncContext {
+public class AsyncContextImpl implements AsyncContext, AsyncContextCallback {
     
     private static final Log log = LogFactory.getLog(AsyncContextImpl.class);
     

Added: tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java?rev=1044692&view=auto
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java (added)
+++ tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java Sat Dec 11 18:27:15 2010
@@ -0,0 +1,28 @@
+/*
+ *  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.coyote;
+
+/**
+ * Provides a mechanism for the Coyote connectors to signal to a
+ * {@link javax.servlet.AsyncContext} implementation that an action, such as
+ * firing event listeners needs to be taken. It is implemented in this manner
+ * so that the org.apache.coyote package does not have a dependency on the
+ * org.apache.coyote package.  
+ */
+public interface AsyncContextCallback {
+    public void fireOnComplete();
+}

Propchange: tomcat/trunk/java/org/apache/coyote/AsyncContextCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1044692&r1=1044691&r2=1044692&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java Sat Dec 11 18:27:15 2010
@@ -19,7 +19,6 @@ package org.apache.coyote;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import org.apache.catalina.core.AsyncContextImpl;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -96,7 +95,7 @@ public class AsyncStateMachine {
 
     private volatile AsyncState state = AsyncState.DISPATCHED;
     // Need this to fire listener on complete
-    private AsyncContextImpl asyncCtxt = null;
+    private AsyncContextCallback asyncCtxt = null;
     private Processor processor;
     
     
@@ -122,7 +121,7 @@ public class AsyncStateMachine {
     }
 
 
-    public synchronized void asyncStart(AsyncContextImpl asyncCtxt) {
+    public synchronized void asyncStart(AsyncContextCallback asyncCtxt) {
         if (state == AsyncState.DISPATCHED) {
             state = AsyncState.STARTING;
             this.asyncCtxt = asyncCtxt;

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1044692&r1=1044691&r2=1044692&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Sat Dec 11 18:27:15
2010
@@ -25,10 +25,10 @@ import java.security.cert.X509Certificat
 import java.util.concurrent.Executor;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.catalina.core.AsyncContextImpl;
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.ActionHook;
 import org.apache.coyote.Adapter;
+import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.AsyncStateMachine;
 import org.apache.coyote.InputBuffer;
 import org.apache.coyote.Processor;
@@ -334,7 +334,7 @@ public abstract class AbstractAjpProcess
            replay = true;
 
        } else if (actionCode == ActionCode.ASYNC_START) {
-           asyncStateMachine.asyncStart((AsyncContextImpl) param);
+           asyncStateMachine.asyncStart((AsyncContextCallback) param);
        } else if (actionCode == ActionCode.ASYNC_DISPATCHED) {
            asyncStateMachine.asyncDispatched();
        } else if (actionCode == ActionCode.ASYNC_TIMEOUT) {

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1044692&r1=1044691&r2=1044692&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat Dec 11 18:27:15
2010
@@ -23,10 +23,10 @@ import java.util.concurrent.atomic.Atomi
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import org.apache.catalina.core.AsyncContextImpl;
 import org.apache.coyote.ActionCode;
 import org.apache.coyote.ActionHook;
 import org.apache.coyote.Adapter;
+import org.apache.coyote.AsyncContextCallback;
 import org.apache.coyote.AsyncStateMachine;
 import org.apache.coyote.Processor;
 import org.apache.coyote.Request;
@@ -915,7 +915,7 @@ public abstract class AbstractHttp11Proc
                 request.getInputBuffer();
             internalBuffer.addActiveFilter(savedBody);
         } else if (actionCode == ActionCode.ASYNC_START) {
-            asyncStateMachine.asyncStart((AsyncContextImpl) param);
+            asyncStateMachine.asyncStart((AsyncContextCallback) param);
         } else if (actionCode == ActionCode.ASYNC_DISPATCHED) {
             asyncStateMachine.asyncDispatched();
         } else if (actionCode == ActionCode.ASYNC_TIMEOUT) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message