diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index d536c9c1ce1..f13aa1ad7e8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -53,7 +53,7 @@ import org.eclipse.jetty.util.thread.Scheduler; /** *

An abstract implementation of {@link Connector} that provides a {@link ConnectionFactory} mechanism - * for creating {@link Connection} instances for various protocols (HTTP, SSL, etc).

+ * for creating {@link org.eclipse.jetty.io.Connection} instances for various protocols (HTTP, SSL, etc).

* *

Connector Services

* The abstract connector manages the dependent services needed by all specific connector instances: @@ -79,7 +79,7 @@ import org.eclipse.jetty.util.thread.Scheduler; * an {@link SslConnectionFactory} that has been instantiated with the {@link HttpConnectionFactory} as it's * next protocol. * - *

Configuring Connection Factories

+ *

Configuring Connection Factories

* The collection of available {@link ConnectionFactory} may be constructor injected or modified with the * methods {@link #addConnectionFactory(ConnectionFactory)}, {@link #removeConnectionFactory(String)} and * {@link #setConnectionFactories(Collection)}. Only a single {@link ConnectionFactory} instance may be configured @@ -94,20 +94,20 @@ import org.eclipse.jetty.util.thread.Scheduler; * (or other factories that can also provide HTTP Semantics). Similarly the {@link SslConnectionFactory} is * configured by passing it a {@link SslContextFactory} and a next protocol name. * - *

Connection Factory Operation

- * {@link ConnectionFactory}s may simply create a {@link Connection} instance to support a specific + *

Connection Factory Operation

+ * {@link ConnectionFactory}s may simply create a {@link org.eclipse.jetty.io.Connection} instance to support a specific * protocol. For example, the {@link HttpConnectionFactory} will create a {@link HttpConnection} instance * that can handle http/1.1, http/1.0 and http/0.9. *

- * {@link ConnectionFactory}s may also create a chain of {@link Connection} instances, using other {@link ConnectionFactory} instances. + * {@link ConnectionFactory}s may also create a chain of {@link org.eclipse.jetty.io.Connection} instances, using other {@link ConnectionFactory} instances. * For example, the {@link SslConnectionFactory} is configured with a next protocol name, so that once it has accepted * a connection and created an {@link SslConnection}, it then used the next {@link ConnectionFactory} from the - * connector using the {@link #getConnectionFactory(String)} method, to create a {@link Connection} instance that - * will handle the unecrypted bytes from the {@link SslConnection}. If the next protocol is "http/1.1", then the + * connector using the {@link #getConnectionFactory(String)} method, to create a {@link org.eclipse.jetty.io.Connection} instance that + * will handle the unencrypted bytes from the {@link SslConnection}. If the next protocol is "http/1.1", then the * {@link SslConnectionFactory} will have a protocol name of "SSL-http/1.1" and lookup "http/1.1" for the protocol * to run over the SSL connection. *

- * {@link ConnectionFactory}s may also create temporary {@link Connection} instances that will exchange bytes + * {@link ConnectionFactory}s may also create temporary {@link org.eclipse.jetty.io.Connection} instances that will exchange bytes * over the connection to determine what is the next protocol to use. For example the ALPN protocol is an extension * of SSL to allow a protocol to be specified during the SSL handshake. ALPN is used by the HTTP/2 protocol to * negotiate the protocol that the client and server will speak. Thus to accept a HTTP/2 connection, the @@ -118,18 +118,17 @@ import org.eclipse.jetty.util.thread.Scheduler; * could be "h2" or the default of "http/1.1". Once the next protocol is determined, the ALPN connection * calls {@link #getConnectionFactory(String)} to create a connection instance that will replace the ALPN connection as * the connection chained to the SSL connection. - *

*

Acceptors

* The connector will execute a number of acceptor tasks to the {@link Exception} service passed to the constructor. * The acceptor tasks run in a loop while the connector is running and repeatedly call the abstract {@link #accept(int)} method. * The implementation of the accept method must: - * - *
  • block waiting for new connections - *
  • accept the connection (eg socket accept) - *
  • perform any configuration of the connection (eg. socket linger times) + *
      + *
    1. block waiting for new connections
    2. + *
    3. accept the connection (eg socket accept)
    4. + *
    5. perform any configuration of the connection (eg. socket linger times)
    6. *
    7. call the {@link #getDefaultConnectionFactory()} {@link ConnectionFactory#newConnection(Connector, org.eclipse.jetty.io.EndPoint)} - * method to create a new Connection instance. - * + * method to create a new Connection instance.
    8. + *
    * The default number of acceptor tasks is the minimum of 1 and half the number of available CPUs. Having more acceptors may reduce * the latency for servers that see a high rate of new connections (eg HTTP/1.0 without keep-alive). Typically the default is * sufficient for modern persistent protocols (HTTP/1.1, HTTP/2 etc.) @@ -464,7 +463,7 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co * Typically this would be used to lower the priority to give preference * to handling previously accepted connections rather than accepting * new connections

    - * @param acceptorPriorityDelta + * @param acceptorPriorityDelta the acceptor priority delta */ public void setAcceptorPriorityDelta(int acceptorPriorityDelta) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java index df70136eaaf..3689a750bce 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java @@ -68,6 +68,7 @@ public abstract class AbstractNCSARequestLog extends AbstractLifeCycle implement /** * Is logging enabled + * @return true if logging is enabled */ protected abstract boolean isEnabled(); @@ -75,6 +76,8 @@ public abstract class AbstractNCSARequestLog extends AbstractLifeCycle implement /** * Write requestEntry out. (to disk or slf4j log) + * @param requestEntry the request entry + * @throws IOException if unable to write the entry */ public abstract void write(String requestEntry) throws IOException; @@ -224,7 +227,7 @@ public abstract class AbstractNCSARequestLog extends AbstractLifeCycle implement * * @param request request object * @param b StringBuilder to write to - * @throws IOException + * @throws IOException if unable to log the extended information */ protected void logExtended(Request request, StringBuilder b) throws IOException @@ -334,15 +337,19 @@ public abstract class AbstractNCSARequestLog extends AbstractLifeCycle implement } /** + * @param value true to log dispatch * @deprecated use {@link StatisticsHandler} */ + @Deprecated public void setLogDispatch(boolean value) { } /** + * @return true if logging dispatches * @deprecated use {@link StatisticsHandler} */ + @Deprecated public boolean isLogDispatch() { return false; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java index 66133ebea5d..426a463535c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Authentication.java @@ -24,14 +24,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -/* ------------------------------------------------------------ */ /** The Authentication state of a request. *

    * The Authentication state can be one of several sub-types that * reflects where the request is in the many different authentication * cycles. Authentication might not yet be checked or it might be checked * and failed, checked and deferred or succeeded. - * */ public interface Authentication { @@ -75,6 +73,7 @@ public interface Authentication /** Authenticate if possible without sending a challenge. * This is used to check credentials that have been sent for * non-manditory authentication. + * @param request the request * @return The new Authentication state. */ Authentication authenticate(ServletRequest request); @@ -83,6 +82,8 @@ public interface Authentication /** Authenticate and possibly send a challenge. * This is used to initiate authentication for previously * non-manditory authentication. + * @param request the request + * @param response the response * @return The new Authentication state. */ Authentication authenticate(ServletRequest request,ServletResponse response); @@ -90,8 +91,9 @@ public interface Authentication /* ------------------------------------------------------------ */ /** Login with the LOGIN authenticator - * @param username - * @param password + * @param username the username + * @param password the password + * @param request the request * @return The new Authentication state */ Authentication login(String username,Object password,ServletRequest request); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionFactory.java index c1433813a3b..01a8e8a7c3f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ConnectionFactory.java @@ -28,12 +28,14 @@ import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.EndPoint; /** - *

    A Factory to create {@link Connection} instances for {@link Connector}s.

    - *

    A Connection factory is responsible for instantiating and configuring a {@link Connection} instance - * to handle an {@link EndPoint} accepted by a {@link Connector}.

    + * A Factory to create {@link Connection} instances for {@link Connector}s. + *

    + * A Connection factory is responsible for instantiating and configuring a {@link Connection} instance + * to handle an {@link EndPoint} accepted by a {@link Connector}. *

    * A ConnectionFactory has a protocol name that represents the protocol of the Connections - * created. Example of protocol names include:

    + * created. Example of protocol names include: + *
    *
    http
    Creates a HTTP connection that can handle multiple versions of HTTP from 0.9 to 1.1
    *
    h2
    Creates a HTTP/2 connection that handles the HTTP/2 protocol
    *
    SSL-XYZ
    Create an SSL connection chained to a connection obtained from a connection factory @@ -77,7 +79,7 @@ public interface ConnectionFactory * @param connector The connector to upgrade for. * @param endPoint The endpoint of the connection. * @param upgradeRequest The meta data of the upgrade request. - * @param reponseFields The fields to be sent with the 101 response + * @param responseFields The fields to be sent with the 101 response * @return Null to indicate that request processing should continue normally without upgrading. A new connection instance to * indicate that the upgrade should proceed. * @throws BadMessageException Thrown to indicate the upgrade attempt was illegal and that a bad message response should be sent. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Connector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Connector.java index d31a7bfa1d3..1981c59d74e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Connector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Connector.java @@ -60,6 +60,7 @@ public interface Connector extends LifeCycle, Graceful public ByteBufferPool getByteBufferPool(); /** + * @param nextProtocol the next protocol * @return the {@link ConnectionFactory} associated with the protocol name */ public ConnectionFactory getConnectionFactory(String nextProtocol); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Handler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Handler.java index fb0d4f7843b..ac2b0436a80 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Handler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Handler.java @@ -32,11 +32,13 @@ import org.eclipse.jetty.util.annotation.ManagedOperation; import org.eclipse.jetty.util.component.Destroyable; import org.eclipse.jetty.util.component.LifeCycle; -/* ------------------------------------------------------------ */ /** A Jetty Server Handler. - * + *

    * A Handler instance is required by a {@link Server} to handle incoming - * HTTP requests. A Handler may:

      + * HTTP requests. + *

      + * A Handler may: + *

        *
      • Completely generate the HTTP Response
      • *
      • Examine/modify the request and call another Handler (see {@link HandlerWrapper}). *
      • Pass the request to one or more other Handlers (see {@link HandlerCollection}). @@ -51,18 +53,25 @@ import org.eclipse.jetty.util.component.LifeCycle; @ManagedObject("Jetty Handler") public interface Handler extends LifeCycle, Destroyable { - /* ------------------------------------------------------------ */ - /** Handle a request. - * @param target The target of the request - either a URI or a name. - * @param baseRequest The original unwrapped request object. - * @param request The request either as the {@link Request} - * object or a wrapper of that request. The {@link HttpChannel#getCurrentHttpChannel()} - * method can be used access the Request object if required. - * @param response The response as the {@link Response} - * object or a wrapper of that request. The {@link HttpChannel#getCurrentHttpChannel()} - * method can be used access the Response object if required. + /** + * Handle a request. + * + * @param target + * The target of the request - either a URI or a name. + * @param baseRequest + * The original unwrapped request object. + * @param request + * The request either as the {@link Request} object or a wrapper of that request. The + * {@link HttpConnection#getCurrentConnection()}.{@link HttpConnection#getHttpChannel() getHttpChannel()}.{@link HttpChannel#getRequest() getRequest()} + * method can be used access the Request object if required. + * @param response + * The response as the {@link Response} object or a wrapper of that request. The + * {@link HttpConnection#getCurrentConnection()}.{@link HttpConnection#getHttpChannel() getHttpChannel()}.{@link HttpChannel#getResponse() getResponse()} + * method can be used access the Response object if required. * @throws IOException + * if unable to handle the request or response processing * @throws ServletException + * if unable to handle the request or response due to underlying servlet issue */ public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException; @@ -74,6 +83,5 @@ public interface Handler extends LifeCycle, Destroyable @ManagedOperation(value="destroy associated resources", impact="ACTION") public void destroy(); - } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HandlerContainer.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HandlerContainer.java index dfe4c7190a8..301a87df5bf 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HandlerContainer.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HandlerContainer.java @@ -48,15 +48,16 @@ public interface HandlerContainer extends LifeCycle /* ------------------------------------------------------------ */ /** - * @param byclass + * @param byclass the child handler class to get * @return array of all handlers contained by this handler and it's children of the passed type. */ public Handler[] getChildHandlersByClass(Class byclass); /* ------------------------------------------------------------ */ /** - * @param byclass + * @param byclass the child handler class to get * @return first handler of all handlers contained by this handler and it's children of the passed type. + * @param the type of handler */ public T getChildHandlerByClass(Class byclass); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index c20de0332a7..91ea3d11492 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -147,6 +147,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor * Get the idle timeout. *

        This is implemented as a call to {@link EndPoint#getIdleTimeout()}, but may be * overridden by channels that have timeouts different from their connections. + * @return the idle timeout (in milliseconds) */ public long getIdleTimeout() { @@ -155,8 +156,9 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor /** * Set the idle timeout. - *

        This is implemented as a call to {@link EndPoint#setIdleTimeout(long), but may be + *

        This is implemented as a call to {@link EndPoint#setIdleTimeout(long)}, but may be * overridden by channels that have timeouts different from their connections. + * @param timeoutMs the idle timeout in milliseconds */ public void setIdleTimeout(long timeoutMs) { @@ -213,7 +215,8 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor * If the associated response has the Expect header set to 100 Continue, * then accessing the input stream indicates that the handler/servlet * is ready for the request body and thus a 100 Continue response is sent. - * + * + * @param available estimate of the number of bytes that are available * @throws IOException if the InputStream cannot be created */ public void continue100(int available) throws IOException diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java index b7a74231641..9a2dccc260b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannelState.java @@ -37,10 +37,6 @@ import org.eclipse.jetty.util.thread.SpinLock; /** * Implementation of AsyncContext interface that holds the state of request-response cycle. */ - -/* ------------------------------------------------------------ */ -/** - */ public class HttpChannelState { private static final Logger LOG = Log.getLogger(HttpChannelState.class); @@ -804,7 +800,7 @@ public class HttpChannelState * This is similar to calling {@link #onReadUnready()} followed by * {@link #onReadPossible()}, except that as content is already * available, read interest is never set. - * @return + * @return true if woken */ public boolean onReadReady() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index fe91e63e7bc..0cc84fe3c0e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -32,6 +32,7 @@ import org.eclipse.jetty.http.HttpParser; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.http.PreEncodedHttpField; +import org.eclipse.jetty.http.HttpParser.RequestHandler; import org.eclipse.jetty.io.AbstractConnection; import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.Connection; @@ -260,7 +261,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http /* ------------------------------------------------------------ */ /** Fill and parse data looking for content - * @throws IOException + * @return true if an {@link RequestHandler} method was called and it returned true; */ protected boolean fillAndParseForContent() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index 599ddc3faf7..43244964b81 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -41,7 +41,6 @@ import org.eclipse.jetty.util.log.Logger; * maintains two states: the content state that tells whether there is content to consume and the EOF * state that tells whether an EOF has arrived. * Only once the content has been consumed the content state is moved to the EOF state. - * */ public class HttpInput extends ServletInputStream implements Runnable { @@ -157,7 +156,7 @@ public class HttpInput extends ServletInputStream implements Runnable * produce more Content and add it via {@link #addContent(Content)}. * For protocols that are constantly producing (eg HTTP2) this can * be left as a noop; - * @throws IOException + * @throws IOException if unable to produce content */ protected void produceContent() throws IOException { @@ -351,7 +350,8 @@ public class HttpInput extends ServletInputStream implements Runnable /** * Adds some content to this input stream. * - * @param content the content to add + * @param item the content to add + * @return true if content channel woken for read */ public boolean addContent(Content item) { @@ -401,6 +401,7 @@ public class HttpInput extends ServletInputStream implements Runnable *

        * Typically this will result in an EOFException being thrown * from a subsequent read rather than a -1 return. + * @return true if content channel woken for read */ public boolean earlyEOF() { @@ -410,6 +411,7 @@ public class HttpInput extends ServletInputStream implements Runnable /** * This method should be called to signal that all the expected * content arrived. + * @return true if content channel woken for read */ public boolean eof() { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java index 028e0a0fdd3..f54af0ca039 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LowResourceMonitor.java @@ -37,11 +37,14 @@ import org.eclipse.jetty.util.thread.Scheduler; import org.eclipse.jetty.util.thread.ThreadPool; -/* ------------------------------------------------------------ */ -/** A monitor for low resources - *

        An instance of this class will monitor all the connectors of a server (or a set of connectors +/** + * A monitor for low resources + *

        + * An instance of this class will monitor all the connectors of a server (or a set of connectors * configured with {@link #setMonitoredConnectors(Collection)}) for a low resources state. - * Low resources can be detected by:

          + *

          + * Low resources can be detected by: + *

            *
          • {@link ThreadPool#isLowOnThreads()} if {@link Connector#getExecutor()} is * an instance of {@link ThreadPool} and {@link #setMonitorThreads(boolean)} is true.
          • *
          • If {@link #setMaxMemory(long)} is non zero then low resources is detected if the JVMs @@ -50,14 +53,13 @@ import org.eclipse.jetty.util.thread.ThreadPool; *
          • If {@link #setMaxConnections(int)} is non zero then low resources is dected if the total number * of connections exceeds {@link #getMaxConnections()}
          • *
          - *

          - *

          Once low resources state is detected, the cause is logged and all existing connections returned + *

          + * Once low resources state is detected, the cause is logged and all existing connections returned * by {@link Connector#getConnectedEndPoints()} have {@link EndPoint#setIdleTimeout(long)} set * to {@link #getLowResourcesIdleTimeout()}. New connections are not affected, however if the low * resources state persists for more than {@link #getMaxLowResourcesTime()}, then the * {@link #getLowResourcesIdleTimeout()} to all connections again. Once the low resources state is * cleared, the idle timeout is reset to the connector default given by {@link Connector#getIdleTimeout()}. - *

          */ @ManagedObject ("Monitor for low resource conditions and activate a low resource mode if detected") public class LowResourceMonitor extends AbstractLifeCycle diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java index 27a3fbbae42..f810f4c55a5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ProxyConnectionFactory.java @@ -35,11 +35,12 @@ import org.eclipse.jetty.util.log.Logger; /* ------------------------------------------------------------ */ -/** ConnectionFactory for the PROXY Protocol. +/** + * ConnectionFactory for the PROXY Protocol. *

          This factory can be placed in front of any other connection factory * to process the proxy line before the normal protocol handling

          * - * @see http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt + * @see http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt */ public class ProxyConnectionFactory extends AbstractConnectionFactory { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilder.java b/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilder.java index 275398c7ee0..5e807b45dc6 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilder.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/PushBuilder.java @@ -20,47 +20,47 @@ package org.eclipse.jetty.server; import java.util.Set; -import javax.servlet.ServletRequest; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; - - /** Build a request to be pushed. + *

          * A PushBuilder is obtained by calling {@link Request#getPushBuilder()} - * which creates an initialises the builder as follows:

            + * which creates an initializes the builder as follows: + *
              *
            • Each call to getPushBuilder() will return a new instance of a * PushBuilder based off the Request. Any mutations to the * returned PushBuilder are not reflected on future returns.
            • - *
            • The method is initialised to "GET"
            • + *
            • The method is initialized to "GET"
            • *
            • The requests headers are added to the Builder, except for:
                *
              • Conditional headers (eg. If-Modified-Since) *
              • Range headers *
              • Expect headers - *
              • Authorisation headers + *
              • Authorization headers *
              • Referrer headers *
            • - *
            • If the request was Authenticated, an Authorisation header will + *
            • If the request was Authenticated, an Authorization header will * be set with a container generated token that will result in equivalent - * Authorisation for the pushed request
            • - *
            • The query string from {@link ServletRequest#getQueryString()} - *
            • The {@link ServletRequest#getRequestedSessionId()} value, unless at the time - * of the call {@link ServletRequest#getSession(boolean)} + * Authorization for the pushed request
            • + *
            • The query string from {@link HttpServletRequest#getQueryString()} + *
            • The {@link HttpServletRequest#getRequestedSessionId()} value, unless at the time + * of the call {@link HttpServletRequest#getSession(boolean)} * has previously been called to create a new {@link HttpSession}, in * which case the new session ID will be used as the PushBuilders * requested session ID. The source of the requested session id will be the * same as for the request
            • - *
            • The Referer header will be set to {@link ServletRequest#getRequestURL()} - * plus any {@link ServletRequest#getQueryString()}
            • + *
            • The Referer header will be set to {@link HttpServletRequest#getRequestURL()} + * plus any {@link HttpServletRequest#getQueryString()}
            • *
            • If {@link HttpServletResponse#addCookie(Cookie)} has been called * on the associated response, then a corresponding Cookie header will be added - * to the PushBuilder, unless the {@link Cookie#getMaxAge()} is <=0, in which + * to the PushBuilder, unless the {@link Cookie#getMaxAge()} is <=0, in which * case the Cookie will be removed from the builder.
            • *
            • If this request has has the conditional headers If-Modified-Since or * If-None-Match then the {@link #isConditional()} header is set to true.
            • *
            - *

            A PushBuilder can be customised by chained calls to mutator methods before the + *

            A PushBuilder can be customized by chained calls to mutator methods before the * {@link #push()} method is called to initiate a push request with the current state * of the builder. After the call to {@link #push()}, the builder may be reused for * another push, however the {@link #path(String)}, {@link #etag(String)} and @@ -128,7 +128,7 @@ public interface PushBuilder * the associated request. * There is no path default and {@link #path(String)} must be called * before every call to {@link #push()} - * @param the URI path to be used for the push, which may include a + * @param path the URI path to be used for the push, which may include a * query string. * @return this builder. */ @@ -138,7 +138,7 @@ public interface PushBuilder * The etag will be used only if {@link #isConditional()} is true. * Defaults to no etag. The value is nulled after every call to * {@link #push()} - * @param the etag to be used for the push. + * @param etag the etag to be used for the push. * @return this builder. */ public abstract PushBuilder etag(String etag); @@ -147,7 +147,7 @@ public interface PushBuilder * The last modified date will be used only if {@link #isConditional()} is true. * Defaults to no date. The value is nulled after every call to * {@link #push()} - * @param the last modified date to be used for the push. + * @param lastModified the last modified date to be used for the push. * @return this builder. * */ public abstract PushBuilder lastModified(String lastModified); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java index 25daa3c5042..08a7d95f1ac 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java @@ -88,7 +88,6 @@ import org.eclipse.jetty.util.UrlEncoded; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; -/* ------------------------------------------------------------ */ /** * Jetty Request. *

            @@ -117,8 +116,6 @@ import org.eclipse.jetty.util.log.Logger; * {@link ContextHandler#getMaxFormContentSize()} or if there is no context then the "org.eclipse.jetty.server.Request.maxFormContentSize" {@link Server} * attribute. The number of parameters keys is limited by {@link ContextHandler#getMaxFormKeys()} or if there is no context then the * "org.eclipse.jetty.server.Request.maxFormKeys" {@link Server} attribute. - * - * */ public class Request implements HttpServletRequest { @@ -255,7 +252,7 @@ public class Request implements HttpServletRequest * plus any {@link #getQueryString()} *

          • If {@link HttpServletResponse#addCookie(Cookie)} has been called * on the associated response, then a corresponding Cookie header will be added - * to the PushBuilder, unless the {@link Cookie#getMaxAge()} is <=0, in which + * to the PushBuilder, unless the {@link Cookie#getMaxAge()} is <=0, in which * case the Cookie will be removed from the builder.
          • *
          • If this request has has the conditional headers If-Modified-Since or * If-None-Match then the {@link PushBuilderImpl#isConditional()} header is set @@ -524,7 +521,8 @@ public class Request implements HttpServletRequest /* ------------------------------------------------------------ */ /** * Get Request Attribute. - *

            Also supports jetty specific attributes to gain access to Jetty APIs: + *

            + * Also supports jetty specific attributes to gain access to Jetty APIs: *

            *
            org.eclipse.jetty.server.Server
            The Jetty Server instance
            *
            org.eclipse.jetty.server.HttpChannel
            The HttpChannel for this request
            @@ -532,7 +530,6 @@ public class Request implements HttpServletRequest *
            * While these attributes may look like security problems, they are exposing nothing that is not already * available via reflection from a Request instance. - *

            * @see javax.servlet.ServletRequest#getAttribute(java.lang.String) */ @Override @@ -1583,7 +1580,7 @@ public class Request implements HttpServletRequest /* ------------------------------------------------------------ */ /** - * @param old_uri + * @param uri the URI to set */ public void setHttpURI(HttpURI uri) { @@ -1745,7 +1742,7 @@ public class Request implements HttpServletRequest /* ------------------------------------------------------------ */ /** - * @param request + * @param request the Request metadata */ public void setMetaData(org.eclipse.jetty.http.MetaData.Request request) { @@ -2030,7 +2027,7 @@ public class Request implements HttpServletRequest /* ------------------------------------------------------------ */ /** * Sets the "context path" for this request - * + * @param contextPath the context path for this request * @see HttpServletRequest#getContextPath() */ public void setContextPath(String contextPath) @@ -2095,7 +2092,7 @@ public class Request implements HttpServletRequest * * The request attribute "org.eclipse.jetty.server.server.Request.queryEncoding" may be set as an alternate method of calling setQueryEncoding. * - * @param queryEncoding + * @param queryEncoding the URI query character encoding */ public void setQueryEncoding(String queryEncoding) { @@ -2163,6 +2160,8 @@ public class Request implements HttpServletRequest /** * @param host * The host to set. + * @param port + * the port to set */ public void setAuthority(String host,int port) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java index b7580c2ba66..b9e73bdd3f5 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ResourceCache.java @@ -46,10 +46,6 @@ import org.eclipse.jetty.util.resource.Resource; import org.eclipse.jetty.util.resource.ResourceFactory; -/* ------------------------------------------------------------ */ -/** - * - */ public class ResourceCache { private static final Logger LOG = Log.getLogger(ResourceCache.class); @@ -69,7 +65,11 @@ public class ResourceCache /* ------------------------------------------------------------ */ /** Constructor. + * @param parent the parent resource cache + * @param factory the resource factory * @param mimeTypes Mimetype to use for meta data + * @param useFileMappedBuffer true to file memory mapped buffers + * @param etags true to support etags */ public ResourceCache(ResourceCache parent, ResourceFactory factory, MimeTypes mimeTypes,boolean useFileMappedBuffer,boolean etags) { @@ -201,7 +201,7 @@ public class ResourceCache /* ------------------------------------------------------------ */ /** - * @param resource + * @param resource the resource to test * @return True if the resource is cacheable. The default implementation tests the cache sizes. */ protected boolean isCacheable(Resource resource) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index fb0a7a27766..c1dfabf5169 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -217,7 +217,7 @@ public class Response implements HttpServletResponse * @param domain the domain * @param path the path * @param maxAge the maximum age - * @param comment the comment (only present on versions > 0) + * @param comment the comment (only present on versions > 0) * @param isSecure true if secure cookie * @param isHttpOnly true if for http only * @param version version of cookie logic to use (0 == default behavior) @@ -634,6 +634,7 @@ public class Response implements HttpServletResponse * request has a Expect header starting with 102, then a 102 response is * sent. This indicates that the request still be processed and real response * can still be sent. This method is called by sendError if it is passed 102. + * @throws IOException if unable to send the 102 response * @see javax.servlet.http.HttpServletResponse#sendError(int) */ public void sendProcessing() throws IOException @@ -646,9 +647,9 @@ public class Response implements HttpServletResponse /** * Sends a response with one of the 300 series redirection codes. - * @param code - * @param location - * @throws IOException + * @param code the redirect status code + * @param location the location to send in Location headers + * @throws IOException if unable to send the redirect */ public void sendRedirect(int code, String location) throws IOException { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index 786c048f1ea..f726e7d38f9 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -110,8 +110,11 @@ public class Server extends HandlerWrapper implements Attributes } /* ------------------------------------------------------------ */ - /** Convenience constructor + /** + * Convenience constructor + *

            * Creates server and a {@link ServerConnector} at the passed address. + * @param addr the inet socket address to create the connector from */ public Server(@Name("address")InetSocketAddress addr) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java index 8adcc2cb0d3..1665a19b16c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java @@ -53,7 +53,6 @@ import org.eclipse.jetty.util.thread.Scheduler; * use all the commons services (eg {@link Executor}, {@link Scheduler}) of the * passed {@link Server} instance, but all services may also be constructor injected * into the connector so that it may operate with dedicated or otherwise shared services. - *

            *

            Connection Factories

            * Various convenience constructors are provided to assist with common configurations of * ConnectionFactories, whose generic use is described in {@link AbstractConnector}. @@ -61,7 +60,6 @@ import org.eclipse.jetty.util.thread.Scheduler; * default to use a {@link HttpConnectionFactory}. If an non null {@link SslContextFactory} * instance is passed, then this used to instantiate a {@link SslConnectionFactory} which is * prepended to the other passed or default factories. - *

            *

            Selectors

            * The connector will use the {@link Executor} service to execute a number of Selector Tasks, * which are implemented to each use a NIO {@link Selector} instance to asynchronously @@ -107,7 +105,7 @@ public class ServerConnector extends AbstractNetworkConnector * the number of acceptor threads to use, or -1 for a default value. Acceptors accept new TCP/IP connections. If 0, then * the selector threads are used to accept connections. * @param selectors - * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. + * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. */ public ServerConnector( @Name("server") Server server, @@ -125,7 +123,7 @@ public class ServerConnector extends AbstractNetworkConnector * the number of acceptor threads to use, or -1 for a default value. Acceptors accept new TCP/IP connections. If 0, then * the selector threads are used to accept connections. * @param selectors - * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. + * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. * @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections. */ public ServerConnector( @@ -174,7 +172,7 @@ public class ServerConnector extends AbstractNetworkConnector * the number of acceptor threads to use, or -1 for a default value. Acceptors accept new TCP/IP connections. If 0, then * the selector threads are used to accept connections. * @param selectors - * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. + * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. */ public ServerConnector( @Name("server") Server server, @@ -214,7 +212,7 @@ public class ServerConnector extends AbstractNetworkConnector * the number of acceptor threads to use, or -1 for a default value. Acceptors accept new TCP/IP connections. If 0, then * the selector threads are used to accept connections. * @param selectors - * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. + * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress. * @param factories * Zero or more {@link ConnectionFactory} instances used to create and configure connections. */ @@ -260,6 +258,7 @@ public class ServerConnector extends AbstractNetworkConnector } /** + * @return the selector priority delta * @deprecated not implemented */ @Deprecated @@ -269,6 +268,7 @@ public class ServerConnector extends AbstractNetworkConnector } /** + * @param selectorPriorityDelta the selector priority delta * @deprecated not implemented */ @Deprecated @@ -342,7 +342,7 @@ public class ServerConnector extends AbstractNetworkConnector @Override public Future shutdown() { - // TODO shutdown all the connections + // shutdown all the connections return super.shutdown(); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java index cb0dabf0f78..a7f12fb513b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionIdManager.java @@ -42,7 +42,7 @@ public interface SessionIdManager extends LifeCycle /** * Remove session from the list of known sessions for a given ID. - * @param session + * @param session the session to remove */ public void removeSession(HttpSession session); @@ -53,8 +53,10 @@ public interface SessionIdManager extends LifeCycle public void invalidateAll(String id); /** - * @param request - * @param created + * Create a new Session ID. + * + * @param request the request with the sesion + * @param created the timestamp for when the session was created * @return the new session id */ public String newSessionId(HttpServletRequest request,long created); @@ -67,7 +69,7 @@ public interface SessionIdManager extends LifeCycle /* ------------------------------------------------------------ */ /** Get a cluster ID from a node ID. * Strip node identifier from a located session ID. - * @param nodeId + * @param nodeId the node id * @return the cluster id */ public String getClusterId(String nodeId); @@ -84,9 +86,9 @@ public interface SessionIdManager extends LifeCycle /* ------------------------------------------------------------ */ /** Change the existing session id. * - * @param oldClusterId - * @param oldNodeId - * @param request + * @param oldClusterId the old cluster id + * @param oldNodeId the old node id + * @param request the request containing the session */ public void renewSessionId(String oldClusterId, String oldNodeId, HttpServletRequest request); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java index 1b2b1d00caf..a2fda2ed62b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/SessionManager.java @@ -308,10 +308,10 @@ public interface SessionManager extends LifeCycle /* ------------------------------------------------------------ */ /** Change the existing session id. * - * @param oldClusterId - * @param oldNodeId - * @param newClusterId - * @param newNodeId + * @param oldClusterId the old cluster id + * @param oldNodeId the old node id + * @param newClusterId the new cluster id + * @param newNodeId the new node id */ public void renewSessionId(String oldClusterId, String oldNodeId, String newClusterId, String newNodeId); } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java index 3b71a745cae..198e5c4c25a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ShutdownMonitor.java @@ -259,7 +259,7 @@ public class ShutdownMonitor * Stop the registered lifecycles, optionally * calling destroy on them. * - * @param destroy + * @param destroy true if {@link Destroyable}'s should also be destroyed. */ public void stopLifeCycles (boolean destroy) { @@ -450,7 +450,7 @@ public class ShutdownMonitor } /** - * @param exitVm + * @param exitVm true to exit the VM on shutdown */ public void setExitVm(boolean exitVm) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java index 48026fd059d..e2c386eb03a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/UserIdentity.java @@ -23,13 +23,12 @@ import java.util.Map; import javax.security.auth.Subject; -/* ------------------------------------------------------------ */ -/** User object that encapsulates user identity and operations such as run-as-role actions, +/** + * User object that encapsulates user identity and operations such as run-as-role actions, * checking isUserInRole and getUserPrincipal. - * + *

            * Implementations of UserIdentity should be immutable so that they may be * cached by Authenticators and LoginServices. - * */ public interface UserIdentity { @@ -50,7 +49,7 @@ public interface UserIdentity * This call is used to satisfy authorization calls from * container code which will be using translated role names. * @param role A role name. - * @param scope + * @param scope the scope * @return True if the user can act in that role. */ boolean isUserInRole(String role, Scope scope); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index cecf30c2e26..a530b9a514d 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -191,18 +191,12 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu private volatile Availability _availability; /* ------------------------------------------------------------ */ - /** - * - */ public ContextHandler() { this((Context)null); } /* ------------------------------------------------------------ */ - /** - * - */ protected ContextHandler(Context context) { super(); @@ -215,9 +209,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } /* ------------------------------------------------------------ */ - /** - * - */ public ContextHandler(String contextPath) { this(); @@ -225,9 +216,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } /* ------------------------------------------------------------ */ - /** - * - */ public ContextHandler(HandlerContainer parent, String contextPath) { this(); @@ -568,6 +556,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Add a context event listeners. + * @param listener the event listener to add * * @see ServletContextListener * @see ServletContextAttributeListener @@ -597,6 +586,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Remove a context event listeners. + * @param listener the event listener to remove * * @see ServletContextListener * @see ServletContextAttributeListener @@ -624,7 +614,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /** * Apply any necessary restrictions on a programmatic added listener. * - * @param listener + * @param listener the programmatic listener to add */ protected void addProgrammaticListener (EventListener listener) { @@ -680,6 +670,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Set Available status. + * @param available true to set as enabled */ public void setAvailable(boolean available) { @@ -759,6 +750,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /** * Extensible startContext. this method is called from {@link ContextHandler#doStart()} instead of a call to super.doStart(). This allows derived classes to * insert additional handling (Eg configuration) before the call to super.doStart by this method will start contained handlers. + * @throws Exception if unable to start the context * * @see org.eclipse.jetty.server.handler.ContextHandler.Context */ @@ -1190,8 +1182,9 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /** * Check the target. Called by {@link #handle(String, Request, HttpServletRequest, HttpServletResponse)} when a target within a context is determined. If * the target is protected, 404 is returned. + * @param target the target to test + * @return true if target is a protected target */ - /* ------------------------------------------------------------ */ public boolean isProtectedTarget(String target) { if (target == null || _protectedTargets == null) @@ -1450,8 +1443,6 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu } /* ------------------------------------------------------------ */ - /** - */ public void setWelcomeFiles(String[] files) { _welcomeFiles = files; @@ -1502,7 +1493,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Set the maximum size of a form post, to protect against DOS attacks from large forms. - * @param maxSize + * @param maxSize the maximum size of the form content (in bytes) */ public void setMaxFormContentSize(int maxSize) { @@ -1518,7 +1509,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Set the maximum number of form Keys to protect against DOS attack from crafted hash keys. - * @param max + * @param max the maximum number of form keys */ public void setMaxFormKeys(int max) { @@ -1664,8 +1655,8 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** - * @param path - * @param resource + * @param path the path to check the alias for + * @param resource the resource * @return True if the alias is OK */ public boolean checkAlias(String path, Resource resource) @@ -1695,6 +1686,9 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Convert URL to Resource wrapper for {@link Resource#newResource(URL)} enables extensions to provide alternate resource implementations. + * @param url the url to convert to a Resource + * @return the Resource for that url + * @throws IOException if unable to create a Resource from the URL */ public Resource newResource(URL url) throws IOException { @@ -1704,6 +1698,9 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu /* ------------------------------------------------------------ */ /** * Convert URL to Resource wrapper for {@link Resource#newResource(URL)} enables extensions to provide alternate resource implementations. + * @param uri the URI to convert to a Resource + * @return the Resource for that URI + * @throws IOException if unable to create a Resource from the URL */ public Resource newResource(URI uri) throws IOException { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java index 994b64f211b..45676f27ff4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java @@ -234,6 +234,7 @@ public class ContextHandlerCollection extends HandlerCollection /* ------------------------------------------------------------ */ /** Add a context handler. * @param contextPath The context path to add + * @param resourceBase the base (root) Resource * @return the ContextHandler just added */ public ContextHandler addContext(String contextPath,String resourceBase) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java index 4b4aca767f3..4f39869c307 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerCollection.java @@ -35,14 +35,13 @@ import org.eclipse.jetty.util.annotation.ManagedAttribute; import org.eclipse.jetty.util.annotation.ManagedObject; /* ------------------------------------------------------------ */ -/** A collection of handlers. +/** + * A collection of handlers. *

            * The default implementations calls all handlers in list order, * regardless of the response status or exceptions. Derived implementation * may alter the order or the conditions of calling the contained * handlers. - *

            - * */ @ManagedObject("Handler of multiple handlers") public class HandlerCollection extends AbstractHandlerContainer diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java index 58e405d5ee1..3e1d0c769a8 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HandlerWrapper.java @@ -90,12 +90,16 @@ public class HandlerWrapper extends AbstractHandlerContainer } /* ------------------------------------------------------------ */ - /** Replace the current handler with another HandlerWrapper - * linked to the current handler. This is equivalent to:

            +    /** 
            +     * Replace the current handler with another HandlerWrapper
            +     * linked to the current handler.  
            +     * 

            + * This is equivalent to: + *

                  *   wrapper.setHandler(getHandler());
                  *   setHandler(wrapper);
                  * 
            - * @param wrapper + * @param wrapper the wrapper to insert */ public void insertHandler(HandlerWrapper wrapper) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java index b76761d586a..cdc1fc24f7e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IPAccessHandler.java @@ -57,12 +57,11 @@ import org.eclipse.jetty.util.log.Logger; * are always applied, so that even if an entry matches the white list, a black list * entry will override it. *

            - *

            * You can change white list policy setting whiteListByPath to true. In this mode a request will be white listed * IF it has a matching URL in the white list, otherwise the black list applies, e.g. in default mode when * whiteListByPath = false and wl = "127.0.0.1|/foo", /bar request from 127.0.0.1 will be blacklisted, * if whiteListByPath=true then not. - *

            + *

            * Internet addresses may be specified as absolute address or as a combination of * four octet wildcard specifications (a.b.c.d) that are defined as follows. *

            @@ -70,9 +69,9 @@ import org.eclipse.jetty.util.log.Logger; * nnn - an absolute value (0-255) * mmm-nnn - an inclusive range of absolute values, * with following shorthand notations: - * nnn- => nnn-255 - * -nnn => 0-nnn - * - => 0-255 + * nnn- => nnn-255 + * -nnn => 0-nnn + * - => 0-255 * a,b,... - a list of wildcard specifications *
            *

            diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java index b08f6dadc35..f0a8d3a7f85 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/IdleTimeoutHandler.java @@ -33,13 +33,13 @@ import org.eclipse.jetty.server.Request; * Handler to adjust the idle timeout of requests while dispatched. * Can be applied in jetty.xml with *

            - *   <Get id='handler' name='Handler'/>
            - *   <Set name='Handler'>
            - *     <New id='idleTimeoutHandler' class='org.eclipse.jetty.server.handler.IdleTimeoutHandler'>
            - *       <Set name='Handler'><Ref id='handler'/></Set>
            - *       <Set name='IdleTimeoutMs'>5000</Set>
            - *     </New>
            - *   </Set>
            + *   <Get id='handler' name='Handler'/>
            + *   <Set name='Handler'>
            + *     <New id='idleTimeoutHandler' class='org.eclipse.jetty.server.handler.IdleTimeoutHandler'>
            + *       <Set name='Handler'><Ref id='handler'/></Set>
            + *       <Set name='IdleTimeoutMs'>5000</Set>
            + *     </New>
            + *   </Set>
              * 
            */ public class IdleTimeoutHandler extends HandlerWrapper diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index 94d7cdebabc..e8157e9356f 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -598,9 +598,9 @@ public class ResourceHandler extends HandlerWrapper /** Set the response headers. * This method is called to set the response headers such as content type and content length. * May be extended to add additional headers. - * @param response - * @param resource - * @param mimeType + * @param response the http response + * @param resource the resource + * @param mimeType the mime type */ protected void doResponseHeaders(HttpServletResponse response, Resource resource, String mimeType) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java index dc1b88f8772..eae9c2b566e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ScopedHandler.java @@ -40,7 +40,7 @@ import org.eclipse.jetty.server.Request; * {@link #doHandle(String, Request, HttpServletRequest, HttpServletResponse)} method * is called on all contained handlers.

            * - *

            For example if Scoped handlers A, B & C were chained together, then + *

            For example if Scoped handlers A, B & C were chained together, then * the calling order would be:

            *
              * A.handle(...)
            @@ -52,7 +52,7 @@ import org.eclipse.jetty.server.Request;
              *              C.doHandle(...)
              * 
            * - *

            If non scoped handler X was in the chained A, B, X & C, then + *

            If non scoped handler X was in the chained A, B, X & C, then * the calling order would be:

            *
              * A.handle(...)
            diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java
            index 00bd5d76f9d..dd4c8805dff 100644
            --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java
            +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipHandler.java
            @@ -46,12 +46,11 @@ import org.eclipse.jetty.util.log.Log;
             import org.eclipse.jetty.util.log.Logger;
             
             
            -/* ------------------------------------------------------------ */
             /**
              * A Handler that can dynamically GZIP compress responses.   Unlike 
              * previous and 3rd party GzipFilters, this mechanism works with asynchronously
              * generated responses and does not need to wrap the response or it's output
            - * stream.  Instead it uses the efficient {@link HttpOutput.Interceptor} mechanism.
            + * stream.  Instead it uses the efficient {@link org.eclipse.jetty.server.HttpOutput.Interceptor} mechanism.
              * 

            * The handler can be applied to the entire server (a gzip.mod is included in * the distribution) or it may be applied to individual contexts. diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java index c6e4b2b49d1..06281e327cc 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSession.java @@ -98,6 +98,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI /* ------------------------------------------------------------- */ /** * asserts that the session is valid + * @throws IllegalStateException if the sesion is invalid */ protected void checkValid() throws IllegalStateException { @@ -107,8 +108,8 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI /* ------------------------------------------------------------- */ /** Check to see if session has expired as at the time given. - * @param time - * @return + * @param time the time in milliseconds + * @return true if expired */ protected boolean checkExpiry(long time) { @@ -470,11 +471,12 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI /* ------------------------------------------------------------ */ /** - * @param name - * @param value + * @param name the name of the attribute + * @param value the value of the attribute + * @return true if attribute changed * @deprecated use changeAttribute(String,Object) instead - * @return */ + @Deprecated protected boolean updateAttribute (String name, Object value) { Object old=null; @@ -504,9 +506,9 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI * in the session. The appropriate session attribute listeners are * also called. * - * @param name - * @param value - * @return + * @param name the name of the attribute + * @param value the value of the attribute + * @return the old value for the attribute */ protected Object changeAttribute (String name, Object value) { @@ -566,7 +568,11 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI } /* ------------------------------------------------------------- */ - /** If value implements HttpSessionBindingListener, call valueBound() */ + /** + * Bind value if value implements {@link HttpSessionBindingListener} (calls {@link HttpSessionBindingListener#valueBound(HttpSessionBindingEvent)}) + * @param name the name with which the object is bound or unbound + * @param value the bound value + */ public void bindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) @@ -607,7 +613,11 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI } /* ------------------------------------------------------------- */ - /** If value implements HttpSessionBindingListener, call valueUnbound() */ + /** + * Unbind value if value implements {@link HttpSessionBindingListener} (calls {@link HttpSessionBindingListener#valueUnbound(HttpSessionBindingEvent)}) + * @param name the name with which the object is bound or unbound + * @param value the bound value + */ public void unbindValue(java.lang.String name, Object value) { if (value!=null&&value instanceof HttpSessionBindingListener) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java index ba55a2e7eac..32cff50cf96 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionIdManager.java @@ -67,13 +67,13 @@ public abstract class AbstractSessionIdManager extends AbstractLifeCycle impleme /* ------------------------------------------------------------ */ /** - * Set the workname. If set, the workername is dot appended to the session + * Set the workername. If set, the workername is dot appended to the session * ID and can be used to assist session affinity in a load balancer. * A worker name starting with $ is used as a request attribute name to * lookup the worker name that can be dynamically set by a request - * customiser. + * Customizer. * - * @param workerName + * @param workerName the name of the worker */ public void setWorkerName(String workerName) { @@ -244,8 +244,8 @@ public abstract class AbstractSessionIdManager extends AbstractLifeCycle impleme /** Get the session ID with any worker ID. * - * @param clusterId - * @param request + * @param clusterId the cluster id + * @param request the request * @return sessionId plus any worker ID. */ @Override diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java index babe6c384ff..56e847b803a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/AbstractSessionManager.java @@ -53,15 +53,12 @@ import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.statistic.CounterStatistic; import org.eclipse.jetty.util.statistic.SampleStatistic; -/* ------------------------------------------------------------ */ /** - * An Abstract implementation of SessionManager. The partial implementation of - * SessionManager interface provides the majority of the handling required to - * implement a SessionManager. Concrete implementations of SessionManager based - * on AbstractSessionManager need only implement the newSession method to return - * a specialised version of the Session inner class that provides an attribute - * Map. + * An Abstract implementation of SessionManager. *

            + * The partial implementation of SessionManager interface provides the majority of the handling required to implement a + * SessionManager. Concrete implementations of SessionManager based on AbstractSessionManager need only implement the + * newSession method to return a specialized version of the Session inner class that provides an attribute Map. */ @SuppressWarnings("deprecation") @ManagedObject("Abstract Session Manager") @@ -405,6 +402,7 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen /** * HTTPS request. Can be overridden by setting SessionCookieConfig.setSecure(true), * in which case the session cookie will be marked as secure on both HTTPS and HTTP. + * @param secureRequestOnly true to set Session Cookie Config as secure */ public void setSecureRequestOnly(boolean secureRequestOnly) { @@ -423,7 +421,7 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen * A sessioncookie is marked as secure IFF any of the following conditions are true: *

              *
            1. SessionCookieConfig.setSecure == true
            2. - *
            3. SessionCookieConfig.setSecure == false && _secureRequestOnly==true && request is HTTPS
            4. + *
            5. SessionCookieConfig.setSecure == false && _secureRequestOnly==true && request is HTTPS
            6. *
            * According to SessionCookieConfig javadoc, case 1 can be used when: * "... even though the request that initiated the session came over HTTP, @@ -431,14 +429,16 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen * SSL offloading load balancer. In this case, the traffic between the client * and the load balancer will be over HTTPS, whereas the traffic between the * load balancer and the web container will be over HTTP." - * + *

            * For case 2, you can use _secureRequestOnly to determine if you want the - * Servlet Spec 3.0 default behaviour when SessionCookieConfig.setSecure==false, + * Servlet Spec 3.0 default behavior when SessionCookieConfig.setSecure==false, * which is: + * * "they shall be marked as secure only if the request that initiated the * corresponding session was also secure" - * - * The default for _secureRequestOnly is true, which gives the above behaviour. If + * + *

            + * The default for _secureRequestOnly is true, which gives the above behavior. If * you set it to false, then a session cookie is NEVER marked as secure, even if * the initiating request was secure. * @@ -612,9 +612,6 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen } /* ------------------------------------------------------------ */ - /** - * @param seconds - */ @Override public void setMaxInactiveInterval(int seconds) { @@ -669,6 +666,8 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen /** * Add the session Registers the session with this manager and registers the * session ID with the sessionIDManager; + * @param session the session + * @param created true if session was created */ protected void addSession(AbstractSession session, boolean created) { @@ -701,7 +700,7 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen /** * Prepare sessions for session manager shutdown * - * @throws Exception + * @throws Exception if unable to shutdown sesssions */ protected abstract void shutdownSessions() throws Exception; @@ -709,7 +708,7 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen /* ------------------------------------------------------------ */ /** * Create a new session instance - * @param request + * @param request the request to build the session from * @return the new session */ protected abstract AbstractSession newSession(HttpServletRequest request); @@ -746,10 +745,12 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen } /* ------------------------------------------------------------ */ - /** Remove session from manager + /** + * Remove session from manager * @param session The session to remove * @param invalidate True if {@link HttpSessionListener#sessionDestroyed(HttpSessionEvent)} and * {@link SessionIdManager#invalidateAll(String)} should be called. + * @return if the session was removed */ public boolean removeSession(AbstractSession session, boolean invalidate) { diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java index 07b40373907..da34b3866e3 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionIdManager.java @@ -64,6 +64,7 @@ public class HashSessionIdManager extends AbstractSessionIdManager /* ------------------------------------------------------------ */ /** + * @param id the id of the session * @return Collection of Sessions for the passed session ID */ public Collection getSession(String id) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java index 8e8e365415b..b89c7f90a22 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/HashedSession.java @@ -245,6 +245,7 @@ public class HashedSession extends MemSession * * The session is idled by persisting it, then clearing the session values attribute map and finally setting * it to an idled state. + * @throws Exception if unable to save session */ public synchronized void idle() throws Exception diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java index 68cc12e25ff..99108d86d7b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionIdManager.java @@ -530,7 +530,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager * Convert a camel case identifier into either upper or lower * depending on the way the db stores identifiers. * - * @param identifier + * @param identifier the raw identifier * @return the converted identifier */ public String convertIdentifier (String identifier) @@ -629,8 +629,8 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager /** * Configure jdbc connection information via a jdbc Driver * - * @param driverClassName - * @param connectionUrl + * @param driverClassName the driver classname + * @param connectionUrl the driver connection url */ public void setDriverInfo (String driverClassName, String connectionUrl) { @@ -641,8 +641,8 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager /** * Configure jdbc connection information via a jdbc Driver * - * @param driverClass - * @param connectionUrl + * @param driverClass the driver class + * @param connectionUrl the driver connection url */ public void setDriverInfo (Driver driverClass, String connectionUrl) { @@ -682,9 +682,10 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager } /** - * @param name + * @param name the name of the blob * @deprecated see DbAdaptor.setBlobType */ + @Deprecated public void setBlobType (String name) { _dbAdaptor.setBlobType(name); @@ -704,27 +705,30 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager } /** - * @return + * @return the blob type * @deprecated see DbAdaptor.getBlobType */ + @Deprecated public String getBlobType () { return _dbAdaptor.getBlobType(); } /** - * @return + * @return the long type * @deprecated see DbAdaptor.getLogType */ + @Deprecated public String getLongType() { return _dbAdaptor.getLongType(); } /** - * @param longType + * @param longType the long type * @deprecated see DbAdaptor.setLongType */ + @Deprecated public void setLongType(String longType) { _dbAdaptor.setLongType(longType); @@ -1026,7 +1030,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager * Get a connection from the driver or datasource. * * @return the connection for the datasource - * @throws SQLException + * @throws SQLException if unable to get the connection */ protected Connection getConnection () throws SQLException @@ -1036,11 +1040,6 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager else return DriverManager.getConnection(_connectionUrl); } - - - - - /** * Set up the tables in the database diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java index be3c55a99c1..59cefbdc673 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionManager.java @@ -48,23 +48,24 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; /** - * JDBCSessionManager - * + * JDBCSessionManager. + *

            * SessionManager that persists sessions to a database to enable clustering. - * + *

            * Session data is persisted to the JettySessions table: - * - * rowId (unique in cluster: webapp name/path + virtualhost + sessionId) - * contextPath (of the context owning the session) - * sessionId (unique in a context) - * lastNode (name of node last handled session) - * accessTime (time in milliseconds session was accessed) - * lastAccessTime (previous time in milliseconds session was accessed) - * createTime (time in milliseconds session created) - * cookieTime (time in milliseconds session cookie created) - * lastSavedTime (last time in milliseconds session access times were saved) - * expiryTime (time in milliseconds that the session is due to expire) - * map (attribute map) + *

            + *
            rowId
            (unique in cluster: webapp name/path + virtualhost + sessionId)
            + *
            contextPath
            (of the context owning the session)
            + *
            sessionId
            (unique in a context)
            + *
            lastNode
            (name of node last handled session)
            + *
            accessTime
            (time in milliseconds session was accessed)
            + *
            lastAccessTime
            (previous time in milliseconds session was accessed)
            + *
            createTime
            (time in milliseconds session created)
            + *
            cookieTime
            (time in milliseconds session cookie created)
            + *
            lastSavedTime
            (last time in milliseconds session access times were saved)
            + *
            expiryTime
            (time in milliseconds that the session is due to expire)
            + *
            map
            (attribute map)
            + *
            * * As an optimization, to prevent thrashing the database, we do not persist * the accessTime and lastAccessTime every time the session is accessed. Rather, @@ -140,7 +141,7 @@ public class JDBCSessionManager extends AbstractSessionManager /** * Session from a request. * - * @param request + * @param request the request */ protected Session (HttpServletRequest request) { @@ -155,10 +156,11 @@ public class JDBCSessionManager extends AbstractSessionManager /** * Session restored from database - * @param sessionId - * @param rowId - * @param created - * @param accessed + * @param sessionId the session id + * @param rowId the row id + * @param created the created timestamp + * @param accessed the access timestamp + * @param maxInterval the max inactive interval (in seconds) */ protected Session (String sessionId, String rowId, long created, long accessed, long maxInterval) { @@ -407,7 +409,7 @@ public class JDBCSessionManager extends AbstractSessionManager * If any session attribute does change, then the attributes and * the accessed time are persisted. * - * @param sec + * @param sec the save interval in seconds */ public void setSaveInterval (long sec) { @@ -430,7 +432,7 @@ public class JDBCSessionManager extends AbstractSessionManager * This could be used eg with a JMS backplane to notify nodes * that the session has changed and to delete the session from * the node's cache, and re-read it from the database. - * @param session + * @param session the session to invalidate */ public void cacheInvalidate (Session session) { @@ -693,7 +695,7 @@ public class JDBCSessionManager extends AbstractSessionManager /** * Invalidate a session. * - * @param idInCluster + * @param idInCluster the id in the cluster */ protected void invalidateSession (String idInCluster) { @@ -768,15 +770,6 @@ public class JDBCSessionManager extends AbstractSessionManager return new Session(request); } - - /** - * @param sessionId - * @param rowId - * @param created - * @param accessed - * @param maxInterval - * @return - */ protected AbstractSession newSession (String sessionId, String rowId, long created, long accessed, long maxInterval) { return new Session(sessionId, rowId, created, accessed, maxInterval); @@ -810,7 +803,8 @@ public class JDBCSessionManager extends AbstractSessionManager * Expire any Sessions we have in memory matching the list of * expired Session ids. * - * @param sessionIds + * @param sessionIds the session ids to expire + * @return the set of successfully expired ids */ protected Set expire (Set sessionIds) { @@ -875,9 +869,11 @@ public class JDBCSessionManager extends AbstractSessionManager /** * Load a session from the database - * @param id + * @param id the id + * @param canonicalContextPath the canonical context path + * @param vhost the virtual host * @return the session data that was loaded - * @throws Exception + * @throws Exception if unable to load the session */ protected Session loadSession (final String id, final String canonicalContextPath, final String vhost) throws Exception @@ -957,8 +953,8 @@ public class JDBCSessionManager extends AbstractSessionManager /** * Insert a session into the database. * - * @param session - * @throws Exception + * @param session the session + * @throws Exception if unable to store the session */ protected void storeSession (Session session) throws Exception @@ -1010,7 +1006,7 @@ public class JDBCSessionManager extends AbstractSessionManager * Update data on an existing persisted session. * * @param data the session - * @throws Exception + * @throws Exception if unable to update the session */ protected void updateSession (Session data) throws Exception @@ -1053,7 +1049,7 @@ public class JDBCSessionManager extends AbstractSessionManager * Update the node on which the session was last seen to be my node. * * @param data the session - * @throws Exception + * @throws Exception if unable to update the session node */ protected void updateSessionNode (Session data) throws Exception @@ -1107,8 +1103,8 @@ public class JDBCSessionManager extends AbstractSessionManager * Delete a session from the database. Should only be called * when the session has been invalidated. * - * @param data - * @throws Exception + * @param data the session data + * @throws Exception if unable to delete the session */ protected void deleteSession (Session data) throws Exception diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java index dbbe4d6bd22..d7c1416a07a 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/SessionHandler.java @@ -228,8 +228,8 @@ public class SessionHandler extends ScopedHandler /** * Look for a requested session ID in cookies and URI parameters * - * @param baseRequest - * @param request + * @param baseRequest the request to check + * @param request the request to check */ protected void checkRequestedSessionId(Request baseRequest, HttpServletRequest request) { @@ -321,9 +321,6 @@ public class SessionHandler extends ScopedHandler } /* ------------------------------------------------------------ */ - /** - * @param listener - */ public void addEventListener(EventListener listener) { if (_sessionManager != null) @@ -331,9 +328,6 @@ public class SessionHandler extends ScopedHandler } /* ------------------------------------------------------------ */ - /** - * @param listener - */ public void removeEventListener(EventListener listener) { if (_sessionManager != null) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java index 8251237527e..ff80487c3ca 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/HttpConnectionTest.java @@ -56,9 +56,6 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -/** - * - */ public class HttpConnectionTest { private Server server; @@ -686,6 +683,7 @@ public class HttpConnectionTest /** * Creates a request header over 1k in size, by creating a single header entry with an huge value. + * @throws Exception if test failure */ @Test public void testOversizedBuffer() throws Exception @@ -714,6 +712,7 @@ public class HttpConnectionTest /** * Creates a request header with over 1000 entries. + * @throws Exception if test failure */ @Test public void testExcessiveHeader() throws Exception diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/RequestLogHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/RequestLogHandlerTest.java index 4ab32faf785..92c18ed945e 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/RequestLogHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/RequestLogHandlerTest.java @@ -376,6 +376,7 @@ public class RequestLogHandlerTest /** * Test a RequestLogHandler at the end of a HandlerCollection. all other configuration on server at defaults. + * @throws Exception if test failure */ @Test(timeout = 4000) public void testLogHandlerCollection() throws Exception @@ -439,6 +440,7 @@ public class RequestLogHandlerTest /** * Test a RequestLogHandler at the end of a HandlerCollection and also with the default ErrorHandler as server bean in place. + * @throws Exception if test failure */ @Test(timeout = 4000) public void testLogHandlerCollection_ErrorHandler_ServerBean() throws Exception @@ -505,6 +507,7 @@ public class RequestLogHandlerTest /** * Test a RequestLogHandler at the end of a HandlerCollection and also with the ErrorHandler in place. + * @throws Exception if test failure */ @Test(timeout=4000) public void testLogHandlerCollection_AltErrorHandler() throws Exception @@ -578,6 +581,7 @@ public class RequestLogHandlerTest /** * Test a RequestLogHandler at the end of a HandlerCollection and also with the ErrorHandler in place. + * @throws Exception if test failure */ @Test(timeout=4000) public void testLogHandlerCollection_OKErrorHandler() throws Exception @@ -651,6 +655,7 @@ public class RequestLogHandlerTest /** * Test a RequestLogHandler at the end of a HandlerCollection and also with the ErrorHandler in place. + * @throws Exception if test failure */ @Test(timeout=4000) public void testLogHandlerCollection_DispatchErrorHandler() throws Exception diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java index e3322e51173..0004a15b3a0 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/session/SessionCookieTest.java @@ -31,24 +31,14 @@ import javax.servlet.http.HttpSession; import org.eclipse.jetty.http.HttpCookie; import org.junit.Test; + /** * SessionCookieTest - * - * */ public class SessionCookieTest { - public class MockSession extends AbstractSession { - - - /** - * @param abstractSessionManager - * @param created - * @param accessed - * @param clusterId - */ protected MockSession(AbstractSessionManager abstractSessionManager, long created, long accessed, String clusterId) { super(abstractSessionManager, created, accessed, clusterId); @@ -72,9 +62,6 @@ public class SessionCookieTest return null; } - /** - * @see javax.servlet.http.HttpSession#getValueNames() - */ @Override public String[] getValueNames() {