You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/11/23 23:51:07 UTC
svn commit: r1641286 - in /tomcat/trunk/java/org/apache/coyote: ./ ajp/
http11/ spdy/
Author: markt
Date: Sun Nov 23 22:51:07 2014
New Revision: 1641286
URL: http://svn.apache.org/r1641286
Log:
Make Protocol's reference to Endpoint final and pull-up getter.
Modified:
tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNio2Protocol.java
tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Protocol.java
tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocol.java Sun Nov 23 22:51:07 2014
@@ -87,7 +87,12 @@ public abstract class AbstractProtocol<S
* ProtocolHandler implementation (ProtocolHandler using NIO, requires NIO
* Endpoint etc.).
*/
- protected AbstractEndpoint<S> endpoint = null;
+ private final AbstractEndpoint<S> endpoint;
+
+
+ public AbstractProtocol(AbstractEndpoint<S> endpoint) {
+ this.endpoint = endpoint;
+ }
// ----------------------------------------------- Generic property handling
@@ -306,6 +311,13 @@ public abstract class AbstractProtocol<S
}
+ // ----------------------------------------------- Accessors for sub-classes
+
+ protected AbstractEndpoint<S> getEndpoint() {
+ return endpoint;
+ }
+
+
// -------------------------------------------------------- Abstract methods
/**
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProtocol.java Sun Nov 23 22:51:07 2014
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpUpgradeHan
import org.apache.coyote.AbstractProtocol;
import org.apache.coyote.Processor;
+import org.apache.tomcat.util.net.AbstractEndpoint;
import org.apache.tomcat.util.net.SocketWrapperBase;
import org.apache.tomcat.util.res.StringManager;
@@ -41,13 +42,17 @@ public abstract class AbstractAjpProtoco
protected static final StringManager sm = StringManager.getManager(AbstractAjpProtocol.class);
+ public AbstractAjpProtocol(AbstractEndpoint<S> endpoint) {
+ super(endpoint);
+ }
+
+
@Override
protected String getProtocolName() {
return "Ajp";
}
-
// ------------------------------------------------- AJP specific properties
// ------------------------------------------ managed in the ProtocolHandler
@@ -55,7 +60,7 @@ public abstract class AbstractAjpProtoco
* Should authentication be done in the native webserver layer,
* or in the Servlet container ?
*/
- protected boolean tomcatAuthentication = true;
+ private boolean tomcatAuthentication = true;
public boolean getTomcatAuthentication() { return tomcatAuthentication; }
public void setTomcatAuthentication(boolean tomcatAuthentication) {
this.tomcatAuthentication = tomcatAuthentication;
@@ -65,7 +70,7 @@ public abstract class AbstractAjpProtoco
/**
* Required secret.
*/
- protected String requiredSecret = null;
+ private String requiredSecret = null;
public void setRequiredSecret(String requiredSecret) {
this.requiredSecret = requiredSecret;
}
@@ -74,7 +79,7 @@ public abstract class AbstractAjpProtoco
/**
* AJP packet size.
*/
- protected int packetSize = Constants.MAX_PACKET_SIZE;
+ private int packetSize = Constants.MAX_PACKET_SIZE;
public int getPacketSize() { return packetSize; }
public void setPacketSize(int packetSize) {
if(packetSize < Constants.MAX_PACKET_SIZE) {
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Sun Nov 23 22:51:07 2014
@@ -55,14 +55,14 @@ public class AjpAprProtocol extends Abst
// ------------------------------------------------------------ Constructor
public AjpAprProtocol() {
- endpoint = new AprEndpoint();
+ super(new AprEndpoint());
cHandler = new AjpConnectionHandler(this);
- ((AprEndpoint) endpoint).setHandler(cHandler);
+ ((AprEndpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
// AJP does not use Send File
- endpoint.setUseSendfile(false);
+ getEndpoint().setUseSendfile(false);
}
@@ -78,12 +78,12 @@ public class AjpAprProtocol extends Abst
// --------------------------------------------------------- Public Methods
- public int getPollTime() { return ((AprEndpoint)endpoint).getPollTime(); }
- public void setPollTime(int pollTime) { ((AprEndpoint)endpoint).setPollTime(pollTime); }
+ public int getPollTime() { return ((AprEndpoint)getEndpoint()).getPollTime(); }
+ public void setPollTime(int pollTime) { ((AprEndpoint)getEndpoint()).setPollTime(pollTime); }
// pollerSize is now a synonym for maxConnections
- public void setPollerSize(int pollerSize) { endpoint.setMaxConnections(pollerSize); }
- public int getPollerSize() { return endpoint.getMaxConnections(); }
+ public void setPollerSize(int pollerSize) { getEndpoint().setMaxConnections(pollerSize); }
+ public int getPollerSize() { return getEndpoint().getMaxConnections(); }
// ----------------------------------------------------- JMX related methods
@@ -128,16 +128,17 @@ public class AjpAprProtocol extends Abst
processor.recycle(isSocketClosing);
recycledProcessors.push(processor);
if (addToPoller) {
- ((AprEndpoint)proto.endpoint).getPoller().add(
+ ((AprEndpoint)proto.getEndpoint()).getPoller().add(
socket.getSocket().longValue(),
- proto.endpoint.getKeepAliveTimeout(), true, false);
+ proto.getEndpoint().getKeepAliveTimeout(), true, false);
}
}
@Override
protected AjpProcessor<Long> createProcessor() {
- AjpProcessor<Long> processor = new AjpProcessor<>(proto.packetSize, proto.endpoint);
+ AjpProcessor<Long> processor =
+ new AjpProcessor<>(proto.getPacketSize(), proto.getEndpoint());
proto.configureProcessor(processor);
register(processor);
return processor;
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNio2Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNio2Protocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNio2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNio2Protocol.java Sun Nov 23 22:51:07 2014
@@ -52,14 +52,14 @@ public class AjpNio2Protocol extends Abs
public AjpNio2Protocol() {
- endpoint = new Nio2Endpoint();
+ super(new Nio2Endpoint());
cHandler = new AjpConnectionHandler(this);
- ((Nio2Endpoint) endpoint).setHandler(cHandler);
+ ((Nio2Endpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
// AJP does not use Send File
- endpoint.setUseSendfile(false);
+ getEndpoint().setUseSendfile(false);
}
@@ -142,7 +142,8 @@ public class AjpNio2Protocol extends Abs
@Override
protected AjpProcessor<Nio2Channel> createProcessor() {
- AjpProcessor<Nio2Channel> processor = new AjpProcessor<>(proto.packetSize, proto.endpoint);
+ AjpProcessor<Nio2Channel> processor =
+ new AjpProcessor<>(proto.getPacketSize(), proto.getEndpoint());
proto.configureProcessor(processor);
register(processor);
return processor;
@@ -155,7 +156,7 @@ public class AjpNio2Protocol extends Abs
@Override
public void closeAll() {
for (Nio2Channel channel : connections.keySet()) {
- ((Nio2Endpoint) proto.endpoint).closeSocket(channel.getSocket());
+ ((Nio2Endpoint) proto.getEndpoint()).closeSocket(channel.getSocket());
}
}
}
Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpNioProtocol.java Sun Nov 23 22:51:07 2014
@@ -54,14 +54,14 @@ public class AjpNioProtocol extends Abst
public AjpNioProtocol() {
- endpoint = new NioEndpoint();
+ super(new NioEndpoint());
cHandler = new AjpConnectionHandler(this);
- ((NioEndpoint) endpoint).setHandler(cHandler);
+ ((NioEndpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
// AJP does not use Send File
- endpoint.setUseSendfile(false);
+ getEndpoint().setUseSendfile(false);
}
@@ -169,7 +169,8 @@ public class AjpNioProtocol extends Abst
@Override
protected AjpProcessor<NioChannel> createProcessor() {
- AjpProcessor<NioChannel> processor = new AjpProcessor<>(proto.packetSize, proto.endpoint);
+ AjpProcessor<NioChannel> processor =
+ new AjpProcessor<>(proto.getPacketSize(), proto.getEndpoint());
proto.configureProcessor(processor);
register(processor);
return processor;
Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11JsseProtocol.java Sun Nov 23 22:51:07 2014
@@ -16,6 +16,7 @@
*/
package org.apache.coyote.http11;
+import org.apache.tomcat.util.net.AbstractEndpoint;
import org.apache.tomcat.util.net.SSLImplementation;
public abstract class AbstractHttp11JsseProtocol<S>
@@ -23,85 +24,89 @@ public abstract class AbstractHttp11Jsse
protected SSLImplementation sslImplementation = null;
- public String getAlgorithm() { return endpoint.getAlgorithm();}
- public void setAlgorithm(String s ) { endpoint.setAlgorithm(s);}
+ public AbstractHttp11JsseProtocol(AbstractEndpoint<S> endpoint) {
+ super(endpoint);
+ }
+
+ public String getAlgorithm() { return getEndpoint().getAlgorithm();}
+ public void setAlgorithm(String s ) { getEndpoint().setAlgorithm(s);}
- public String getClientAuth() { return endpoint.getClientAuth();}
- public void setClientAuth(String s ) { endpoint.setClientAuth(s);}
+ public String getClientAuth() { return getEndpoint().getClientAuth();}
+ public void setClientAuth(String s ) { getEndpoint().setClientAuth(s);}
- public String getKeystoreFile() { return endpoint.getKeystoreFile();}
- public void setKeystoreFile(String s ) { endpoint.setKeystoreFile(s);}
+ public String getKeystoreFile() { return getEndpoint().getKeystoreFile();}
+ public void setKeystoreFile(String s ) { getEndpoint().setKeystoreFile(s);}
- public String getKeystorePass() { return endpoint.getKeystorePass();}
- public void setKeystorePass(String s ) { endpoint.setKeystorePass(s);}
+ public String getKeystorePass() { return getEndpoint().getKeystorePass();}
+ public void setKeystorePass(String s ) { getEndpoint().setKeystorePass(s);}
- public String getKeystoreType() { return endpoint.getKeystoreType();}
- public void setKeystoreType(String s ) { endpoint.setKeystoreType(s);}
+ public String getKeystoreType() { return getEndpoint().getKeystoreType();}
+ public void setKeystoreType(String s ) { getEndpoint().setKeystoreType(s);}
public String getKeystoreProvider() {
- return endpoint.getKeystoreProvider();
+ return getEndpoint().getKeystoreProvider();
}
public void setKeystoreProvider(String s ) {
- endpoint.setKeystoreProvider(s);
+ getEndpoint().setKeystoreProvider(s);
}
- public String getSslProtocol() { return endpoint.getSslProtocol();}
- public void setSslProtocol(String s) { endpoint.setSslProtocol(s);}
+ public String getSslProtocol() { return getEndpoint().getSslProtocol();}
+ public void setSslProtocol(String s) { getEndpoint().setSslProtocol(s);}
- public String getCiphers() { return endpoint.getCiphers();}
- public void setCiphers(String s) { endpoint.setCiphers(s);}
- public String[] getCiphersUsed() { return endpoint.getCiphersUsed();}
+ public String getCiphers() { return getEndpoint().getCiphers();}
+ public void setCiphers(String s) { getEndpoint().setCiphers(s);}
+ public String[] getCiphersUsed() { return getEndpoint().getCiphersUsed();}
- public String getKeyAlias() { return endpoint.getKeyAlias();}
- public void setKeyAlias(String s ) { endpoint.setKeyAlias(s);}
+ public String getKeyAlias() { return getEndpoint().getKeyAlias();}
+ public void setKeyAlias(String s ) { getEndpoint().setKeyAlias(s);}
- public String getKeyPass() { return endpoint.getKeyPass();}
- public void setKeyPass(String s ) { endpoint.setKeyPass(s);}
+ public String getKeyPass() { return getEndpoint().getKeyPass();}
+ public void setKeyPass(String s ) { getEndpoint().setKeyPass(s);}
- public void setTruststoreFile(String f){ endpoint.setTruststoreFile(f);}
- public String getTruststoreFile(){ return endpoint.getTruststoreFile();}
+ public void setTruststoreFile(String f){ getEndpoint().setTruststoreFile(f);}
+ public String getTruststoreFile(){ return getEndpoint().getTruststoreFile();}
- public void setTruststorePass(String p){ endpoint.setTruststorePass(p);}
- public String getTruststorePass(){return endpoint.getTruststorePass();}
+ public void setTruststorePass(String p){ getEndpoint().setTruststorePass(p);}
+ public String getTruststorePass(){return getEndpoint().getTruststorePass();}
- public void setTruststoreType(String t){ endpoint.setTruststoreType(t);}
- public String getTruststoreType(){ return endpoint.getTruststoreType();}
+ public void setTruststoreType(String t){ getEndpoint().setTruststoreType(t);}
+ public String getTruststoreType(){ return getEndpoint().getTruststoreType();}
public void setTruststoreProvider(String t){
- endpoint.setTruststoreProvider(t);
+ getEndpoint().setTruststoreProvider(t);
}
public String getTruststoreProvider(){
- return endpoint.getTruststoreProvider();
+ return getEndpoint().getTruststoreProvider();
}
public void setTruststoreAlgorithm(String a){
- endpoint.setTruststoreAlgorithm(a);
+ getEndpoint().setTruststoreAlgorithm(a);
}
public String getTruststoreAlgorithm(){
- return endpoint.getTruststoreAlgorithm();
+ return getEndpoint().getTruststoreAlgorithm();
}
public void setTrustMaxCertLength(String s){
- endpoint.setTrustMaxCertLength(s);
+ getEndpoint().setTrustMaxCertLength(s);
}
public String getTrustMaxCertLength(){
- return endpoint.getTrustMaxCertLength();
+ return getEndpoint().getTrustMaxCertLength();
}
- public void setCrlFile(String s){endpoint.setCrlFile(s);}
- public String getCrlFile(){ return endpoint.getCrlFile();}
+ public void setCrlFile(String s){getEndpoint().setCrlFile(s);}
+ public String getCrlFile(){ return getEndpoint().getCrlFile();}
- public void setSessionCacheSize(String s){endpoint.setSessionCacheSize(s);}
- public String getSessionCacheSize(){ return endpoint.getSessionCacheSize();}
+ public void setSessionCacheSize(String s){getEndpoint().setSessionCacheSize(s);}
+ public String getSessionCacheSize(){ return getEndpoint().getSessionCacheSize();}
- public void setSessionTimeout(String s){endpoint.setSessionTimeout(s);}
- public String getSessionTimeout(){ return endpoint.getSessionTimeout();}
+ public void setSessionTimeout(String s){getEndpoint().setSessionTimeout(s);}
+ public String getSessionTimeout(){ return getEndpoint().getSessionTimeout();}
public void setAllowUnsafeLegacyRenegotiation(String s) {
- endpoint.setAllowUnsafeLegacyRenegotiation(s);
+ getEndpoint().setAllowUnsafeLegacyRenegotiation(s);
}
public String getAllowUnsafeLegacyRenegotiation() {
- return endpoint.getAllowUnsafeLegacyRenegotiation();
+ return getEndpoint().getAllowUnsafeLegacyRenegotiation();
}
private String sslImplementationName = null;
Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Sun Nov 23 22:51:07 2014
@@ -17,9 +17,15 @@
package org.apache.coyote.http11;
import org.apache.coyote.AbstractProtocol;
+import org.apache.tomcat.util.net.AbstractEndpoint;
public abstract class AbstractHttp11Protocol<S> extends AbstractProtocol<S> {
+ public AbstractHttp11Protocol(AbstractEndpoint<S> endpoint) {
+ super(endpoint);
+ }
+
+
@Override
protected String getProtocolName() {
return "Http";
@@ -189,9 +195,9 @@ public abstract class AbstractHttp11Prot
// ------------------------------------------------ HTTP specific properties
// ------------------------------------------ passed through to the EndPoint
- public boolean isSSLEnabled() { return endpoint.isSSLEnabled();}
+ public boolean isSSLEnabled() { return getEndpoint().isSSLEnabled();}
public void setSSLEnabled(boolean SSLEnabled) {
- endpoint.setSSLEnabled(SSLEnabled);
+ getEndpoint().setSSLEnabled(SSLEnabled);
}
@@ -200,10 +206,10 @@ public abstract class AbstractHttp11Prot
* connection. The default is the same as for Apache HTTP Server.
*/
public int getMaxKeepAliveRequests() {
- return endpoint.getMaxKeepAliveRequests();
+ return getEndpoint().getMaxKeepAliveRequests();
}
public void setMaxKeepAliveRequests(int mkar) {
- endpoint.setMaxKeepAliveRequests(mkar);
+ getEndpoint().setMaxKeepAliveRequests(mkar);
}
protected NpnHandler<S> npnHandler;
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Sun Nov 23 22:51:07 2014
@@ -65,9 +65,9 @@ public class Http11AprProtocol extends A
public Http11AprProtocol() {
- endpoint = new AprEndpoint();
+ super(new AprEndpoint());
cHandler = new Http11ConnectionHandler(this);
- ((AprEndpoint) endpoint).setHandler(cHandler);
+ ((AprEndpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@@ -75,47 +75,47 @@ public class Http11AprProtocol extends A
private final Http11ConnectionHandler cHandler;
- public boolean getUseSendfile() { return endpoint.getUseSendfile(); }
- public void setUseSendfile(boolean useSendfile) { ((AprEndpoint)endpoint).setUseSendfile(useSendfile); }
+ public boolean getUseSendfile() { return getEndpoint().getUseSendfile(); }
+ public void setUseSendfile(boolean useSendfile) { ((AprEndpoint)getEndpoint()).setUseSendfile(useSendfile); }
- public int getPollTime() { return ((AprEndpoint)endpoint).getPollTime(); }
- public void setPollTime(int pollTime) { ((AprEndpoint)endpoint).setPollTime(pollTime); }
+ public int getPollTime() { return ((AprEndpoint)getEndpoint()).getPollTime(); }
+ public void setPollTime(int pollTime) { ((AprEndpoint)getEndpoint()).setPollTime(pollTime); }
- public void setPollerSize(int pollerSize) { endpoint.setMaxConnections(pollerSize); }
- public int getPollerSize() { return endpoint.getMaxConnections(); }
+ public void setPollerSize(int pollerSize) { getEndpoint().setMaxConnections(pollerSize); }
+ public int getPollerSize() { return getEndpoint().getMaxConnections(); }
- public int getSendfileSize() { return ((AprEndpoint)endpoint).getSendfileSize(); }
- public void setSendfileSize(int sendfileSize) { ((AprEndpoint)endpoint).setSendfileSize(sendfileSize); }
+ public int getSendfileSize() { return ((AprEndpoint)getEndpoint()).getSendfileSize(); }
+ public void setSendfileSize(int sendfileSize) { ((AprEndpoint)getEndpoint()).setSendfileSize(sendfileSize); }
- public void setSendfileThreadCount(int sendfileThreadCount) { ((AprEndpoint)endpoint).setSendfileThreadCount(sendfileThreadCount); }
- public int getSendfileThreadCount() { return ((AprEndpoint)endpoint).getSendfileThreadCount(); }
+ public void setSendfileThreadCount(int sendfileThreadCount) { ((AprEndpoint)getEndpoint()).setSendfileThreadCount(sendfileThreadCount); }
+ public int getSendfileThreadCount() { return ((AprEndpoint)getEndpoint()).getSendfileThreadCount(); }
- public boolean getDeferAccept() { return ((AprEndpoint)endpoint).getDeferAccept(); }
- public void setDeferAccept(boolean deferAccept) { ((AprEndpoint)endpoint).setDeferAccept(deferAccept); }
+ public boolean getDeferAccept() { return ((AprEndpoint)getEndpoint()).getDeferAccept(); }
+ public void setDeferAccept(boolean deferAccept) { ((AprEndpoint)getEndpoint()).setDeferAccept(deferAccept); }
// -------------------- SSL related properties --------------------
/**
* SSL protocol.
*/
- public String getSSLProtocol() { return ((AprEndpoint)endpoint).getSSLProtocol(); }
- public void setSSLProtocol(String SSLProtocol) { ((AprEndpoint)endpoint).setSSLProtocol(SSLProtocol); }
+ public String getSSLProtocol() { return ((AprEndpoint)getEndpoint()).getSSLProtocol(); }
+ public void setSSLProtocol(String SSLProtocol) { ((AprEndpoint)getEndpoint()).setSSLProtocol(SSLProtocol); }
/**
* SSL password (if a cert is encrypted, and no password has been provided, a callback
* will ask for a password).
*/
- public String getSSLPassword() { return ((AprEndpoint)endpoint).getSSLPassword(); }
- public void setSSLPassword(String SSLPassword) { ((AprEndpoint)endpoint).setSSLPassword(SSLPassword); }
+ public String getSSLPassword() { return ((AprEndpoint)getEndpoint()).getSSLPassword(); }
+ public void setSSLPassword(String SSLPassword) { ((AprEndpoint)getEndpoint()).setSSLPassword(SSLPassword); }
/**
* SSL cipher suite.
*/
- public String getSSLCipherSuite() { return ((AprEndpoint)endpoint).getSSLCipherSuite(); }
- public void setSSLCipherSuite(String SSLCipherSuite) { ((AprEndpoint)endpoint).setSSLCipherSuite(SSLCipherSuite); }
- public String[] getCiphersUsed() { return endpoint.getCiphersUsed();}
+ public String getSSLCipherSuite() { return ((AprEndpoint)getEndpoint()).getSSLCipherSuite(); }
+ public void setSSLCipherSuite(String SSLCipherSuite) { ((AprEndpoint)getEndpoint()).setSSLCipherSuite(SSLCipherSuite); }
+ public String[] getCiphersUsed() { return getEndpoint().getCiphersUsed();}
/**
* SSL honor cipher order.
@@ -124,77 +124,77 @@ public class Http11AprProtocol extends A
* instead of the default which is to allow the client to choose a
* preferred cipher.
*/
- public boolean getSSLHonorCipherOrder() { return ((AprEndpoint)endpoint).getSSLHonorCipherOrder(); }
- public void setSSLHonorCipherOrder(boolean SSLHonorCipherOrder) { ((AprEndpoint)endpoint).setSSLHonorCipherOrder(SSLHonorCipherOrder); }
+ public boolean getSSLHonorCipherOrder() { return ((AprEndpoint)getEndpoint()).getSSLHonorCipherOrder(); }
+ public void setSSLHonorCipherOrder(boolean SSLHonorCipherOrder) { ((AprEndpoint)getEndpoint()).setSSLHonorCipherOrder(SSLHonorCipherOrder); }
/**
* SSL certificate file.
*/
- public String getSSLCertificateFile() { return ((AprEndpoint)endpoint).getSSLCertificateFile(); }
- public void setSSLCertificateFile(String SSLCertificateFile) { ((AprEndpoint)endpoint).setSSLCertificateFile(SSLCertificateFile); }
+ public String getSSLCertificateFile() { return ((AprEndpoint)getEndpoint()).getSSLCertificateFile(); }
+ public void setSSLCertificateFile(String SSLCertificateFile) { ((AprEndpoint)getEndpoint()).setSSLCertificateFile(SSLCertificateFile); }
/**
* SSL certificate key file.
*/
- public String getSSLCertificateKeyFile() { return ((AprEndpoint)endpoint).getSSLCertificateKeyFile(); }
- public void setSSLCertificateKeyFile(String SSLCertificateKeyFile) { ((AprEndpoint)endpoint).setSSLCertificateKeyFile(SSLCertificateKeyFile); }
+ public String getSSLCertificateKeyFile() { return ((AprEndpoint)getEndpoint()).getSSLCertificateKeyFile(); }
+ public void setSSLCertificateKeyFile(String SSLCertificateKeyFile) { ((AprEndpoint)getEndpoint()).setSSLCertificateKeyFile(SSLCertificateKeyFile); }
/**
* SSL certificate chain file.
*/
- public String getSSLCertificateChainFile() { return ((AprEndpoint)endpoint).getSSLCertificateChainFile(); }
- public void setSSLCertificateChainFile(String SSLCertificateChainFile) { ((AprEndpoint)endpoint).setSSLCertificateChainFile(SSLCertificateChainFile); }
+ public String getSSLCertificateChainFile() { return ((AprEndpoint)getEndpoint()).getSSLCertificateChainFile(); }
+ public void setSSLCertificateChainFile(String SSLCertificateChainFile) { ((AprEndpoint)getEndpoint()).setSSLCertificateChainFile(SSLCertificateChainFile); }
/**
* SSL CA certificate path.
*/
- public String getSSLCACertificatePath() { return ((AprEndpoint)endpoint).getSSLCACertificatePath(); }
- public void setSSLCACertificatePath(String SSLCACertificatePath) { ((AprEndpoint)endpoint).setSSLCACertificatePath(SSLCACertificatePath); }
+ public String getSSLCACertificatePath() { return ((AprEndpoint)getEndpoint()).getSSLCACertificatePath(); }
+ public void setSSLCACertificatePath(String SSLCACertificatePath) { ((AprEndpoint)getEndpoint()).setSSLCACertificatePath(SSLCACertificatePath); }
/**
* SSL CA certificate file.
*/
- public String getSSLCACertificateFile() { return ((AprEndpoint)endpoint).getSSLCACertificateFile(); }
- public void setSSLCACertificateFile(String SSLCACertificateFile) { ((AprEndpoint)endpoint).setSSLCACertificateFile(SSLCACertificateFile); }
+ public String getSSLCACertificateFile() { return ((AprEndpoint)getEndpoint()).getSSLCACertificateFile(); }
+ public void setSSLCACertificateFile(String SSLCACertificateFile) { ((AprEndpoint)getEndpoint()).setSSLCACertificateFile(SSLCACertificateFile); }
/**
* SSL CA revocation path.
*/
- public String getSSLCARevocationPath() { return ((AprEndpoint)endpoint).getSSLCARevocationPath(); }
- public void setSSLCARevocationPath(String SSLCARevocationPath) { ((AprEndpoint)endpoint).setSSLCARevocationPath(SSLCARevocationPath); }
+ public String getSSLCARevocationPath() { return ((AprEndpoint)getEndpoint()).getSSLCARevocationPath(); }
+ public void setSSLCARevocationPath(String SSLCARevocationPath) { ((AprEndpoint)getEndpoint()).setSSLCARevocationPath(SSLCARevocationPath); }
/**
* SSL CA revocation file.
*/
- public String getSSLCARevocationFile() { return ((AprEndpoint)endpoint).getSSLCARevocationFile(); }
- public void setSSLCARevocationFile(String SSLCARevocationFile) { ((AprEndpoint)endpoint).setSSLCARevocationFile(SSLCARevocationFile); }
+ public String getSSLCARevocationFile() { return ((AprEndpoint)getEndpoint()).getSSLCARevocationFile(); }
+ public void setSSLCARevocationFile(String SSLCARevocationFile) { ((AprEndpoint)getEndpoint()).setSSLCARevocationFile(SSLCARevocationFile); }
/**
* SSL verify client.
*/
- public String getSSLVerifyClient() { return ((AprEndpoint)endpoint).getSSLVerifyClient(); }
- public void setSSLVerifyClient(String SSLVerifyClient) { ((AprEndpoint)endpoint).setSSLVerifyClient(SSLVerifyClient); }
+ public String getSSLVerifyClient() { return ((AprEndpoint)getEndpoint()).getSSLVerifyClient(); }
+ public void setSSLVerifyClient(String SSLVerifyClient) { ((AprEndpoint)getEndpoint()).setSSLVerifyClient(SSLVerifyClient); }
/**
* SSL verify depth.
*/
- public int getSSLVerifyDepth() { return ((AprEndpoint)endpoint).getSSLVerifyDepth(); }
- public void setSSLVerifyDepth(int SSLVerifyDepth) { ((AprEndpoint)endpoint).setSSLVerifyDepth(SSLVerifyDepth); }
+ public int getSSLVerifyDepth() { return ((AprEndpoint)getEndpoint()).getSSLVerifyDepth(); }
+ public void setSSLVerifyDepth(int SSLVerifyDepth) { ((AprEndpoint)getEndpoint()).setSSLVerifyDepth(SSLVerifyDepth); }
/**
* Disable SSL compression.
*/
- public boolean getSSLDisableCompression() { return ((AprEndpoint)endpoint).getSSLDisableCompression(); }
- public void setSSLDisableCompression(boolean disable) { ((AprEndpoint)endpoint).setSSLDisableCompression(disable); }
+ public boolean getSSLDisableCompression() { return ((AprEndpoint)getEndpoint()).getSSLDisableCompression(); }
+ public void setSSLDisableCompression(boolean disable) { ((AprEndpoint)getEndpoint()).setSSLDisableCompression(disable); }
// ----------------------------------------------------- JMX related methods
@@ -212,8 +212,8 @@ public class Http11AprProtocol extends A
public void start() throws Exception {
super.start();
if (npnHandler != null) {
- long sslCtx = ((AprEndpoint) endpoint).getJniSslContext();
- npnHandler.init(endpoint, sslCtx, getAdapter());
+ long sslCtx = ((AprEndpoint) getEndpoint()).getJniSslContext();
+ npnHandler.init(getEndpoint(), sslCtx, getAdapter());
}
}
@@ -253,10 +253,10 @@ public class Http11AprProtocol extends A
boolean addToPoller) {
processor.recycle(isSocketClosing);
recycledProcessors.push(processor);
- if (addToPoller && proto.endpoint.isRunning()) {
- ((AprEndpoint)proto.endpoint).getPoller().add(
+ if (addToPoller && proto.getEndpoint().isRunning()) {
+ ((AprEndpoint)proto.getEndpoint()).getPoller().add(
socket.getSocket().longValue(),
- proto.endpoint.getKeepAliveTimeout(), true, false);
+ proto.getEndpoint().getKeepAliveTimeout(), true, false);
}
}
@@ -297,7 +297,7 @@ public class Http11AprProtocol extends A
socket.setAsync(true);
} else {
// Upgraded
- Poller p = ((AprEndpoint) proto.endpoint).getPoller();
+ Poller p = ((AprEndpoint) proto.getEndpoint()).getPoller();
if (p == null) {
// Connector has been stopped
release(socket, processor, true, false);
@@ -310,7 +310,7 @@ public class Http11AprProtocol extends A
@Override
protected Http11AprProcessor createProcessor() {
Http11AprProcessor processor = new Http11AprProcessor(
- proto.getMaxHttpHeaderSize(), (AprEndpoint)proto.endpoint,
+ proto.getMaxHttpHeaderSize(), (AprEndpoint)proto.getEndpoint(),
proto.getMaxTrailerSize(), proto.getMaxExtensionSize(),
proto.getMaxSwallowSize());
proto.configureProcessor(processor);
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Protocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Protocol.java Sun Nov 23 22:51:07 2014
@@ -58,19 +58,15 @@ public class Http11Nio2Protocol extends
public Http11Nio2Protocol() {
- endpoint=new Nio2Endpoint();
+ super(new Nio2Endpoint());
cHandler = new Http11ConnectionHandler(this);
- ((Nio2Endpoint) endpoint).setHandler(cHandler);
+ ((Nio2Endpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
- public Nio2Endpoint getEndpoint() {
- return ((Nio2Endpoint)endpoint);
- }
-
@Override
public void start() throws Exception {
super.start();
@@ -86,33 +82,33 @@ public class Http11Nio2Protocol extends
// -------------------- Pool setup --------------------
public void setAcceptorThreadPriority(int threadPriority) {
- ((Nio2Endpoint)endpoint).setAcceptorThreadPriority(threadPriority);
+ ((Nio2Endpoint)getEndpoint()).setAcceptorThreadPriority(threadPriority);
}
public void setPollerThreadPriority(int threadPriority) {
- ((Nio2Endpoint)endpoint).setPollerThreadPriority(threadPriority);
+ ((Nio2Endpoint)getEndpoint()).setPollerThreadPriority(threadPriority);
}
public int getAcceptorThreadPriority() {
- return ((Nio2Endpoint)endpoint).getAcceptorThreadPriority();
+ return ((Nio2Endpoint)getEndpoint()).getAcceptorThreadPriority();
}
public int getPollerThreadPriority() {
- return ((Nio2Endpoint)endpoint).getThreadPriority();
+ return ((Nio2Endpoint)getEndpoint()).getThreadPriority();
}
public boolean getUseSendfile() {
- return endpoint.getUseSendfile();
+ return getEndpoint().getUseSendfile();
}
public void setUseSendfile(boolean useSendfile) {
- ((Nio2Endpoint)endpoint).setUseSendfile(useSendfile);
+ ((Nio2Endpoint)getEndpoint()).setUseSendfile(useSendfile);
}
// -------------------- Tcp setup --------------------
public void setOomParachute(int oomParachute) {
- ((Nio2Endpoint)endpoint).setOomParachute(oomParachute);
+ ((Nio2Endpoint)getEndpoint()).setOomParachute(oomParachute);
}
// ----------------------------------------------------- JMX related methods
@@ -198,10 +194,10 @@ public class Http11Nio2Protocol extends
processor.recycle(isSocketClosing);
recycledProcessors.push(processor);
if (socket.isAsync()) {
- ((Nio2Endpoint) proto.endpoint).removeTimeout(socket);
+ ((Nio2Endpoint) proto.getEndpoint()).removeTimeout(socket);
}
if (addToPoller) {
- ((Nio2Endpoint) proto.endpoint).awaitBytes(socket);
+ ((Nio2Endpoint) proto.getEndpoint()).awaitBytes(socket);
}
}
@@ -227,11 +223,11 @@ public class Http11Nio2Protocol extends
Processor<Nio2Channel> processor) {
if (processor.isAsync()) {
socket.setAsync(true);
- ((Nio2Endpoint) proto.endpoint).addTimeout(socket);
+ ((Nio2Endpoint) proto.getEndpoint()).addTimeout(socket);
} else if (processor.isUpgrade()) {
if (((Nio2SocketWrapper) socket).isUpgradeInit()) {
try {
- ((Nio2Endpoint) proto.endpoint).awaitBytes(socket);
+ ((Nio2Endpoint) proto.getEndpoint()).awaitBytes(socket);
} catch (ReadPendingException e) {
// Ignore, the initial state after upgrade is
// impossible to predict, and a read must be pending
@@ -251,7 +247,7 @@ public class Http11Nio2Protocol extends
@Override
public Http11Nio2Processor createProcessor() {
Http11Nio2Processor processor = new Http11Nio2Processor(
- proto.getMaxHttpHeaderSize(), (Nio2Endpoint) proto.endpoint,
+ proto.getMaxHttpHeaderSize(), (Nio2Endpoint) proto.getEndpoint(),
proto.getMaxTrailerSize(), proto.getMaxExtensionSize(),
proto.getMaxSwallowSize());
proto.configureProcessor(processor);
@@ -278,7 +274,7 @@ public class Http11Nio2Protocol extends
@Override
public void closeAll() {
for (Nio2Channel channel : connections.keySet()) {
- ((Nio2Endpoint) proto.endpoint).closeSocket(channel.getSocket());
+ ((Nio2Endpoint) proto.getEndpoint()).closeSocket(channel.getSocket());
}
}
}
Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Sun Nov 23 22:51:07 2014
@@ -63,19 +63,15 @@ public class Http11NioProtocol extends A
public Http11NioProtocol() {
- endpoint=new NioEndpoint();
+ super(new NioEndpoint());
cHandler = new Http11ConnectionHandler(this);
- ((NioEndpoint) endpoint).setHandler(cHandler);
+ ((NioEndpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
}
- public NioEndpoint getEndpoint() {
- return ((NioEndpoint)endpoint);
- }
-
@Override
public void start() throws Exception {
super.start();
@@ -91,49 +87,49 @@ public class Http11NioProtocol extends A
// -------------------- Pool setup --------------------
public void setPollerThreadCount(int count) {
- ((NioEndpoint)endpoint).setPollerThreadCount(count);
+ ((NioEndpoint)getEndpoint()).setPollerThreadCount(count);
}
public int getPollerThreadCount() {
- return ((NioEndpoint)endpoint).getPollerThreadCount();
+ return ((NioEndpoint)getEndpoint()).getPollerThreadCount();
}
public void setSelectorTimeout(long timeout) {
- ((NioEndpoint)endpoint).setSelectorTimeout(timeout);
+ ((NioEndpoint)getEndpoint()).setSelectorTimeout(timeout);
}
public long getSelectorTimeout() {
- return ((NioEndpoint)endpoint).getSelectorTimeout();
+ return ((NioEndpoint)getEndpoint()).getSelectorTimeout();
}
public void setAcceptorThreadPriority(int threadPriority) {
- ((NioEndpoint)endpoint).setAcceptorThreadPriority(threadPriority);
+ ((NioEndpoint)getEndpoint()).setAcceptorThreadPriority(threadPriority);
}
public void setPollerThreadPriority(int threadPriority) {
- ((NioEndpoint)endpoint).setPollerThreadPriority(threadPriority);
+ ((NioEndpoint)getEndpoint()).setPollerThreadPriority(threadPriority);
}
public int getAcceptorThreadPriority() {
- return ((NioEndpoint)endpoint).getAcceptorThreadPriority();
+ return ((NioEndpoint)getEndpoint()).getAcceptorThreadPriority();
}
public int getPollerThreadPriority() {
- return ((NioEndpoint)endpoint).getThreadPriority();
+ return ((NioEndpoint)getEndpoint()).getThreadPriority();
}
public boolean getUseSendfile() {
- return endpoint.getUseSendfile();
+ return getEndpoint().getUseSendfile();
}
public void setUseSendfile(boolean useSendfile) {
- ((NioEndpoint)endpoint).setUseSendfile(useSendfile);
+ ((NioEndpoint)getEndpoint()).setUseSendfile(useSendfile);
}
// -------------------- Tcp setup --------------------
public void setOomParachute(int oomParachute) {
- ((NioEndpoint)endpoint).setOomParachute(oomParachute);
+ ((NioEndpoint)getEndpoint()).setOomParachute(oomParachute);
}
// ----------------------------------------------------- JMX related methods
@@ -283,7 +279,7 @@ public class Http11NioProtocol extends A
@Override
public Http11NioProcessor createProcessor() {
Http11NioProcessor processor = new Http11NioProcessor(
- proto.getMaxHttpHeaderSize(), (NioEndpoint)proto.endpoint,
+ proto.getMaxHttpHeaderSize(), (NioEndpoint)proto.getEndpoint(),
proto.getMaxTrailerSize(), proto.getMaxExtensionSize(),
proto.getMaxSwallowSize());
proto.configureProcessor(processor);
Modified: tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java?rev=1641286&r1=1641285&r2=1641286&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/spdy/SpdyProxyProtocol.java Sun Nov 23 22:51:07 2014
@@ -66,8 +66,8 @@ public class SpdyProxyProtocol extends A
private boolean compress = false;
public SpdyProxyProtocol() {
- endpoint = new NioEndpoint();
- ((NioEndpoint) endpoint).setHandler(cHandler);
+ super(new NioEndpoint());
+ ((NioEndpoint) getEndpoint()).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@@ -101,13 +101,13 @@ public class SpdyProxyProtocol extends A
spdyContext.setHandler(new SpdyHandler() {
@Override
public void onStream(SpdyConnection con, SpdyStream ch) throws IOException {
- SpdyProcessor<NioChannel> sp = new SpdyProcessor<>(con, endpoint);
+ SpdyProcessor<NioChannel> sp = new SpdyProcessor<>(con, getEndpoint());
sp.setAdapter(getAdapter());
sp.onSynStream(ch);
}
});
spdyContext.setNetSupport(new NetSupportSocket());
- spdyContext.setExecutor(endpoint.getExecutor());
+ spdyContext.setExecutor(getEndpoint().getExecutor());
}
public boolean isCompress() {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org