From 704131deda2614516bff5329802c61fe4526a834 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Fri, 27 Oct 2017 14:18:58 +0200 Subject: Nonfunctional changes only --- .../main/java/com/yahoo/jdisc/AbstractResource.java | 4 ++-- .../src/main/java/com/yahoo/jdisc/Container.java | 21 +++++++++++---------- .../src/main/java/com/yahoo/jdisc/HeaderFields.java | 7 ++++--- .../jdisc/handler/AbstractContentOutputStream.java | 15 ++++++++------- .../jdisc/handler/BindingNotFoundException.java | 3 ++- .../yahoo/jdisc/handler/BlockingContentWriter.java | 13 +++++++------ .../yahoo/jdisc/handler/BufferedContentChannel.java | 7 ++++--- .../jdisc/handler/CallableRequestDispatch.java | 7 ++++--- .../jdisc/handler/CallableResponseDispatch.java | 11 ++++++----- .../com/yahoo/jdisc/handler/CompletionHandler.java | 7 ++++--- .../com/yahoo/jdisc/handler/ContentChannel.java | 7 ++++--- .../com/yahoo/jdisc/handler/ContentInputStream.java | 9 +++++---- .../jdisc/handler/FastContentOutputStream.java | 2 +- .../com/yahoo/jdisc/handler/FastContentWriter.java | 2 +- .../com/yahoo/jdisc/handler/FutureCompletion.java | 2 +- .../com/yahoo/jdisc/handler/FutureConjunction.java | 3 ++- .../com/yahoo/jdisc/handler/FutureResponse.java | 7 ++++--- .../java/com/yahoo/jdisc/handler/NullContent.java | 3 ++- .../com/yahoo/jdisc/handler/OverloadException.java | 11 ++++------- .../yahoo/jdisc/handler/ReadableContentChannel.java | 2 +- .../yahoo/jdisc/handler/RequestDeniedException.java | 2 +- .../com/yahoo/jdisc/handler/RequestDispatch.java | 2 +- .../com/yahoo/jdisc/handler/ResponseDispatch.java | 2 +- .../com/yahoo/jdisc/handler/ResponseHandler.java | 2 +- .../yahoo/jdisc/handler/ThreadedRequestHandler.java | 2 +- .../jdisc/handler/UnsafeContentInputStream.java | 2 +- .../yahoo/jdisc/service/AbstractServerProvider.java | 2 +- .../jdisc/statistics/ActiveContainerMetrics.java | 2 ++ 28 files changed, 86 insertions(+), 73 deletions(-) (limited to 'jdisc_core/src') diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/AbstractResource.java b/jdisc_core/src/main/java/com/yahoo/jdisc/AbstractResource.java index eddb321cce2..bc3887e2e5f 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/AbstractResource.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/AbstractResource.java @@ -14,9 +14,9 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - *

This class provides a thread-safe implementation of the {@link SharedResource} interface, and should be used for + * This class provides a thread-safe implementation of the {@link SharedResource} interface, and should be used for * all subclasses of {@link RequestHandler}, {@link ClientProvider} and {@link ServerProvider}. Once the reference count - * of this resource reaches zero, the {@link #destroy()} method is called.

+ * of this resource reaches zero, the {@link #destroy()} method is called. * * @author Simon Thoresen */ diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java index f98394d28cc..88e4d842bf5 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Container.java @@ -26,23 +26,23 @@ import java.net.URI; *

The only way to create a new instance of this class is to 1) create and configure a {@link * ContainerBuilder}, and 2) pass that to the {@link ContainerActivator#activateContainer(ContainerBuilder)} method.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public interface Container extends SharedResource, Timer { /** - *

Attempts to find a {@link RequestHandler} in the current server- (if {@link Request#isServerRequest()} is + * Attempts to find a {@link RequestHandler} in the current server- (if {@link Request#isServerRequest()} is * true) or client- (if {@link Request#isServerRequest()} is false) {@link BindingSet} that - * matches the given {@link URI}. If no match can be found, this method returns null.

+ * matches the given {@link URI}. If no match can be found, this method returns null. * * @param request The Request to match against the bound {@link RequestHandler}s. * @return The matching RequestHandler, or null if there is no match. */ - public RequestHandler resolveHandler(Request request); + RequestHandler resolveHandler(Request request); /** - *

Returns the appropriate instance for the given injection key. When feasible, avoid using this method in favor - * of having Guice inject your dependencies ahead of time.

+ * Returns the appropriate instance for the given injection key. When feasible, avoid using this method in favor + * of having Guice inject your dependencies ahead of time. * * @param key The key of the instance to return. * @param The class of the instance to return. @@ -50,11 +50,11 @@ public interface Container extends SharedResource, Timer { * @throws ConfigurationException If this injector cannot find or create the provider. * @throws ProvisionException If there was a runtime failure while providing an instance. */ - public T getInstance(Key key); + T getInstance(Key key); /** - *

Returns the appropriate instance for the given injection type. When feasible, avoid using this method in - * favor of having Guice inject your dependencies ahead of time.

+ * Returns the appropriate instance for the given injection type. When feasible, avoid using this method in + * favor of having Guice inject your dependencies ahead of time. * * @param type The class object of the instance to return. * @param The class of the instance to return. @@ -62,5 +62,6 @@ public interface Container extends SharedResource, Timer { * @throws ConfigurationException If this injector cannot find or create the provider. * @throws ProvisionException If there was a runtime failure while providing an instance. */ - public T getInstance(Class type); + T getInstance(Class type); + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/HeaderFields.java b/jdisc_core/src/main/java/com/yahoo/jdisc/HeaderFields.java index b8057370219..b24f0a24d20 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/HeaderFields.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/HeaderFields.java @@ -6,11 +6,11 @@ import com.google.common.collect.ImmutableList; import java.util.*; /** - *

This is an encapsulation of the header fields that belong to either a {@link Request} or a {@link Response}. It is + * This is an encapsulation of the header fields that belong to either a {@link Request} or a {@link Response}. It is * a multimap from String to String, with some additional methods for convenience. The keys of this map are compared by - * ignoring their case, so that get("foo") returns the same entry as get("FOO").

+ * ignoring their case, so that get("foo") returns the same entry as get("FOO"). * - * @author Simon Thoresen + * @author Simon Thoresen */ public class HeaderFields implements Map> { @@ -302,4 +302,5 @@ public class HeaderFields implements Map> { throw new UnsupportedOperationException(); } } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/AbstractContentOutputStream.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/AbstractContentOutputStream.java index bc79acc9814..b12bf0d9fe6 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/AbstractContentOutputStream.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/AbstractContentOutputStream.java @@ -6,7 +6,7 @@ import java.nio.ByteBuffer; import java.util.Objects; /** - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ abstract class AbstractContentOutputStream extends OutputStream { @@ -25,24 +25,24 @@ abstract class AbstractContentOutputStream extends OutputStream { } @Override - public final void write(byte[] buf, int offset, int length) { - Objects.requireNonNull(buf, "buf"); + public final void write(byte[] buffer, int offset, int length) { + Objects.requireNonNull(buffer, "buf"); if (current == null) { current = ByteBuffer.allocate(BUFFERSIZE + length); } int part = Math.min(length, current.remaining()); - current.put(buf, offset, part); + current.put(buffer, offset, part); if (current.remaining() == 0) { flush(); } if (part < length) { - write(buf, offset + part, length - part); + write(buffer, offset + part, length - part); } } @Override - public final void write(byte[] buf) { - write(buf, 0, buf.length); + public final void write(byte[] buffer) { + write(buffer, 0, buffer.length); } @Override @@ -65,4 +65,5 @@ abstract class AbstractContentOutputStream extends OutputStream { protected abstract void doFlush(ByteBuffer buf); protected abstract void doClose(); + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BindingNotFoundException.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BindingNotFoundException.java index 151870d57dc..deeccc0472c 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BindingNotFoundException.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BindingNotFoundException.java @@ -11,7 +11,7 @@ import java.net.URI; * instance of this class will be thrown by the {@link Request#connect(ResponseHandler)} method when the current {@link * BindingSet} has not binding that matches the corresponding Request's URI. * - * @author Simon Thoresen + * @author Simon Thoresen */ public final class BindingNotFoundException extends RuntimeException { @@ -35,4 +35,5 @@ public final class BindingNotFoundException extends RuntimeException { public URI uri() { return uri; } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BlockingContentWriter.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BlockingContentWriter.java index ab03f282c33..3a2adf60ccf 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BlockingContentWriter.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BlockingContentWriter.java @@ -6,12 +6,12 @@ import java.util.concurrent.ExecutionException; import java.util.Objects; /** - *

This class provides a blocking write-interface to a {@link ContentChannel}. Both {@link + * This class provides a blocking write-interface to a {@link ContentChannel}. Both {@link * #write(ByteBuffer)} and {@link #close()} methods provide an internal {@link CompletionHandler} to the decorated * {@link ContentChannel} calls, and wait for these to be called before returning. If {@link - * CompletionHandler#failed(Throwable)} is called, the corresponding Throwable is thrown to the caller.

+ * CompletionHandler#failed(Throwable)} is called, the corresponding Throwable is thrown to the caller. * - * @author Simon Thoresen + * @author Simon Thoresen * @see FastContentWriter */ public final class BlockingContentWriter { @@ -19,7 +19,7 @@ public final class BlockingContentWriter { private final ContentChannel channel; /** - *

Creates a new BlockingContentWriter that encapsulates a given {@link ContentChannel}.

+ * Creates a new BlockingContentWriter that encapsulates a given {@link ContentChannel}. * * @param content The ContentChannel to encapsulate. * @throws NullPointerException If the content argument is null. @@ -30,7 +30,7 @@ public final class BlockingContentWriter { } /** - *

Writes to the underlying {@link ContentChannel} and waits for the operation to complete.

+ * Writes to the underlying {@link ContentChannel} and waits for the operation to complete. * * @param buf The ByteBuffer to write. * @throws InterruptedException If the thread was interrupted while waiting. @@ -54,7 +54,7 @@ public final class BlockingContentWriter { } /** - *

Closes the underlying {@link ContentChannel} and waits for the operation to complete.

+ * Closes the underlying {@link ContentChannel} and waits for the operation to complete. * * @throws InterruptedException If the thread was interrupted while waiting. * @throws RuntimeException If the operation failed to complete, see cause for details. @@ -75,4 +75,5 @@ public final class BlockingContentWriter { throw new RuntimeException(t); } } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BufferedContentChannel.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BufferedContentChannel.java index a93e4430d20..406ee0ff6e5 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BufferedContentChannel.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/BufferedContentChannel.java @@ -7,12 +7,12 @@ import java.util.List; import java.util.Objects; /** - *

This class implements an unlimited, non-blocking content queue. All {@link ContentChannel} methods are implemented + * This class implements an unlimited, non-blocking content queue. All {@link ContentChannel} methods are implemented * by pushing to a thread-safe internal queue. All of the queued calls are forwarded to another ContentChannel when * {@link #connectTo(ContentChannel)} is called. Once connected, this class becomes a non-buffering proxy for the - * connected ContentChannel.

+ * connected ContentChannel. * - * @author Simon Thoresen + * @author Simon Thoresen */ public final class BufferedContentChannel implements ContentChannel { @@ -153,4 +153,5 @@ public final class BufferedContentChannel implements ContentChannel { this.buf = buf; } } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableRequestDispatch.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableRequestDispatch.java index 88da723144a..cfbd4edcf8f 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableRequestDispatch.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableRequestDispatch.java @@ -6,12 +6,12 @@ import com.yahoo.jdisc.Response; import java.util.concurrent.Callable; /** - *

This is a convenient subclass of {@link RequestDispatch} that implements the {@link Callable} interface. This + * This is a convenient subclass of {@link RequestDispatch} that implements the {@link Callable} interface. This * should be used in place of {@link RequestDispatch} if you intend to schedule its execution. Because {@link #call()} * does not return until a {@link Response} becomes available, you can use the Future return value of - * ExecutorService.submit(Callable) to wait for it.

+ * ExecutorService.submit(Callable) to wait for it. * - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public abstract class CallableRequestDispatch extends RequestDispatch implements Callable { @@ -19,4 +19,5 @@ public abstract class CallableRequestDispatch extends RequestDispatch implements public final Response call() throws Exception { return dispatch().get(); } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableResponseDispatch.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableResponseDispatch.java index 0dc9b964798..0471e05a5f9 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableResponseDispatch.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CallableResponseDispatch.java @@ -6,20 +6,20 @@ import com.yahoo.jdisc.Response; import java.util.concurrent.Callable; /** - *

This is a convenient subclass of {@link ResponseDispatch} that implements the {@link Callable} interface. This + * This is a convenient subclass of {@link ResponseDispatch} that implements the {@link Callable} interface. This * should be used in place of {@link ResponseDispatch} if you intend to schedule its execution. Because {@link #call()} * does not return until the entirety of the {@link Response} and its content have been consumed, you can use the - * Future return value of ExecutorService.submit(Callable) to wait for it to complete.

+ * Future return value of ExecutorService.submit(Callable) to wait for it to complete. * - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public abstract class CallableResponseDispatch extends ResponseDispatch implements Callable { private final ResponseHandler handler; /** - *

Constructs a new instances of this class over the given {@link ResponseHandler}. Invoking {@link #call()} will - * dispatch to this handler.

+ * Constructs a new instances of this class over the given {@link ResponseHandler}. Invoking {@link #call()} will + * dispatch to this handler. * * @param handler The ResponseHandler to dispatch to. */ @@ -31,4 +31,5 @@ public abstract class CallableResponseDispatch extends ResponseDispatch implemen public final Boolean call() throws Exception { return dispatch(handler).get(); } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CompletionHandler.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CompletionHandler.java index 134a6aaea47..4975f32adfe 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CompletionHandler.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/CompletionHandler.java @@ -18,7 +18,7 @@ import com.yahoo.jdisc.Container; * throughout its lifetime. This also means that the either {@link #completed()} or {@link #failed(Throwable)} MUST be * called in order to release that reference. Failure to do so will prevent the Container from ever shutting down. * - * @author Simon Thoresen + * @author Simon Thoresen */ public interface CompletionHandler { @@ -27,7 +27,7 @@ public interface CompletionHandler { * release the internal {@link Container} reference. Failure to do so will prevent the Container from ever shutting * down. */ - public void completed(); + void completed(); /** * Invoked when an operation fails. Notice that you MUST call either this or {@link #completed()} to release the @@ -35,5 +35,6 @@ public interface CompletionHandler { * * @param t The exception to indicate why the I/O operation failed. */ - public void failed(Throwable t); + void failed(Throwable t); + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java index 9fa78368f62..e01a3c312be 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentChannel.java @@ -21,7 +21,7 @@ import java.nio.ByteBuffer; * requirement is regardless of any errors that may occur while calling any of its other methods or its derived {@link * CompletionHandler}s. * - * @author Simon Thoresen + * @author Simon Thoresen */ public interface ContentChannel { @@ -33,7 +33,7 @@ public interface ContentChannel { * @param buf The {@link ByteBuffer} to schedule for write. No further calls can be made to this buffer. * @param handler The {@link CompletionHandler} to call after the write has been executed. */ - public void write(ByteBuffer buf, CompletionHandler handler); + void write(ByteBuffer buf, CompletionHandler handler); /** * Closes this ContentChannel. After a channel is closed, any further attempt to invoke {@link #write(ByteBuffer, @@ -45,5 +45,6 @@ public interface ContentChannel { * * @param handler The {@link CompletionHandler} to call after the close has been executed. */ - public void close(CompletionHandler handler); + void close(CompletionHandler handler); + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentInputStream.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentInputStream.java index ecc123dc095..3f89ba04aa5 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentInputStream.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ContentInputStream.java @@ -2,15 +2,15 @@ package com.yahoo.jdisc.handler; /** - *

This class extends {@link UnsafeContentInputStream} and adds a finalizer to it that calls {@link #close()}. This - * has a performance impact, but ensures that an unclosed stream does not prevent shutdown.

+ * This class extends {@link UnsafeContentInputStream} and adds a finalizer to it that calls {@link #close()}. This + * has a performance impact, but ensures that an unclosed stream does not prevent shutdown. * - * @author Simon Thoresen + * @author Simon Thoresen */ public final class ContentInputStream extends UnsafeContentInputStream { /** - *

Constructs a new ContentInputStream that reads from the given {@link ReadableContentChannel}.

+ * Constructs a new ContentInputStream that reads from the given {@link ReadableContentChannel}. * * @param content The content to read the stream from. */ @@ -26,4 +26,5 @@ public final class ContentInputStream extends UnsafeContentInputStream { super.finalize(); } } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentOutputStream.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentOutputStream.java index 1b6af5d7fe3..1ccbfad83c9 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentOutputStream.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentOutputStream.java @@ -18,7 +18,7 @@ import java.util.concurrent.TimeoutException; *

Please notice that the Future implementation of this class will NEVER complete unless {@link #close()} has been * called.

* - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public class FastContentOutputStream extends AbstractContentOutputStream implements ListenableFuture { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentWriter.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentWriter.java index 76cc060b961..86e9851629c 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentWriter.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FastContentWriter.java @@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger; *

Please notice that the Future implementation of this class will NEVER complete unless {@link #close()} has been * called; please use try-with-resources to ensure that close() is called.

* - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public class FastContentWriter implements ListenableFuture, AutoCloseable { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureCompletion.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureCompletion.java index ec3fa4e3d78..e18c88382b6 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureCompletion.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureCompletion.java @@ -11,7 +11,7 @@ import com.google.common.util.concurrent.AbstractFuture; * *

Notice that calling {@link #cancel(boolean)} throws an UnsupportedOperationException.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public final class FutureCompletion extends AbstractFuture implements CompletionHandler { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureConjunction.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureConjunction.java index 15882e4fd1b..bda0f845af0 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureConjunction.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureConjunction.java @@ -15,7 +15,7 @@ import java.util.concurrent.*; * simply create an instance of it and add operands to it using the {@link #addOperand(ListenableFuture)} method.

* TODO: consider rewriting usage of FutureConjunction to use CompletableFuture instead. * - * @author Simon Thoresen + * @author Simon Thoresen */ public final class FutureConjunction implements ListenableFuture { @@ -94,4 +94,5 @@ public final class FutureConjunction implements ListenableFuture { } return ret; } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureResponse.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureResponse.java index fea4f84416a..3360812864a 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureResponse.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/FutureResponse.java @@ -5,10 +5,10 @@ import com.google.common.util.concurrent.AbstractFuture; import com.yahoo.jdisc.Response; /** - *

This class provides an implementation of {@link ResponseHandler} that allows you to wait for a {@link Response} to - * be returned.

+ * This class provides an implementation of {@link ResponseHandler} that allows you to wait for a {@link Response} to + * be returned. * - * @author Simon Thoresen + * @author Simon Thoresen */ public final class FutureResponse extends AbstractFuture implements ResponseHandler { @@ -63,4 +63,5 @@ public final class FutureResponse extends AbstractFuture implements Re public final boolean isCancelled() { return false; } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/NullContent.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/NullContent.java index a4476affcc5..a561823891f 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/NullContent.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/NullContent.java @@ -13,7 +13,7 @@ import java.nio.ByteBuffer; *

A {@link RequestHandler}s that does not expect content can simply return the {@link #INSTANCE} of this class for * every invocation of its {@link RequestHandler#handleRequest(Request, ResponseHandler)}.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public final class NullContent implements ContentChannel { @@ -39,4 +39,5 @@ public final class NullContent implements ContentChannel { handler.completed(); } } + } diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java index 20cab5eb249..ba6ff200a51 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/OverloadException.java @@ -5,17 +5,14 @@ package com.yahoo.jdisc.handler; * An exception to signal abort current action, as the container is overloaded. * Just unroll state as cheaply as possible. * - *

- * The contract of OverloadException (for Jetty) is: - *

+ * The contract of OverloadException is: * *
    - *
  1. You must set the response yourself first, or you'll get 500 internal - * server error.
  2. - *
  3. You must throw it from handleRequest synchronously.
  4. + *
  5. You must set the response yourself first, or you'll get an internal server error. + *
  6. You must throw it from handleRequest synchronously. *
* - * @author Steinar Knutsen + * @author Steinar Knutsen */ public class OverloadException extends RuntimeException { public OverloadException(String message, Throwable cause) { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ReadableContentChannel.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ReadableContentChannel.java index 27edb619837..50cd2ab2e8c 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ReadableContentChannel.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ReadableContentChannel.java @@ -15,7 +15,7 @@ import java.util.Queue; * a {@link BufferedContentChannel} up front, and {@link BufferedContentChannel#connectTo(ContentChannel) connect} that * to a ReadableContentChannel at the point where you decide to consume the data.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public final class ReadableContentChannel implements ContentChannel, Iterable { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDeniedException.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDeniedException.java index 8c7a0c7ca24..012ac92b057 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDeniedException.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDeniedException.java @@ -11,7 +11,7 @@ import java.net.URI; * or {@link RequestHandler}. There is no automation in throwing an instance of this class, but all RequestHandlers are * encouraged to use this where appropriate.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public final class RequestDeniedException extends RuntimeException { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java index d986bc562ca..211c5474fe6 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/RequestDispatch.java @@ -44,7 +44,7 @@ import java.util.List; * } * * - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public abstract class RequestDispatch implements ListenableFuture, ResponseHandler { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseDispatch.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseDispatch.java index 5fcc19de499..e5e6b752716 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseDispatch.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseDispatch.java @@ -32,7 +32,7 @@ import java.util.concurrent.Future; * } * * - * @author Simon Thoresen Hult + * @author Simon Thoresen Hult */ public abstract class ResponseDispatch extends ForwardingListenableFuture { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseHandler.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseHandler.java index 0b44e68aa0f..8e22192570c 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseHandler.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ResponseHandler.java @@ -15,7 +15,7 @@ import com.yahoo.jdisc.service.ClientProvider; * corresponding Request, but rather leave that to the implementation of context-aware ResponseHandlers. By creating * light-weight ResponseHandlers on a per-Request basis, any necessary reference can be embedded within.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public interface ResponseHandler { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ThreadedRequestHandler.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ThreadedRequestHandler.java index d794b2345ab..c50df27120f 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ThreadedRequestHandler.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/ThreadedRequestHandler.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; * } * * - * @author Simon Thoresen + * @author Simon Thoresen */ public abstract class ThreadedRequestHandler extends AbstractRequestHandler { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/UnsafeContentInputStream.java b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/UnsafeContentInputStream.java index 8fb83595ff2..c895e8fe1a5 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/handler/UnsafeContentInputStream.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/handler/UnsafeContentInputStream.java @@ -13,7 +13,7 @@ import java.util.Objects; * always call {@link #close()} before discarding it. Failure to do so will prevent the Container from ever shutting * down.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public class UnsafeContentInputStream extends InputStream { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/service/AbstractServerProvider.java b/jdisc_core/src/main/java/com/yahoo/jdisc/service/AbstractServerProvider.java index e8a841a8c1b..5e45fbab80b 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/service/AbstractServerProvider.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/service/AbstractServerProvider.java @@ -12,7 +12,7 @@ import java.util.Objects; * essential {@link #start()} and {@link #close()} methods. It requires that the {@link CurrentContainer} is injected in * the constructor, since that interface is needed to dispatch {@link Request}s.

* - * @author Simon Thoresen + * @author Simon Thoresen */ public abstract class AbstractServerProvider extends AbstractResource implements ServerProvider { diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/statistics/ActiveContainerMetrics.java b/jdisc_core/src/main/java/com/yahoo/jdisc/statistics/ActiveContainerMetrics.java index 9a5271fd417..440c9af6bf5 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/statistics/ActiveContainerMetrics.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/statistics/ActiveContainerMetrics.java @@ -10,8 +10,10 @@ import com.yahoo.jdisc.core.ActiveContainer; * @author bjorncs */ public interface ActiveContainerMetrics { + String TOTAL_DEACTIVATED_CONTAINERS = "jdisc.deactivated_containers.total"; String DEACTIVATED_CONTAINERS_WITH_RETAINED_REFERENCES = "jdisc.deactivated_containers.with_retained_refs"; void emitMetrics(Metric metric); + } -- cgit v1.2.3