You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2008/06/14 17:35:14 UTC
svn commit: r667816 -
/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/
Author: costin
Date: Sat Jun 14 08:35:14 2008
New Revision: 667816
URL: http://svn.apache.org/viewvc?rev=667816&view=rev
Log:
Various coyote adapters, as example and for testing.
Added:
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java (with props)
Modified:
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SleepAdapter.java
tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ClientAbortException.java Sat Jun 14 08:35:14 2008
@@ -1,9 +1,10 @@
/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed 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
+ * 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
*
@@ -13,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.apache.coyote.adapters;
import java.io.IOException;
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteMain.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,19 @@
+/*
+ * 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.adapters;
import org.apache.coyote.Adapter;
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/CoyoteServer.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,18 @@
+/* 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.adapters;
import java.lang.management.ManagementFactory;
@@ -5,6 +20,7 @@
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.coyote.http11.Http11NioProtocol;
+import org.apache.coyote.http11.async.AsyncProtocolHandler;
import org.apache.juli.JdkLoggerConfig;
import org.apache.tomcat.util.buf.BufferInfo;
import org.apache.tomcat.util.modeler.Registry;
@@ -35,7 +51,7 @@
protected Adapter adapter;
protected int maxThreads = 20;
boolean started = false;
-
+ boolean async = false; // use old nio connector
public CoyoteServer() {
}
@@ -88,6 +104,10 @@
daemon = b;
}
+ public void setAsync(boolean b) {
+ async = b;
+ }
+
public void init() {
JdkLoggerConfig.loadCustom();
}
@@ -122,6 +142,9 @@
public void setPort(int port) {
initJMX();
+ if (proto != null) {
+ proto.setAttribute("port", Integer.toString(port));
+ }
this.port = port;
}
@@ -134,8 +157,20 @@
setConnector(proto);
}
+ public void setAsyncConnector() {
+ AsyncProtocolHandler proto = new AsyncProtocolHandler();
+ proto.setPort(port);
+ proto.setDaemon(daemon);
+
+ setConnector(proto);
+ }
+
public void setConnector(ProtocolHandler h) {
this.proto = h;
+ h.setAttribute("port", Integer.toString(port));
+ if (daemon) {
+ h.setAttribute("daemon", "1");
+ }
}
public void start() {
@@ -145,7 +180,11 @@
}
if (proto == null) {
// Default for now.
- setNioConnector();
+ if (async) {
+ setAsyncConnector();
+ } else {
+ setNioConnector();
+ }
}
initAdapters();
registry.registerComponent(adapter, ":name=adapter" + (port), null);
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/EchoAdapter.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,18 @@
+/* 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.adapters;
import java.util.logging.Logger;
@@ -5,7 +20,7 @@
import org.apache.coyote.Adapter;
import org.apache.coyote.Request;
import org.apache.coyote.Response;
-//import org.apache.coyote.client.AsyncHttp;
+import org.apache.coyote.client.AsyncHttp;
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.net.SocketStatus;
@@ -24,7 +39,7 @@
public void service(Request req, final Response res) throws Exception {
ByteChunk reqBuf = new ByteChunk(1024);
reqBuf.append("REQ HEAD:\n");
- //AsyncHttp.serializeRequest(req, reqBuf);
+ AsyncHttp.serializeRequest(req, reqBuf);
reqBuf.append("CONTENT_LENGTH:")
.append(Integer.toString(req.getContentLength()))
.append("\n");
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MapperAdapter.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,18 @@
+/* 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.adapters;
import java.io.IOException;
@@ -179,22 +194,24 @@
} else {
res.setStatus(404);
}
-
+ } catch(IOException ex) {
+ throw ex;
} catch( Throwable t ) {
t.printStackTrace();
- }
+ } finally {
- // Final processing
- // TODO: only if not commet, this doesn't work with the
- // other connectors since we don't have the info
- // TODO: add this note in the nio/apr connectors
- // TODO: play nice with TomcatLite, other adapters that flush/close
- if (res.getNote(CoyoteServer.COMET_RES_NOTE) == null) {
- MessageWriter.getWriter(req, res, 0).flush();
- res.finish();
+ // Final processing
+ // TODO: only if not commet, this doesn't work with the
+ // other connectors since we don't have the info
+ // TODO: add this note in the nio/apr connectors
+ // TODO: play nice with TomcatLite, other adapters that flush/close
+ if (res.getNote(CoyoteServer.COMET_RES_NOTE) == null) {
+ MessageWriter.getWriter(req, res, 0).flush();
+ res.finish();
- req.recycle();
- res.recycle();
+ req.recycle();
+ res.recycle();
+ }
}
}
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageReader.java Sat Jun 14 08:35:14 2008
@@ -1,9 +1,10 @@
/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed 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
+ * 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
*
@@ -12,15 +13,11 @@
* 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.adapters;
import java.io.IOException;
import java.io.Reader;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import java.util.HashMap;
import org.apache.coyote.Request;
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/MessageWriter.java Sat Jun 14 08:35:14 2008
@@ -1,9 +1,10 @@
/*
- * Copyright 1999,2004 The Apache Software Foundation.
- *
- * Licensed 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
+ * 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
*
@@ -12,8 +13,7 @@
* 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.adapters;
@@ -30,7 +30,6 @@
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.C2BConverter;
import org.apache.tomcat.util.buf.CharChunk;
-import org.apache.tomcat.util.buf.MessageBytes;
/*
* Refactoring: original code in catalina.connector.
Added: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java?rev=667816&view=auto
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java (added)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java Sat Jun 14 08:35:14 2008
@@ -0,0 +1,184 @@
+/*
+ * 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.adapters;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletException;
+
+import org.apache.coyote.ActionCode;
+import org.apache.coyote.Adapter;
+import org.apache.coyote.Request;
+import org.apache.coyote.Response;
+import org.apache.coyote.client.AsyncHttp;
+import org.apache.coyote.client.AsyncHttpCallback;
+import org.apache.coyote.client.AsyncHttpPool;
+import org.apache.coyote.http11.async.AsyncHttpProcessor;
+import org.apache.tomcat.util.buf.ByteChunk;
+import org.apache.tomcat.util.net.SocketStatus;
+
+/**
+ * Simple proxy adapter, for testing
+ *
+ * @author Costin Manolache
+ */
+public class ProxyAdapter implements Adapter {
+
+ String target = "localhost";
+ int port = 8902;
+ Logger log = Logger.getLogger("ProxyAdapter");
+ static boolean debug = true;
+
+ ProxyClientCallback proxyClientCallback = new ProxyClientCallback();
+
+ AsyncHttpPool cpool = new AsyncHttpPool("proxy", null);
+
+ public ProxyAdapter() {
+ }
+
+ public ProxyAdapter(String host, int port) {
+ this.target = host;
+ this.port = port;
+ }
+
+ public boolean event(Request req, Response res, SocketStatus status)
+ throws Exception {
+ log.info("Coyote event " + status);
+ return false;
+ }
+
+ public void service(Request req, Response res) throws Exception {
+ if (debug) {
+ log.info("Req: " + req.requestURI().toString());
+ }
+
+ // TODO: forward input body, register a callback on server.
+
+ // Send the request with a non-blocking write
+ sendRequestNB(req, res, target, port);
+
+ // Used by the new connector
+ // At this point the buffer is sent - callbacks will work their magic.
+ // comet - wait for data input on ext, will be forwarded to the other end
+ res.action(ActionCode.ACTION_COMET_BEGIN, null);
+ }
+
+
+ private void sendRequestNB(Request req, Response res, String host, int port)
+ throws IOException {
+ // Client connection
+ AsyncHttp cstate = cpool.get();
+ cstate.setRequest(req, res);
+ cstate.setCallback(proxyClientCallback);
+
+ // Will send the original request (TODO: small changes)
+ // Response is not affected ( we use the callback )
+ cstate.setRequest(req, res);
+ cstate.connect(host, port);
+ }
+
+ /**
+ * Callback on the client side - will forward to the server.
+ */
+ public class ProxyClientCallback extends AsyncHttpCallback {
+
+ // from client side - to be sent to user.
+ @Override
+ public void dataReceived(AsyncHttp client, final Response res,
+ final ByteChunk data, ByteChunk buffer, List<String> encodings) throws IOException {
+ if (buffer.getBuffer().length -
+ buffer.getEnd() < 16) {
+ ByteChunk newBuffer = new ByteChunk(2048);
+ client.setRawReadBuffer(newBuffer);
+ log.info("Replacing recv buffer " + newBuffer.length() + " " +
+ newBuffer.getBuffer());
+ }
+
+ log.info("dataReceived len=" + data.length() + " " +
+ data.getBuffer());
+
+ AsyncHttp sproc =
+ ((AsyncHttpCallback.AsyncHttpHolder) res.getOutputBuffer()).getAsyncHttp();
+
+ ByteChunk clone = new ByteChunk();
+ clone.setBytes(data.getBuffer(), data.getOffset(), data.length());
+ boolean done = sproc.startWrite(clone);
+
+ }
+
+ @Override
+ public void done(AsyncHttp client, boolean error, Throwable exception)
+ throws IOException
+ {
+ if (debug) {
+ log.info("proxy response done");
+ }
+ // Will be recycled
+ client.release();
+
+ AsyncHttpProcessor sproc = (AsyncHttpProcessor)
+ (((AsyncHttpCallback.AsyncHttpHolder) client.getResponse().getOutputBuffer()).getAsyncHttp());
+ try {
+ sproc.release();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void bodyReceived(AsyncHttp client, Request req, Response res,
+ boolean error, Throwable exception) throws IOException {
+ res.finish(); // will be recycled after remaining
+ }
+
+
+ /**
+ * From the client - make few changes.
+ * TODO: deal with version missmatches.
+ */
+ @Override
+ public void headersReceived(AsyncHttp client, Request req,
+ Response res) {
+ // it fills in the response, nothing to do - we
+ // could flush
+ if (debug) {
+ log.info("proxy head received from client, status = " +
+ client.getStatus());
+ }
+
+ res.getMimeHeaders().addValue("TomcatProxy").setString("True");
+
+ // Will be sent to the server.
+ res.action(ActionCode.ACTION_COMMIT, res);
+ }
+
+ @Override
+ public void dataWritten(ByteChunk bc) {
+ }
+ }
+
+ public static void main(String[] args) throws ServletException, IOException {
+ CoyoteServer server = new CoyoteServer(8901, new ProxyAdapter());
+ server.setDaemon(false);
+ server.setAsync(true);
+ server.start();
+ }
+
+}
Propchange: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/ProxyAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SimpleFileAdapter.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,19 @@
+/*
+ * 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.adapters;
import java.io.File;
@@ -10,7 +26,6 @@
import org.apache.coyote.Request;
import org.apache.coyote.Response;
import org.apache.tomcat.util.buf.ByteChunk;
-import org.apache.tomcat.util.buf.C2BConverter;
import org.apache.tomcat.util.net.SocketStatus;
/**
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SleepAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SleepAdapter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SleepAdapter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/SleepAdapter.java Sat Jun 14 08:35:14 2008
@@ -1,15 +1,27 @@
+/*
+ * 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.adapters;
-import java.io.FileInputStream;
-import java.io.IOException;
-
import org.apache.coyote.ActionCode;
import org.apache.coyote.Request;
import org.apache.coyote.Response;
-import org.apache.tomcat.util.net.SocketStatus;
/**
- * Test adapters that sleeps.
+ * Test adapters that sleeps, for load test and for encoding.
*/
public class SleepAdapter extends StaticAdapter {
long t1;
Modified: tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java?rev=667816&r1=667815&r2=667816&view=diff
==============================================================================
--- tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java (original)
+++ tomcat/sandbox/tomcat-lite/coyote-extensions/org/apache/coyote/adapters/StaticAdapter.java Sat Jun 14 08:35:14 2008
@@ -1,3 +1,19 @@
+/*
+ * 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.adapters;
import java.io.FileInputStream;
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org