Skip to content

Commit

Permalink
ConnectionHandler is independent of ProcessorType
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1713257 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Nov 8, 2015
1 parent e338caf commit 8c6a1c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions java/org/apache/coyote/AbstractProtocol.java
Expand Up @@ -657,7 +657,7 @@ public void destroy() {


// ------------------------------------------- Connection handler base class // ------------------------------------------- Connection handler base class


protected static class ConnectionHandler<S,P extends Processor> protected static class ConnectionHandler<S>
implements AbstractEndpoint.Handler<S> { implements AbstractEndpoint.Handler<S> {


private final AbstractProtocol<S> proto; private final AbstractProtocol<S> proto;
Expand All @@ -668,7 +668,7 @@ protected static class ConnectionHandler<S,P extends Processor>
protected final ConcurrentHashMap<S,Processor> connections = protected final ConcurrentHashMap<S,Processor> connections =
new ConcurrentHashMap<>(); new ConcurrentHashMap<>();


protected final RecycledProcessors<P,S> recycledProcessors = protected final RecycledProcessors<S> recycledProcessors =
new RecycledProcessors<>(this); new RecycledProcessors<>(this);


public ConnectionHandler(AbstractProtocol<S> proto) { public ConnectionHandler(AbstractProtocol<S> proto) {
Expand Down Expand Up @@ -1015,13 +1015,12 @@ public final void pause() {
} }
} }


protected static class RecycledProcessors<P extends Processor, S> protected static class RecycledProcessors<S> extends SynchronizedStack<Processor> {
extends SynchronizedStack<Processor> {


private final transient ConnectionHandler<S,P> handler; private final transient ConnectionHandler<S> handler;
protected final AtomicInteger size = new AtomicInteger(0); protected final AtomicInteger size = new AtomicInteger(0);


public RecycledProcessors(ConnectionHandler<S,P> handler) { public RecycledProcessors(ConnectionHandler<S> handler) {
this.handler = handler; this.handler = handler;
} }


Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/ajp/AbstractAjpProtocol.java
Expand Up @@ -48,7 +48,7 @@ public AbstractAjpProtocol(AbstractEndpoint<S> endpoint) {
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
// AJP does not use Send File // AJP does not use Send File
getEndpoint().setUseSendfile(false); getEndpoint().setUseSendfile(false);
ConnectionHandler<S,AjpProcessor> cHandler = new ConnectionHandler<>(this); ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
setHandler(cHandler); setHandler(cHandler);
getEndpoint().setHandler(cHandler); getEndpoint().setHandler(cHandler);
} }
Expand Down
2 changes: 1 addition & 1 deletion java/org/apache/coyote/http11/AbstractHttp11Protocol.java
Expand Up @@ -52,7 +52,7 @@ public abstract class AbstractHttp11Protocol<S> extends AbstractProtocol<S> {
public AbstractHttp11Protocol(AbstractEndpoint<S> endpoint) { public AbstractHttp11Protocol(AbstractEndpoint<S> endpoint) {
super(endpoint); super(endpoint);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT); setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
ConnectionHandler<S,Http11Processor> cHandler = new ConnectionHandler<>(this); ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
setHandler(cHandler); setHandler(cHandler);
getEndpoint().setHandler(cHandler); getEndpoint().setHandler(cHandler);
} }
Expand Down

0 comments on commit 8c6a1c6

Please sign in to comment.