Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2013-09-04 11:15:23 +0000
committerSimone Bordet2013-09-04 11:15:23 +0000
commit4663fa4992f46b2a7f8c5cc052c97658bd9145b2 (patch)
tree756ee78b74cd7a1b5fc0fa377de4ac11a0ef9620
parent3be5670448325217d33ca76bf3888743b423841f (diff)
downloadorg.eclipse.jetty.project-4663fa4992f46b2a7f8c5cc052c97658bd9145b2.tar.gz
org.eclipse.jetty.project-4663fa4992f46b2a7f8c5cc052c97658bd9145b2.tar.xz
org.eclipse.jetty.project-4663fa4992f46b2a7f8c5cc052c97658bd9145b2.zip
Renamed "Empty" inner classes to "Adapter" to comply with the rest of
the codebase.
-rw-r--r--examples/async-rest/async-rest-jar/src/main/java/org/eclipse/jetty/example/asyncrest/AsyncRestServlet.java3
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/RedirectProtocolHandler.java2
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java2
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/api/Response.java2
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/util/BufferingResponseListener.java2
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java3
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java2
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java12
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientContinueTest.java2
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientLoadTest.java2
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientProxyTest.java2
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java2
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientSynchronizationTest.java4
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java12
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java20
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java6
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/HttpSenderTest.java16
-rw-r--r--jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java4
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java2
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficListener.java2
-rw-r--r--jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java2
-rw-r--r--jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java8
-rw-r--r--jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java10
-rw-r--r--jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java19
-rw-r--r--jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java2
-rw-r--r--jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java2
26 files changed, 70 insertions, 75 deletions
diff --git a/examples/async-rest/async-rest-jar/src/main/java/org/eclipse/jetty/example/asyncrest/AsyncRestServlet.java b/examples/async-rest/async-rest-jar/src/main/java/org/eclipse/jetty/example/asyncrest/AsyncRestServlet.java
index 98f9974bbd..7269c24777 100644
--- a/examples/async-rest/async-rest-jar/src/main/java/org/eclipse/jetty/example/asyncrest/AsyncRestServlet.java
+++ b/examples/async-rest/async-rest-jar/src/main/java/org/eclipse/jetty/example/asyncrest/AsyncRestServlet.java
@@ -25,7 +25,6 @@ import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
-
import javax.servlet.AsyncContext;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@@ -163,7 +162,7 @@ public class AsyncRestServlet extends AbstractRestServlet
out.close();
}
- private abstract class AsyncRestRequest extends Response.Listener.Empty
+ private abstract class AsyncRestRequest extends Response.Listener.Adapter
{
final Utf8StringBuilder _content = new Utf8StringBuilder();
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/RedirectProtocolHandler.java b/jetty-client/src/main/java/org/eclipse/jetty/client/RedirectProtocolHandler.java
index b1a21fe85b..c557457f6f 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/RedirectProtocolHandler.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/RedirectProtocolHandler.java
@@ -22,7 +22,7 @@ import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.client.api.Result;
-public class RedirectProtocolHandler extends Response.Listener.Empty implements ProtocolHandler
+public class RedirectProtocolHandler extends Response.Listener.Adapter implements ProtocolHandler
{
private final HttpRedirector redirector;
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
index ebe117657c..176a4255be 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
@@ -503,7 +503,7 @@ public interface Request
/**
* An empty implementation of {@link Listener}
*/
- public static class Empty implements Listener
+ public static class Adapter implements Listener
{
@Override
public void onQueued(Request request)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Response.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Response.java
index 2fc140103e..6a43820739 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Response.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Response.java
@@ -202,7 +202,7 @@ public interface Response
/**
* An empty implementation of {@link Listener}
*/
- public static class Empty implements Listener
+ public static class Adapter implements Listener
{
@Override
public void onBegin(Response response)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/BufferingResponseListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/BufferingResponseListener.java
index bc4860f76a..1c5c45d5d1 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/BufferingResponseListener.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/BufferingResponseListener.java
@@ -35,7 +35,7 @@ import org.eclipse.jetty.http.HttpHeader;
* <p>The content may be retrieved from {@link #onSuccess(Response)} or {@link #onComplete(Result)}
* via {@link #getContent()} or {@link #getContentAsString()}.</p>
*/
-public abstract class BufferingResponseListener extends Response.Listener.Empty
+public abstract class BufferingResponseListener extends Listener.Adapter
{
private final int maxLength;
private volatile byte[] buffer = new byte[0];
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java
index 6a90f7b5e8..db8753003d 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/util/InputStreamResponseListener.java
@@ -19,7 +19,6 @@
package org.eclipse.jetty.client.util;
import java.io.IOException;
-
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.nio.ByteBuffer;
@@ -72,7 +71,7 @@ import org.eclipse.jetty.util.log.Logger;
* If the consumer is slower than the producer, then the producer will block
* until the client consumes.
*/
-public class InputStreamResponseListener extends Response.Listener.Empty
+public class InputStreamResponseListener extends Listener.Adapter
{
private static final Logger LOG = Log.getLogger(InputStreamResponseListener.class);
private static final byte[] EOF = new byte[0];
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java
index 503ad74292..c4433abb6d 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ExternalSiteTest.java
@@ -160,7 +160,7 @@ public class ExternalSiteTest
latch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onFailure(Response response, Throwable failure)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java
index 0c3eafec77..a2ae974d11 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientAuthenticationTest.java
@@ -115,7 +115,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
AuthenticationStore authenticationStore = client.getAuthenticationStore();
final AtomicReference<CountDownLatch> requests = new AtomicReference<>(new CountDownLatch(1));
- Request.Listener.Empty requestListener = new Request.Listener.Empty()
+ Request.Listener.Adapter requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -137,7 +137,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
authenticationStore.addAuthentication(authentication);
requests.set(new CountDownLatch(2));
- requestListener = new Request.Listener.Empty()
+ requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -156,7 +156,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
client.getRequestListeners().remove(requestListener);
requests.set(new CountDownLatch(1));
- requestListener = new Request.Listener.Empty()
+ requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -196,7 +196,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(uri, realm, "basic", "basic"));
final CountDownLatch requests = new CountDownLatch(3);
- Request.Listener.Empty requestListener = new Request.Listener.Empty()
+ Request.Listener.Adapter requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -235,7 +235,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(uri, realm, "basic", "basic"));
final CountDownLatch requests = new CountDownLatch(3);
- Request.Listener.Empty requestListener = new Request.Listener.Empty()
+ Request.Listener.Adapter requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -262,7 +262,7 @@ public class HttpClientAuthenticationTest extends AbstractHttpClientServerTest
startBasic(new EmptyServerHandler());
final AtomicReference<CountDownLatch> requests = new AtomicReference<>(new CountDownLatch(2));
- Request.Listener.Empty requestListener = new Request.Listener.Empty()
+ Request.Listener.Adapter requestListener = new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientContinueTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientContinueTest.java
index fd08f6f2b2..7acbb3bcb6 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientContinueTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientContinueTest.java
@@ -407,7 +407,7 @@ public class HttpClientContinueTest extends AbstractHttpClientServerTest
public Response.Listener getResponseListener()
{
final Response.Listener listener = super.getResponseListener();
- return new Response.Listener.Empty()
+ return new Response.Listener.Adapter()
{
@Override
public void onBegin(Response response)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientLoadTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientLoadTest.java
index 1f76548f24..1ac4ae4a20 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientLoadTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientLoadTest.java
@@ -186,7 +186,7 @@ public class HttpClientLoadTest extends AbstractHttpClientServerTest
}
final CountDownLatch requestLatch = new CountDownLatch(1);
- request.send(new Response.Listener.Empty()
+ request.send(new Response.Listener.Adapter()
{
private final AtomicInteger contentLength = new AtomicInteger();
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientProxyTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientProxyTest.java
index cb5f7d9b86..9f7ff33f7b 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientProxyTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientProxyTest.java
@@ -129,7 +129,7 @@ public class HttpClientProxyTest extends AbstractHttpClientServerTest
URI uri = URI.create(scheme + "://" + proxyHost + ":" + proxyPort);
client.getAuthenticationStore().addAuthentication(new BasicAuthentication(uri, realm, user, password));
final AtomicInteger requests = new AtomicInteger();
- client.getRequestListeners().add(new Request.Listener.Empty()
+ client.getRequestListeners().add(new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java
index 4e7d87e2ad..f9985aa3f8 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientRedirectTest.java
@@ -381,7 +381,7 @@ public class HttpClientRedirectTest extends AbstractHttpClientServerTest
private void testMethodRedirect(final HttpMethod requestMethod, final HttpMethod redirectMethod, int redirectCode) throws Exception
{
final AtomicInteger passes = new AtomicInteger();
- client.getRequestListeners().add(new org.eclipse.jetty.client.api.Request.Listener.Empty()
+ client.getRequestListeners().add(new org.eclipse.jetty.client.api.Request.Listener.Adapter()
{
@Override
public void onBegin(org.eclipse.jetty.client.api.Request request)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientSynchronizationTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientSynchronizationTest.java
index 2beca50108..0f717d830c 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientSynchronizationTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientSynchronizationTest.java
@@ -56,7 +56,7 @@ public class HttpClientSynchronizationTest extends AbstractHttpClientServerTest
synchronized (this)
{
- request.send(new Response.Listener.Empty()
+ request.send(new Response.Listener.Adapter()
{
@Override
public void onFailure(Response response, Throwable failure)
@@ -88,7 +88,7 @@ public class HttpClientSynchronizationTest extends AbstractHttpClientServerTest
synchronized (this)
{
- request.send(new Response.Listener.Empty()
+ request.send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
index 4e1bc2489a..974dad8747 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpClientTest.java
@@ -402,7 +402,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
}
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -422,7 +422,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
latch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -449,7 +449,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
client.newRequest("localhost", connector.getLocalPort())
.scheme(scheme)
.path("/one")
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onBegin(Request request)
@@ -530,7 +530,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
latch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -609,7 +609,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
};
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
@@ -640,7 +640,7 @@ public class HttpClientTest extends AbstractHttpClientServerTest
destination.getHttpConnectionPool().getActiveConnections().peek().close();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java
index 0f8afe65e2..9fcf5d0a98 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpConnectionLifecycleTest.java
@@ -98,7 +98,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
headersLatch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -139,7 +139,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
final CountDownLatch beginLatch = new CountDownLatch(1);
final CountDownLatch failureLatch = new CountDownLatch(2);
- client.newRequest(host, port).scheme(scheme).listener(new Request.Listener.Empty()
+ client.newRequest(host, port).scheme(scheme).listener(new Request.Listener.Adapter()
{
@Override
public void onBegin(Request request)
@@ -153,7 +153,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
{
failureLatch.countDown();
}
- }).send(new Response.Listener.Empty()
+ }).send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
@@ -191,7 +191,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
final CountDownLatch successLatch = new CountDownLatch(3);
client.newRequest(host, port)
.scheme(scheme)
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onBegin(Request request)
@@ -206,7 +206,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
successLatch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -252,7 +252,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
final CountDownLatch successLatch = new CountDownLatch(3);
client.newRequest(host, port)
.scheme(scheme)
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onBegin(Request request)
@@ -280,7 +280,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
successLatch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onSuccess(Response response)
@@ -334,7 +334,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
failureLatch.countDown();
}
})
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
@@ -377,7 +377,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
final CountDownLatch latch = new CountDownLatch(1);
client.newRequest(host, port)
.scheme(scheme)
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
@@ -432,7 +432,7 @@ public class HttpConnectionLifecycleTest extends AbstractHttpClientServerTest
client.newRequest(host, port)
.scheme(scheme)
.content(new ByteBufferContentProvider(buffer))
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onComplete(Result result)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java
index 5d1a2b1279..c131f4cb72 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpRequestAbortTest.java
@@ -59,7 +59,7 @@ public class HttpRequestAbortTest extends AbstractHttpClientServerTest
{
client.newRequest("localhost", connector.getLocalPort())
.scheme(scheme)
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onQueued(Request request)
@@ -97,7 +97,7 @@ public class HttpRequestAbortTest extends AbstractHttpClientServerTest
{
client.newRequest("localhost", connector.getLocalPort())
.scheme(scheme)
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onBegin(Request request)
@@ -137,7 +137,7 @@ public class HttpRequestAbortTest extends AbstractHttpClientServerTest
{
client.newRequest("localhost", connector.getLocalPort())
.scheme(scheme)
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onHeaders(Request request)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpSenderTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpSenderTest.java
index 5fb69c0393..08de6e4503 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/HttpSenderTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/HttpSenderTest.java
@@ -47,7 +47,7 @@ public class HttpSenderTest
// Request request = client.newRequest(URI.create("http://localhost/"));
// final CountDownLatch headersLatch = new CountDownLatch(1);
// final CountDownLatch successLatch = new CountDownLatch(1);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onHeaders(Request request)
@@ -108,7 +108,7 @@ public class HttpSenderTest
// HttpConnection connection = new HttpConnection(client, endPoint, destination);
// Request request = client.newRequest(URI.create("http://localhost/"));
// final CountDownLatch failureLatch = new CountDownLatch(2);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onFailure(Request request, Throwable x)
@@ -116,7 +116,7 @@ public class HttpSenderTest
// failureLatch.countDown();
// }
// });
-// connection.send(request, new Response.Listener.Empty()
+// connection.send(request, new Response.Listener.Adapter()
// {
// @Override
// public void onComplete(Result result)
@@ -137,7 +137,7 @@ public class HttpSenderTest
// HttpConnection connection = new HttpConnection(client, endPoint, destination);
// Request request = client.newRequest(URI.create("http://localhost/"));
// final CountDownLatch failureLatch = new CountDownLatch(2);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onFailure(Request request, Throwable x)
@@ -145,7 +145,7 @@ public class HttpSenderTest
// failureLatch.countDown();
// }
// });
-// connection.send(request, new Response.Listener.Empty()
+// connection.send(request, new Response.Listener.Adapter()
// {
// @Override
// public void onComplete(Result result)
@@ -175,7 +175,7 @@ public class HttpSenderTest
// request.content(new ByteBufferContentProvider(ByteBuffer.wrap(content.getBytes("UTF-8"))));
// final CountDownLatch headersLatch = new CountDownLatch(1);
// final CountDownLatch successLatch = new CountDownLatch(1);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onHeaders(Request request)
@@ -210,7 +210,7 @@ public class HttpSenderTest
// request.content(new ByteBufferContentProvider(ByteBuffer.wrap(content1.getBytes("UTF-8")), ByteBuffer.wrap(content2.getBytes("UTF-8"))));
// final CountDownLatch headersLatch = new CountDownLatch(1);
// final CountDownLatch successLatch = new CountDownLatch(1);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onHeaders(Request request)
@@ -252,7 +252,7 @@ public class HttpSenderTest
// });
// final CountDownLatch headersLatch = new CountDownLatch(1);
// final CountDownLatch successLatch = new CountDownLatch(1);
-// request.listener(new Request.Listener.Empty()
+// request.listener(new Request.Listener.Adapter()
// {
// @Override
// public void onHeaders(Request request)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java b/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java
index cd7d09e098..397d5bb930 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/api/Usage.java
@@ -133,7 +133,7 @@ public class Usage
Response response = client.newRequest("localhost", 8080)
// Add a request listener
- .listener(new Request.Listener.Empty()
+ .listener(new Request.Listener.Adapter()
{
@Override
public void onSuccess(Request request)
@@ -319,7 +319,7 @@ public class Usage
DeferredContentProvider async = new DeferredContentProvider(ByteBuffer.wrap(new byte[]{0, 1, 2}));
client.newRequest("localhost", 8080)
.content(async)
- .send(new Response.Listener.Empty()
+ .send(new Response.Listener.Adapter()
{
@Override
public void onBegin(Response response)
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java
index 1fefe75400..840e175ab2 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/Connection.java
@@ -71,7 +71,7 @@ public interface Connection extends AutoCloseable
public void onClosed(Connection connection);
- public static class Empty implements Listener
+ public static class Adapter implements Listener
{
@Override
public void onOpened(Connection connection)
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficListener.java b/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficListener.java
index bfbf39d6db..d0de44d225 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficListener.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/NetworkTrafficListener.java
@@ -79,7 +79,7 @@ public interface NetworkTrafficListener
/**
* <p>A commodity class that implements {@link NetworkTrafficListener} with empty methods.</p>
*/
- public static class Empty implements NetworkTrafficListener
+ public static class Adapter implements NetworkTrafficListener
{
public void opened(Socket socket)
{
diff --git a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java
index 3c1c8e1c3b..a283b0d640 100644
--- a/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java
+++ b/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/ProxyServlet.java
@@ -629,7 +629,7 @@ public class ProxyServlet extends HttpServlet
}
}
- private class ProxyResponseListener extends Response.Listener.Empty
+ private class ProxyResponseListener extends Response.Listener.Adapter
{
private final HttpServletRequest request;
private final HttpServletResponse response;
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java
index 87e6de19eb..46aeb6c2d9 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectionOpenCloseTest.java
@@ -27,7 +27,6 @@ import java.net.Socket;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -41,7 +40,6 @@ import org.eclipse.jetty.toolchain.test.http.SimpleHttpResponse;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
@@ -69,7 +67,7 @@ public class ConnectionOpenCloseTest extends AbstractHttpTest
final AtomicInteger callbacks = new AtomicInteger();
final CountDownLatch openLatch = new CountDownLatch(1);
final CountDownLatch closeLatch = new CountDownLatch(1);
- connector.addBean(new Connection.Listener.Empty()
+ connector.addBean(new Connection.Listener.Adapter()
{
@Override
public void onOpened(Connection connection)
@@ -119,7 +117,7 @@ public class ConnectionOpenCloseTest extends AbstractHttpTest
final AtomicInteger callbacks = new AtomicInteger();
final CountDownLatch openLatch = new CountDownLatch(1);
final CountDownLatch closeLatch = new CountDownLatch(1);
- connector.addBean(new Connection.Listener.Empty()
+ connector.addBean(new Connection.Listener.Adapter()
{
@Override
public void onOpened(Connection connection)
@@ -190,7 +188,7 @@ public class ConnectionOpenCloseTest extends AbstractHttpTest
final AtomicInteger callbacks = new AtomicInteger();
final CountDownLatch openLatch = new CountDownLatch(1);
final CountDownLatch closeLatch = new CountDownLatch(1);
- connector.addBean(new Connection.Listener.Empty()
+ connector.addBean(new Connection.Listener.Adapter()
{
@Override
public void onOpened(Connection connection)
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java
index e7715bd973..02fad8285f 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/LocalConnectorTest.java
@@ -18,10 +18,6 @@
package org.eclipse.jetty.server;
-import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -30,6 +26,10 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
public class LocalConnectorTest
{
private Server _server;
@@ -59,7 +59,7 @@ public class LocalConnectorTest
{
final CountDownLatch openLatch = new CountDownLatch(1);
final CountDownLatch closeLatch = new CountDownLatch(1);
- _connector.addBean(new Connection.Listener.Empty()
+ _connector.addBean(new Connection.Listener.Adapter()
{
@Override
public void onOpened(Connection connection)
diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
index 1f507272bc..f2f8de0d4f 100644
--- a/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
+++ b/jetty-server/src/test/java/org/eclipse/jetty/server/NetworkTrafficListenerTest.java
@@ -18,9 +18,6 @@
package org.eclipse.jetty.server;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -30,7 +27,6 @@ import java.nio.ByteBuffer;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
@@ -45,6 +41,9 @@ import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
@Ignore
public class NetworkTrafficListenerTest
{
@@ -82,7 +81,7 @@ public class NetworkTrafficListenerTest
final CountDownLatch openedLatch = new CountDownLatch(1);
final CountDownLatch closedLatch = new CountDownLatch(1);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
public volatile Socket socket;
@@ -125,7 +124,7 @@ public class NetworkTrafficListenerTest
final CountDownLatch incomingLatch = new CountDownLatch(1);
final AtomicReference<String> outgoingData = new AtomicReference<String>("");
final CountDownLatch outgoingLatch = new CountDownLatch(1);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
@Override
public void incoming(Socket socket, ByteBuffer bytes)
@@ -190,7 +189,7 @@ public class NetworkTrafficListenerTest
final CountDownLatch incomingLatch = new CountDownLatch(1);
final AtomicReference<String> outgoingData = new AtomicReference<String>("");
final CountDownLatch outgoingLatch = new CountDownLatch(2);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
public void incoming(Socket socket, ByteBuffer bytes)
{
@@ -257,7 +256,7 @@ public class NetworkTrafficListenerTest
final CountDownLatch incomingLatch = new CountDownLatch(1);
final AtomicReference<String> outgoingData = new AtomicReference<String>("");
final CountDownLatch outgoingLatch = new CountDownLatch(4);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
public void incoming(Socket socket, ByteBuffer bytes)
{
@@ -323,7 +322,7 @@ public class NetworkTrafficListenerTest
final CountDownLatch incomingLatch = new CountDownLatch(1);
final AtomicReference<String> outgoingData = new AtomicReference<String>("");
final CountDownLatch outgoingLatch = new CountDownLatch(1);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
public void incoming(Socket socket, ByteBuffer bytes)
{
@@ -396,7 +395,7 @@ public class NetworkTrafficListenerTest
final AtomicReference<String> incomingData = new AtomicReference<String>("");
final AtomicReference<String> outgoingData = new AtomicReference<String>("");
final CountDownLatch outgoingLatch = new CountDownLatch(1);
- connector.addNetworkTrafficListener(new NetworkTrafficListener.Empty()
+ connector.addNetworkTrafficListener(new NetworkTrafficListener.Adapter()
{
public void incoming(Socket socket, ByteBuffer bytes)
{
diff --git a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java
index ef9596a13b..94b3dd4f28 100644
--- a/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java
+++ b/jetty-spdy/spdy-http-server/src/main/java/org/eclipse/jetty/spdy/server/proxy/HTTPProxyEngine.java
@@ -132,7 +132,7 @@ public class HTTPProxyEngine extends ProxyEngine
private void sendRequest(final Stream clientStream, Request request)
{
- request.send(new Response.Listener.Empty()
+ request.send(new Response.Listener.Adapter()
{
private volatile boolean committed;
diff --git a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java
index 004b05f81f..65c19c7ed6 100644
--- a/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java
+++ b/jetty-spdy/spdy-http-server/src/test/java/org/eclipse/jetty/spdy/server/http/PushStrategyBenchmarkTest.java
@@ -384,7 +384,7 @@ public class PushStrategyBenchmarkTest extends AbstractHTTPSPDYTest
}
}
- private class TestListener extends Response.Listener.Empty
+ private class TestListener extends Response.Listener.Adapter
{
@Override
public void onComplete(Result result)

Back to the top