464727 - Update Javadoc for Java 8 DocLint

+ Fixing javadoc in jetty-server
This commit is contained in:
Joakim Erdfelt 2015-04-21 13:58:42 -07:00
parent 9983f4680e
commit 5bdfd53e9c
43 changed files with 305 additions and 284 deletions

View File

@ -53,7 +53,7 @@ import org.eclipse.jetty.util.thread.Scheduler;
/**
* <p>An abstract implementation of {@link Connector} that provides a {@link ConnectionFactory} mechanism
* for creating {@link Connection} instances for various protocols (HTTP, SSL, etc).</p>
* for creating {@link org.eclipse.jetty.io.Connection} instances for various protocols (HTTP, SSL, etc).</p>
*
* <h2>Connector Services</h2>
* 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.
*
* <h4>Configuring Connection Factories</h4>
* <h2>Configuring Connection Factories</h2>
* 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.
*
* <h4>Connection Factory Operation</h4>
* {@link ConnectionFactory}s may simply create a {@link Connection} instance to support a specific
* <h2>Connection Factory Operation</h2>
* {@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.
* <p>
* {@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.
* <p>
* {@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.
* <p>
* <h2>Acceptors</h2>
* 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:
* <nl>
* <li>block waiting for new connections
* <li>accept the connection (eg socket accept)
* <li>perform any configuration of the connection (eg. socket linger times)
* <ol>
* <li>block waiting for new connections</li>
* <li>accept the connection (eg socket accept)</li>
* <li>perform any configuration of the connection (eg. socket linger times)</li>
* <li>call the {@link #getDefaultConnectionFactory()} {@link ConnectionFactory#newConnection(Connector, org.eclipse.jetty.io.EndPoint)}
* method to create a new Connection instance.
* </nl>
* method to create a new Connection instance.</li>
* </ol>
* 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</p>
* @param acceptorPriorityDelta
* @param acceptorPriorityDelta the acceptor priority delta
*/
public void setAcceptorPriorityDelta(int acceptorPriorityDelta)
{

View File

@ -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;

View File

@ -24,14 +24,12 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/* ------------------------------------------------------------ */
/** The Authentication state of a request.
* <p>
* 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);

View File

@ -28,12 +28,14 @@ import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
/**
* <p>A Factory to create {@link Connection} instances for {@link Connector}s.</p>
* <p>A Connection factory is responsible for instantiating and configuring a {@link Connection} instance
* to handle an {@link EndPoint} accepted by a {@link Connector}.</p>
* A Factory to create {@link Connection} instances for {@link Connector}s.
* <p>
* A Connection factory is responsible for instantiating and configuring a {@link Connection} instance
* to handle an {@link EndPoint} accepted by a {@link Connector}.
* <p>
* A ConnectionFactory has a protocol name that represents the protocol of the Connections
* created. Example of protocol names include:<dl>
* created. Example of protocol names include:
* <dl>
* <dt>http</dt><dd>Creates a HTTP connection that can handle multiple versions of HTTP from 0.9 to 1.1</dd>
* <dt>h2</dt><dd>Creates a HTTP/2 connection that handles the HTTP/2 protocol</dd>
* <dt>SSL-XYZ</dt><dd>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.

View File

@ -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);

View File

@ -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.
*
* <p>
* A Handler instance is required by a {@link Server} to handle incoming
* HTTP requests. A Handler may: <ul>
* HTTP requests.
* <p>
* A Handler may:
* <ul>
* <li>Completely generate the HTTP Response</li>
* <li>Examine/modify the request and call another Handler (see {@link HandlerWrapper}).
* <li>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
* <code>{@link HttpConnection#getCurrentConnection()}.{@link HttpConnection#getHttpChannel() getHttpChannel()}.{@link HttpChannel#getRequest() getRequest()}</code>
* 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
* <code>{@link HttpConnection#getCurrentConnection()}.{@link HttpConnection#getHttpChannel() getHttpChannel()}.{@link HttpChannel#getResponse() getResponse()}</code>
* 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();
}

View File

@ -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 <T> the type of handler
*/
public <T extends Handler> T getChildHandlerByClass(Class<T> byclass);
}

View File

@ -147,6 +147,7 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
* Get the idle timeout.
* <p>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.
* <p>This is implemented as a call to {@link EndPoint#setIdleTimeout(long), but may be
* <p>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

View File

@ -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()
{

View File

@ -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()
{

View File

@ -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
* <p>
* 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()
{

View File

@ -37,11 +37,14 @@ import org.eclipse.jetty.util.thread.Scheduler;
import org.eclipse.jetty.util.thread.ThreadPool;
/* ------------------------------------------------------------ */
/** A monitor for low resources
* <p>An instance of this class will monitor all the connectors of a server (or a set of connectors
/**
* A monitor for low resources
* <p>
* 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:<ul>
* <p>
* Low resources can be detected by:
* <ul>
* <li>{@link ThreadPool#isLowOnThreads()} if {@link Connector#getExecutor()} is
* an instance of {@link ThreadPool} and {@link #setMonitorThreads(boolean)} is true.<li>
* <li>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;
* <li>If {@link #setMaxConnections(int)} is non zero then low resources is dected if the total number
* of connections exceeds {@link #getMaxConnections()}</li>
* </ul>
* </p>
* <p>Once low resources state is detected, the cause is logged and all existing connections returned
* <p>
* 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()}.
* </p>
*/
@ManagedObject ("Monitor for low resource conditions and activate a low resource mode if detected")
public class LowResourceMonitor extends AbstractLifeCycle

View File

@ -35,11 +35,12 @@ import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */
/** ConnectionFactory for the PROXY Protocol.
/**
* ConnectionFactory for the PROXY Protocol.
* <p>This factory can be placed in front of any other connection factory
* to process the proxy line before the normal protocol handling</p>
*
* @see http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
* @see <a href="http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt">http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt</a>
*/
public class ProxyConnectionFactory extends AbstractConnectionFactory
{

View File

@ -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.
* <p>
* A PushBuilder is obtained by calling {@link Request#getPushBuilder()}
* which creates an initialises the builder as follows:<ul>
* which creates an initializes the builder as follows:
* <ul>
* <li> 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.</li>
* <li>The method is initialised to "GET"</li>
* <li>The method is initialized to "GET"</li>
* <li>The requests headers are added to the Builder, except for:<ul>
* <li>Conditional headers (eg. If-Modified-Since)
* <li>Range headers
* <li>Expect headers
* <li>Authorisation headers
* <li>Authorization headers
* <li>Referrer headers
* </ul></li>
* <li>If the request was Authenticated, an Authorisation header will
* <li>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</li>
* <li>The query string from {@link ServletRequest#getQueryString()}
* <li>The {@link ServletRequest#getRequestedSessionId()} value, unless at the time
* of the call {@link ServletRequest#getSession(boolean)}
* Authorization for the pushed request</li>
* <li>The query string from {@link HttpServletRequest#getQueryString()}
* <li>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</li>
* <li>The Referer header will be set to {@link ServletRequest#getRequestURL()}
* plus any {@link ServletRequest#getQueryString()} </li>
* <li>The Referer header will be set to {@link HttpServletRequest#getRequestURL()}
* plus any {@link HttpServletRequest#getQueryString()} </li>
* <li>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 &lt;=0, in which
* case the Cookie will be removed from the builder.</li>
* <li>If this request has has the conditional headers If-Modified-Since or
* If-None-Match then the {@link #isConditional()} header is set to true.</li>
* </ul>
* <p>A PushBuilder can be customised by chained calls to mutator methods before the
* <p>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);

View File

@ -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.
* <p>
@ -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()} </li>
* <li>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 &lt;=0, in which
* case the Cookie will be removed from the builder.</li>
* <li>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.
* <p>Also supports jetty specific attributes to gain access to Jetty APIs:
* <p>
* Also supports jetty specific attributes to gain access to Jetty APIs:
* <dl>
* <dt>org.eclipse.jetty.server.Server</dt><dd>The Jetty Server instance</dd>
* <dt>org.eclipse.jetty.server.HttpChannel</dt><dd>The HttpChannel for this request</dd>
@ -532,7 +530,6 @@ public class Request implements HttpServletRequest
* </dl>
* While these attributes may look like security problems, they are exposing nothing that is not already
* available via reflection from a Request instance.
* </p>
* @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)
{

View File

@ -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)

View File

@ -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 &gt; 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 <code>Location</code> headers
* @throws IOException if unable to send the redirect
*/
public void sendRedirect(int code, String location) throws IOException
{

View File

@ -110,8 +110,11 @@ public class Server extends HandlerWrapper implements Attributes
}
/* ------------------------------------------------------------ */
/** Convenience constructor
/**
* Convenience constructor
* <p>
* 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)
{

View File

@ -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.
* <p>
* <h2>Connection Factories</h2>
* 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.
* <p>
* <h2>Selectors</h2>
* 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 &lt;=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 &lt;=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 &lt;=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 &lt;=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<Void> shutdown()
{
// TODO shutdown all the connections
// shutdown all the connections
return super.shutdown();
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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.
*
* <p>
* 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);

View File

@ -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
{

View File

@ -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)

View File

@ -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.
* <p>
* 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.
* <p>
*
*/
@ManagedObject("Handler of multiple handlers")
public class HandlerCollection extends AbstractHandlerContainer

View File

@ -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:<pre>
/**
* Replace the current handler with another HandlerWrapper
* linked to the current handler.
* <p>
* This is equivalent to:
* <pre>
* wrapper.setHandler(getHandler());
* setHandler(wrapper);
* </pre>
* @param wrapper
* @param wrapper the wrapper to insert
*/
public void insertHandler(HandlerWrapper wrapper)
{

View File

@ -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.
* <p>
* <p>
* 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.
* </p>
* <p>
* 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.
* </p>
@ -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- =&gt; nnn-255
* -nnn =&gt; 0-nnn
* - =&gt; 0-255
* a,b,... - a list of wildcard specifications
* </pre>
* <p>

View File

@ -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
* <pre>
* &lt;Get id='handler' name='Handler'/>
* &lt;Set name='Handler'>
* &lt;New id='idleTimeoutHandler' class='org.eclipse.jetty.server.handler.IdleTimeoutHandler'>
* &lt;Set name='Handler'>&lt;Ref id='handler'/>&lt;/Set>
* &lt;Set name='IdleTimeoutMs'>5000&lt;/Set>
* &lt;/New>
* &lt;/Set>
* &lt;Get id='handler' name='Handler'/&gt;
* &lt;Set name='Handler'&gt;
* &lt;New id='idleTimeoutHandler' class='org.eclipse.jetty.server.handler.IdleTimeoutHandler'&gt;
* &lt;Set name='Handler'&gt;&lt;Ref id='handler'/&gt;&lt;/Set&gt;
* &lt;Set name='IdleTimeoutMs'&gt;5000&lt;/Set&gt;
* &lt;/New&gt;
* &lt;/Set&gt;
* </pre>
*/
public class IdleTimeoutHandler extends HandlerWrapper

View File

@ -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)
{

View File

@ -40,7 +40,7 @@ import org.eclipse.jetty.server.Request;
* {@link #doHandle(String, Request, HttpServletRequest, HttpServletResponse)} method
* is called on all contained handlers.</p>
*
* <p>For example if Scoped handlers A, B & C were chained together, then
* <p>For example if Scoped handlers A, B &amp; C were chained together, then
* the calling order would be:</p>
* <pre>
* A.handle(...)
@ -52,7 +52,7 @@ import org.eclipse.jetty.server.Request;
* C.doHandle(...)
* </pre>
*
* <p>If non scoped handler X was in the chained A, B, X & C, then
* <p>If non scoped handler X was in the chained A, B, X &amp; C, then
* the calling order would be:</p>
* <pre>
* A.handle(...)

View File

@ -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.
* <p>
* 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.

View File

@ -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)

View File

@ -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

View File

@ -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.
* <p>
* 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:
* <ol>
* <li>SessionCookieConfig.setSecure == true</li>
* <li>SessionCookieConfig.setSecure == false && _secureRequestOnly==true && request is HTTPS</li>
* <li>SessionCookieConfig.setSecure == false &amp;&amp; _secureRequestOnly==true &amp;&amp; request is HTTPS</li>
* </ol>
* 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."
*
* <p>
* 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:
* <cite>
* "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
* </cite>
* <p>
* 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)
{

View File

@ -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<HttpSession> getSession(String id)

View File

@ -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

View File

@ -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

View File

@ -48,23 +48,24 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/**
* JDBCSessionManager
*
* JDBCSessionManager.
* <p>
* SessionManager that persists sessions to a database to enable clustering.
*
* <p>
* 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)
* <dl>
* <dt>rowId</dt><dd>(unique in cluster: webapp name/path + virtualhost + sessionId)</dd>
* <dt>contextPath</dt><dd>(of the context owning the session)</dd>
* <dt>sessionId</dt><dd>(unique in a context)</dd>
* <dt>lastNode</dt><dd>(name of node last handled session)</dd>
* <dt>accessTime</dt><dd>(time in milliseconds session was accessed)</dd>
* <dt>lastAccessTime</dt><dd>(previous time in milliseconds session was accessed)</dd>
* <dt>createTime</dt><dd>(time in milliseconds session created)</dd>
* <dt>cookieTime</dt><dd>(time in milliseconds session cookie created)</dd>
* <dt>lastSavedTime</dt><dd>(last time in milliseconds session access times were saved)</dd>
* <dt>expiryTime</dt><dd>(time in milliseconds that the session is due to expire)</dd>
* <dt>map</dt><dd>(attribute map)</dd>
* </dl>
*
* 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<String> expire (Set<String> 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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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()
{