Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x

This commit is contained in:
Greg Wilkins 2017-03-09 15:59:19 +11:00
commit 18d87aa972
3 changed files with 20 additions and 3 deletions

View File

@ -75,7 +75,7 @@ public abstract class AbstractConnectHandlerTest
protected Socket newSocket() throws IOException protected Socket newSocket() throws IOException
{ {
Socket socket = new Socket("localhost", proxyConnector.getLocalPort()); Socket socket = new Socket("localhost", proxyConnector.getLocalPort());
socket.setSoTimeout(5000); socket.setSoTimeout(20000);
return socket; return socket;
} }
} }

View File

@ -18,11 +18,9 @@
package org.eclipse.jetty.proxy; package org.eclipse.jetty.proxy;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;

View File

@ -234,4 +234,23 @@ public abstract class AbstractLifeCycle implements LifeCycle
@Override public void lifeCycleStopped(LifeCycle event) {} @Override public void lifeCycleStopped(LifeCycle event) {}
@Override public void lifeCycleStopping(LifeCycle event) {} @Override public void lifeCycleStopping(LifeCycle event) {}
} }
/**
* A LifeCycle Listener that will call stop if any failures are notified.
*/
public static final LifeCycle.Listener STOP_ON_FAILURE = new AbstractLifeCycleListener()
{
@Override
public void lifeCycleFailure(LifeCycle lifecycle, Throwable cause)
{
try
{
lifecycle.stop();
}
catch(Exception e)
{
cause.addSuppressed(e);
}
}
};
} }