public AjpAprProtocol() {
endpoint = new AprEndpoint();
cHandler = new AjpConnectionHandler(this);
+ ((AprEndpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
+ setUseSendfile(Constants.DEFAULT_USE_SENDFILE);
}
@Override
public void init() throws Exception {
endpoint.setName(getName());
- ((AprEndpoint)endpoint).setHandler(cHandler);
- ((AprEndpoint)endpoint).setUseSendfile(false);
try {
endpoint.init();
public AjpProtocol() {
endpoint = new JIoEndpoint();
cHandler = new AjpConnectionHandler(this);
+ ((JIoEndpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@Override
public void init() throws Exception {
endpoint.setName(getName());
- ((JIoEndpoint)endpoint).setHandler(cHandler);
try {
endpoint.init();
public static final int DEFAULT_CONNECTION_TIMEOUT = -1;
public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
public static final boolean DEFAULT_TCP_NO_DELAY = true;
+ public static final boolean DEFAULT_USE_SENDFILE = false;
// Prefix codes for message types from server to container
public static final byte JK_AJP13_FORWARD_REQUEST = 2;
public Http11AprProtocol() {
endpoint = new AprEndpoint();
cHandler = new Http11ConnectionHandler(this);
+ ((AprEndpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@Override
public void init() throws Exception {
endpoint.setName(getName());
- ((AprEndpoint)endpoint).setHandler(cHandler);
try {
endpoint.init();
log.info(sm.getString("http11protocol.start", getName()));
}
- private Http11ConnectionHandler cHandler;
+ private final Http11ConnectionHandler cHandler;
public boolean getUseSendfile() { return ((AprEndpoint)endpoint).getUseSendfile(); }
public void setUseSendfile(boolean useSendfile) { ((AprEndpoint)endpoint).setUseSendfile(useSendfile); }
public Http11NioProtocol() {
endpoint=new NioEndpoint();
- cHandler = new Http11ConnectionHandler( this );
+ cHandler = new Http11ConnectionHandler(this);
+ ((NioEndpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@Override
public void init() throws Exception {
endpoint.setName(getName());
- ((NioEndpoint)endpoint).setHandler(cHandler);
try {
endpoint.init();
public Http11Protocol() {
endpoint = new JIoEndpoint();
cHandler = new Http11ConnectionHandler(this);
+ ((JIoEndpoint) endpoint).setHandler(cHandler);
setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
@Override
public void init() throws Exception {
- ((JIoEndpoint)endpoint).setName(getName());
- ((JIoEndpoint)endpoint).setHandler(cHandler);
+ endpoint.setName(getName());
// Verify the validity of the configured socket factory
try {