numerous code cleanups

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1014 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-10-26 07:48:39 +00:00
parent a24f48c113
commit 227fb5abec
234 changed files with 854 additions and 243 deletions

View File

@ -35,6 +35,7 @@ public class HelloServlet extends HttpServlet
greeting = hi;
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");

View File

@ -15,9 +15,6 @@ package org.eclipse.jetty.embedded;
import java.lang.management.ManagementFactory;
import javax.management.MBeanConstructorInfo;
import javax.management.MBeanServer;
import org.eclipse.jetty.deploy.ContextDeployer;
import org.eclipse.jetty.deploy.WebAppDeployer;
import org.eclipse.jetty.jmx.MBeanContainer;

View File

@ -71,6 +71,7 @@ public class ManyHandlers
Handler param = new ParamHandler();
HandlerWrapper wrapper = new HandlerWrapper()
{
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException,
ServletException
{

View File

@ -46,6 +46,7 @@ public class MinimalServlets
public static class HelloServlet extends HttpServlet
{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");

View File

@ -52,16 +52,19 @@ public class Ajp13Connection extends HttpConnection
((Ajp13Request)_request).setConnection(this);
}
@Override
public boolean isConfidential(Request request)
{
return ((Ajp13Request) request).isSslSecure();
}
@Override
public boolean isIntegral(Request request)
{
return ((Ajp13Request) request).isSslSecure();
}
@Override
public ServletInputStream getInputStream()
{
if (_in == null)

View File

@ -114,6 +114,7 @@ public class Ajp13Generator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public void reset(boolean returnBuffers)
{
super.reset(returnBuffers);
@ -290,6 +291,7 @@ public class Ajp13Generator extends AbstractGenerator
* @return the available space in the buffer.
* @throws IOException
*/
@Override
public int prepareUncheckedAddContent() throws IOException
{
if (_noContent)
@ -327,6 +329,7 @@ public class Ajp13Generator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException
{
if (_state != STATE_HEADER)
@ -438,6 +441,7 @@ public class Ajp13Generator extends AbstractGenerator
*
* @throws IOException
*/
@Override
public void complete() throws IOException
{
if (_state == STATE_END)
@ -455,6 +459,7 @@ public class Ajp13Generator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public long flushBuffer() throws IOException
{
try
@ -699,6 +704,7 @@ public class Ajp13Generator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public boolean isComplete()
{
return !_expectMore && _state == STATE_END;

View File

@ -300,7 +300,7 @@ public class Ajp13Parser implements Parser
_handler.startForwardRequest();
break;
case Ajp13Packet.CPING_REQUEST_ORDINAL:
((Ajp13Generator) _generator).sendCPong();
(_generator).sendCPong();
if(_header != null)
{
@ -577,7 +577,7 @@ public class Ajp13Parser implements Parser
remaining=_buffer.length();
}
chunk=Ajp13RequestPacket.get(_buffer,(int)remaining);
chunk=Ajp13RequestPacket.get(_buffer,remaining);
_contentPosition+=chunk.length();
_chunkPosition+=chunk.length();
_contentView.update(chunk);
@ -796,6 +796,7 @@ public class Ajp13Parser implements Parser
}
/* ------------------------------------------------------------ */
@Override
public int read() throws IOException
{
int c = -1;
@ -808,6 +809,7 @@ public class Ajp13Parser implements Parser
/*
* @see java.io.InputStream#read(byte[], int, int)
*/
@Override
public int read(byte[] b, int off, int len) throws IOException
{
int l = -1;

View File

@ -47,6 +47,7 @@ public class Ajp13Request extends Request
}
/* ------------------------------------------------------------ */
@Override
public String getRemoteUser()
{
if(_remoteUser != null)
@ -55,6 +56,7 @@ public class Ajp13Request extends Request
}
/* ------------------------------------------------------------ */
@Override
public String getRemoteAddr()
{
if (_remoteAddr != null)
@ -67,12 +69,14 @@ public class Ajp13Request extends Request
/* ------------------------------------------------------------ */
@Override
public void setRemoteAddr(String remoteAddr)
{
_remoteAddr = remoteAddr;
}
/* ------------------------------------------------------------ */
@Override
public String getRemoteHost()
{
if (_remoteHost != null)
@ -83,6 +87,7 @@ public class Ajp13Request extends Request
}
/* ------------------------------------------------------------ */
@Override
public void setRemoteHost(String remoteHost)
{
_remoteHost = remoteHost;
@ -101,6 +106,7 @@ public class Ajp13Request extends Request
}
/* ------------------------------------------------------------ */
@Override
protected void recycle()
{
super.recycle();

View File

@ -41,6 +41,7 @@ public class Ajp13SocketConnector extends SocketConnector
super.setMaxIdleTime(900000);
}
@Override
protected void doStart() throws Exception
{
super.doStart();
@ -53,6 +54,7 @@ public class Ajp13SocketConnector extends SocketConnector
/* (non-Javadoc)
* @see org.eclipse.jetty.server.bio.SocketConnector#customize(org.eclipse.io.EndPoint, org.eclipse.jetty.server.Request)
*/
@Override
public void customize(EndPoint endpoint, Request request) throws IOException
{
super.customize(endpoint,request);
@ -61,6 +63,7 @@ public class Ajp13SocketConnector extends SocketConnector
}
/* ------------------------------------------------------------ */
@Override
protected HttpConnection newHttpConnection(EndPoint endpoint)
{
return new Ajp13Connection(this,endpoint,getServer());
@ -68,6 +71,7 @@ public class Ajp13SocketConnector extends SocketConnector
/* ------------------------------------------------------------ */
// Secured on a packet by packet bases not by connection
@Override
public boolean isConfidential(Request request)
{
return ((Ajp13Request) request).isSslSecure();
@ -75,24 +79,28 @@ public class Ajp13SocketConnector extends SocketConnector
/* ------------------------------------------------------------ */
// Secured on a packet by packet bases not by connection
@Override
public boolean isIntegral(Request request)
{
return ((Ajp13Request) request).isSslSecure();
}
/* ------------------------------------------------------------ */
@Override
public void setHeaderBufferSize(int headerBufferSize)
{
Log.debug(Log.IGNORED);
}
/* ------------------------------------------------------------ */
@Override
public void setRequestBufferSize(int requestBufferSize)
{
Log.debug(Log.IGNORED);
}
/* ------------------------------------------------------------ */
@Override
public void setResponseBufferSize(int responseBufferSize)
{
Log.debug(Log.IGNORED);

View File

@ -22,9 +22,9 @@ import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.webapp.WebInfConfiguration;
import org.eclipse.jetty.webapp.WebXmlProcessor;
import org.eclipse.jetty.webapp.WebXmlProcessor.Descriptor;
import org.eclipse.jetty.webapp.WebInfConfiguration;
public abstract class AbstractConfiguration implements Configuration

View File

@ -15,12 +15,9 @@ package org.eclipse.jetty.annotations;
import java.util.List;
import javax.annotation.security.RunAs;
import org.eclipse.jetty.annotations.AnnotationParser.AnnotationHandler;
import org.eclipse.jetty.annotations.AnnotationParser.Value;
import org.eclipse.jetty.plus.annotation.RunAsCollection;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.webapp.WebAppContext;

View File

@ -14,7 +14,6 @@
package org.eclipse.jetty.annotations;
import java.lang.reflect.Array;
import java.util.List;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.TypeUtil;

View File

@ -13,15 +13,10 @@
package org.eclipse.jetty.annotations;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.annotation.Resources;
import javax.naming.Context;
import javax.naming.InitialContext;
@ -29,16 +24,7 @@ import junit.framework.TestCase;
import org.eclipse.jetty.annotations.AnnotationParser.AnnotationHandler;
import org.eclipse.jetty.annotations.AnnotationParser.Value;
import org.eclipse.jetty.annotations.resources.ResourceA;
import org.eclipse.jetty.annotations.resources.ResourceB;
import org.eclipse.jetty.plus.annotation.Injection;
import org.eclipse.jetty.plus.annotation.InjectionCollection;
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
import org.eclipse.jetty.plus.annotation.RunAsCollection;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.MultiMap;
import org.eclipse.jetty.webapp.WebAppContext;
/**
* TestAnnotationInheritance

View File

@ -8,6 +8,8 @@ import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import junit.framework.TestCase;
import org.eclipse.jetty.annotations.AnnotationParser;
import org.eclipse.jetty.annotations.ClassNameResolver;
import org.eclipse.jetty.annotations.ResourceAnnotationHandler;
@ -17,8 +19,6 @@ import org.eclipse.jetty.plus.annotation.InjectionCollection;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import junit.framework.TestCase;
public class TestResourceAnnotations extends TestCase
{

View File

@ -18,10 +18,11 @@ package org.eclipse.jetty.logging;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import org.eclipse.jetty.logging.impl.io.LogIO;
import junit.framework.TestCase;
import org.eclipse.jetty.logging.impl.io.LogIO;
/**
* Common utility methods for working with JUnit tests cases in a maven friendly way.
*/

View File

@ -23,8 +23,6 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.jetty.logging.impl.Appender;
import org.eclipse.jetty.logging.impl.Severity;
import org.slf4j.MDC;
/**

View File

@ -47,6 +47,7 @@ public class Address
this.port = port;
}
@Override
public boolean equals(Object obj)
{
if (this == obj) return true;
@ -56,6 +57,7 @@ public class Address
return port == that.port;
}
@Override
public int hashCode()
{
int result = host.hashCode();

View File

@ -49,12 +49,14 @@ public class CachedExchange extends HttpExchange
return _responseFields;
}
@Override
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
{
_responseStatus = status;
super.onResponseStatus(version, status, reason);
}
@Override
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
{
if (_responseFields != null)

View File

@ -386,6 +386,7 @@ public class HttpClient extends HttpBuffers implements Attributes
/**
* @see org.eclipse.jetty.http.HttpBuffers#newResponseHeader(int)
*/
@Override
protected Buffer newResponseHeader(int size)
{
if (_connectorType == CONNECTOR_SOCKET)
@ -394,6 +395,7 @@ public class HttpClient extends HttpBuffers implements Attributes
}
/* ------------------------------------------------------------------------------- */
@Override
protected boolean isRequestHeader(Buffer buffer)
{
if (_connectorType == CONNECTOR_SOCKET)
@ -402,6 +404,7 @@ public class HttpClient extends HttpBuffers implements Attributes
}
/* ------------------------------------------------------------------------------- */
@Override
protected boolean isResponseHeader(Buffer buffer)
{
if (_connectorType == CONNECTOR_SOCKET)
@ -423,6 +426,7 @@ public class HttpClient extends HttpBuffers implements Attributes
}
/* ------------------------------------------------------------ */
@Override
protected void doStart() throws Exception
{
super.doStart();
@ -486,6 +490,7 @@ public class HttpClient extends HttpBuffers implements Attributes
}
/* ------------------------------------------------------------ */
@Override
protected void doStop() throws Exception
{
_connector.stop();

View File

@ -49,7 +49,6 @@ public class HttpConnection implements Connection
private boolean _http11 = true;
private Buffer _connectionHeader;
private Buffer _requestContentChunk;
private long _last;
private boolean _requestComplete;
private boolean _reserved;
// The current exchange waiting for a response
@ -527,6 +526,7 @@ public class HttpConnection implements Connection
}
}
@Override
public String toString()
{
return "HttpConnection@" + hashCode() + "//" + _destination.getAddress().getHost() + ":" + _destination.getAddress().getPort();

View File

@ -171,7 +171,8 @@ public class HttpDestination
{
try
{
Thread.currentThread().sleep(200);
Thread.currentThread();
Thread.sleep(200);
timeout-=200;
}
catch (InterruptedException e)
@ -475,7 +476,7 @@ public class HttpDestination
{
Authorization auth = (Authorization)_authorizations.match(ex.getURI());
if (auth != null)
((Authorization)auth).setCredentials(ex);
(auth).setCredentials(ex);
}
HttpConnection connection = getIdleConnection();
@ -498,6 +499,7 @@ public class HttpDestination
}
}
@Override
public synchronized String toString()
{
return "HttpDestination@" + hashCode() + "//" + _address.getHost() + ":" + _address.getPort() + "(" + _connections.size() + "," + _idle.size() + "," + _queue.size() + ")";

View File

@ -25,8 +25,8 @@ import org.eclipse.jetty.http.HttpSchemes;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersions;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.BufferCache.CachedBuffer;
import org.eclipse.jetty.io.ByteArrayBuffer;
import org.eclipse.jetty.io.BufferCache.CachedBuffer;
import org.eclipse.jetty.util.log.Log;
@ -110,6 +110,7 @@ public class HttpExchange
* @throws InterruptedException if the waiting thread is interrupted
* @deprecated Use {@link #waitForDone()} instead
*/
@Deprecated
public void waitForStatus(int status) throws InterruptedException
{
throw new UnsupportedOperationException();
@ -644,6 +645,7 @@ public class HttpExchange
return result;
}
@Override
public String toString()
{
return getClass().getSimpleName() + "@" + hashCode() + "=" + _method + "//" + _address + _uri + "#" + getStatus();
@ -891,6 +893,7 @@ public class HttpExchange
/**
* @deprecated use {@link org.eclipse.jetty.client.CachedExchange} instead
*/
@Deprecated
public static class CachedExchange extends org.eclipse.jetty.client.CachedExchange
{
public CachedExchange(boolean cacheFields)
@ -902,6 +905,7 @@ public class HttpExchange
/**
* @deprecated use {@link org.eclipse.jetty.client.ContentExchange} instead
*/
@Deprecated
public static class ContentExchange extends org.eclipse.jetty.client.ContentExchange
{
}

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.client;
import java.io.IOException;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLSession;
@ -70,6 +71,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
}
/* ------------------------------------------------------------ */
@Override
protected void doStart() throws Exception
{
super.doStart();
@ -119,6 +121,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
}
/* ------------------------------------------------------------ */
@Override
protected void doStop() throws Exception
{
_selectorManager.stop();
@ -237,6 +240,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
/* (non-Javadoc)
* @see org.eclipse.io.nio.SelectorManager#connectionFailed(java.nio.channels.SocketChannel, java.lang.Throwable, java.lang.Object)
*/
@Override
protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
{
if (attachment instanceof HttpDestination)

View File

@ -112,6 +112,7 @@ public class SecurityListener extends HttpEventListenerWrapper
}
@Override
public void onResponseStatus( Buffer version, int status, Buffer reason )
throws IOException
{
@ -134,6 +135,7 @@ public class SecurityListener extends HttpEventListenerWrapper
}
@Override
public void onResponseHeader( Buffer name, Buffer value )
throws IOException
{
@ -185,6 +187,7 @@ public class SecurityListener extends HttpEventListenerWrapper
}
@Override
public void onRequestComplete() throws IOException
{
_requestComplete = true;
@ -217,6 +220,7 @@ public class SecurityListener extends HttpEventListenerWrapper
}
@Override
public void onResponseComplete() throws IOException
{
_responseComplete = true;
@ -248,6 +252,7 @@ public class SecurityListener extends HttpEventListenerWrapper
}
}
@Override
public void onRetry()
{
_attempts++;

View File

@ -31,6 +31,7 @@ public class MkcolExchange extends CachedExchange
}
/* ------------------------------------------------------------ */
@Override
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
{
if ( status == HttpStatus.CREATED_201 )

View File

@ -26,6 +26,7 @@ public class PropfindExchange extends HttpExchange
boolean _propertyExists = false;
/* ------------------------------------------------------------ */
@Override
protected void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
{
if ( status == HttpStatus.OK_200 )

View File

@ -57,6 +57,7 @@ public class WebdavListener extends HttpEventListenerWrapper
}
}
@Override
public void onResponseStatus(Buffer version, int status, Buffer reason) throws IOException
{
if ( !_webdavEnabled )
@ -99,6 +100,7 @@ public class WebdavListener extends HttpEventListenerWrapper
super.onResponseStatus(version, status, reason);
}
@Override
public void onResponseComplete() throws IOException
{
_responseComplete = true;
@ -147,6 +149,7 @@ public class WebdavListener extends HttpEventListenerWrapper
@Override
public void onRequestComplete () throws IOException
{
_requestComplete = true;

View File

@ -25,6 +25,7 @@ public class WebdavSupportedExchange extends HttpExchange
private boolean _webdavSupported = false;
private boolean _isComplete = false;
@Override
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
{
if (Log.isDebugEnabled())
@ -51,6 +52,7 @@ public class WebdavSupportedExchange extends HttpExchange
}
}
@Override
protected void onResponseComplete() throws IOException
{
_isComplete = true;

View File

@ -15,12 +15,14 @@
package org.eclipse.jetty.client;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import junit.framework.TestCase;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Request;

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.client;
public class AsyncSslHttpExchangeTest extends SslHttpExchangeTest
{
@Override
protected void setUp() throws Exception
{
_scheme="https://";

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.client;
public class AsyncSslSecurityListenerTest extends SslSecurityListenerTest
{
@Override
protected void setUp() throws Exception
{
_type = HttpClient.CONNECTOR_SELECT_CHANNEL;

View File

@ -37,6 +37,7 @@ public class BlockingHttpExchangeCancelTest extends AbstractHttpExchangeCancelTe
super.tearDown();
}
@Override
protected HttpClient getHttpClient()
{
return httpClient;

View File

@ -2,7 +2,6 @@ package org.eclipse.jetty.client;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.jetty.http.HttpMethods;

View File

@ -119,6 +119,7 @@ public class ExpireTest extends TestCase
expireCount.incrementAndGet();
final ContentExchange ex = new ContentExchange()
{
@Override
protected void onExpire()
{
expireCount.decrementAndGet();

View File

@ -18,6 +18,7 @@ import java.io.File;
public class ExternalKeyStoreAsyncSslHttpExchangeTest extends SslHttpExchangeTest
{
@Override
protected void setUp() throws Exception
{
_scheme="https://";

View File

@ -34,7 +34,6 @@ import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.ByteArrayBuffer;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
@ -57,6 +56,7 @@ public class HttpExchangeTest extends TestCase
protected Connector _connector;
protected AtomicInteger _count = new AtomicInteger();
@Override
protected void setUp() throws Exception
{
startServer();
@ -66,6 +66,7 @@ public class HttpExchangeTest extends TestCase
_httpClient.start();
}
@Override
protected void tearDown() throws Exception
{
_httpClient.stop();
@ -115,40 +116,47 @@ public class HttpExchangeTest extends TestCase
{
String result="pending";
int len=0;
@Override
protected void onRequestCommitted()
{
result="committed";
// System.err.println(n+" Request committed: "+close);
}
@Override
protected void onRequestComplete() throws IOException
{
result="sent";
}
@Override
protected void onResponseStatus(Buffer version, int status, Buffer reason)
{
result="status";
// System.err.println(n+" Response Status: " + version+" "+status+" "+reason);
}
@Override
protected void onResponseHeader(Buffer name, Buffer value)
{
// System.err.println(n+" Response header: " + name + " = " + value);
}
@Override
protected void onResponseHeaderComplete() throws IOException
{
result="content";
super.onResponseHeaderComplete();
}
@Override
protected void onResponseContent(Buffer content)
{
len+=content.length();
// System.err.println(n+" Response content:" + content.length());
}
@Override
protected void onResponseComplete()
{
result="complete";
@ -160,6 +168,7 @@ public class HttpExchangeTest extends TestCase
complete.countDown();
}
@Override
protected void onConnectionFailed(Throwable ex)
{
complete.countDown();
@ -168,6 +177,7 @@ public class HttpExchangeTest extends TestCase
super.onConnectionFailed(ex);
}
@Override
protected void onException(Throwable ex)
{
complete.countDown();
@ -176,6 +186,7 @@ public class HttpExchangeTest extends TestCase
super.onException(ex);
}
@Override
protected void onExpire()
{
complete.countDown();
@ -184,6 +195,7 @@ public class HttpExchangeTest extends TestCase
super.onExpire();
}
@Override
public String toString()
{
return n+" "+result+" "+len;

View File

@ -37,6 +37,7 @@ public class NonBlockingHttpExchangeCancelTest extends AbstractHttpExchangeCance
super.tearDown();
}
@Override
protected HttpClient getHttpClient()
{
return httpClient;

View File

@ -39,7 +39,6 @@ import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
@ -61,6 +60,7 @@ public class SecurityListenerTest extends TestCase
private Realm _jettyRealm;
private static final String APP_CONTEXT = "localhost /";
@Override
protected void setUp() throws Exception
{
startServer();
@ -90,6 +90,7 @@ public class SecurityListenerTest extends TestCase
_httpClient.setRealmResolver( new SimpleRealmResolver(_jettyRealm) );
}
@Override
protected void tearDown() throws Exception
{
stopServer();
@ -123,26 +124,31 @@ public class SecurityListenerTest extends TestCase
HttpExchange httpExchange=new HttpExchange()
{
@Override
protected void onRequestCommitted()
{
// System.err.println("Request committed");
}
@Override
protected void onResponseStatus(Buffer version, int status, Buffer reason)
{
// System.err.println("Response Status: " + version+" "+status+" "+reason);
}
@Override
protected void onResponseHeader(Buffer name, Buffer value)
{
// System.err.println("Response header: " + name + " = " + value);
}
@Override
protected void onResponseContent(Buffer content)
{
// System.err.println("Response content:" + content);
}
@Override
protected void onResponseComplete()
{
// System.err.println("Response completed "+n);
@ -202,6 +208,7 @@ public class SecurityListenerTest extends TestCase
ContentExchange httpExchange = new ContentExchange()
{
@Override
protected void onResponseComplete() throws IOException
{
super.onResponseComplete();
@ -220,6 +227,7 @@ public class SecurityListenerTest extends TestCase
barrier.reset();
ContentExchange httpExchange2 = new ContentExchange()
{
@Override
protected void onResponseComplete() throws IOException
{
super.onResponseComplete();

View File

@ -27,6 +27,7 @@ import org.eclipse.jetty.server.ssl.SslSocketConnector;
*/
public class SslHttpExchangeTest extends HttpExchangeTest
{
@Override
protected void setUp() throws Exception
{
_scheme="https://";
@ -38,6 +39,7 @@ public class SslHttpExchangeTest extends HttpExchangeTest
_httpClient.start();
}
@Override
protected void newServer()
{
_server = new Server();

View File

@ -40,7 +40,6 @@ import org.eclipse.jetty.security.HashLoginService;
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
@ -58,6 +57,7 @@ public class SslSecurityListenerTest extends TestCase
protected int _type = HttpClient.CONNECTOR_SOCKET;
private static final String APP_CONTEXT = "localhost /";
@Override
protected void setUp() throws Exception
{
startServer();
@ -89,6 +89,7 @@ public class SslSecurityListenerTest extends TestCase
_httpClient.setRealmResolver(resolver);
}
@Override
protected void tearDown() throws Exception
{
Thread.sleep(1000);
@ -103,6 +104,7 @@ public class SslSecurityListenerTest extends TestCase
ContentExchange httpExchange = new ContentExchange(true)
{
@Override
protected void onResponseComplete() throws IOException
{
super.onResponseComplete();

View File

@ -46,6 +46,7 @@ public class WebdavListenerTest extends TestCase//extends HttpExchangeTest
@Override
protected void setUp() throws Exception
{
_singleFileURL = "https://dav.codehaus.org/user/" + _username + "/foo.txt";
@ -81,6 +82,7 @@ public class WebdavListenerTest extends TestCase//extends HttpExchangeTest
}
@Override
public void tearDown () throws Exception
{
_httpClient.stop();

View File

@ -87,7 +87,7 @@ public class ContinuationFilter implements Filter
{
try
{
if (fc==null || ((FilteredContinuation)fc).enter(response))
if (fc==null || (fc).enter(response))
chain.doFilter(request,response);
}
catch (ContinuationThrowable e)
@ -99,7 +99,7 @@ public class ContinuationFilter implements Filter
if (fc==null)
fc = (FilteredContinuation) request.getAttribute(Continuation.ATTRIBUTE);
complete=fc==null || ((FilteredContinuation)fc).exit();
complete=fc==null || (fc).exit();
}
}
}

View File

@ -14,12 +14,10 @@
package org.eclipse.jetty.continuation;
import java.lang.reflect.Constructor;
import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestWrapper;
import javax.servlet.ServletResponse;
import javax.servlet.ServletResponseWrapper;
import org.mortbay.util.ajax.WaitingContinuation;
/* ------------------------------------------------------------ */
/** ContinuationSupport.
@ -154,6 +152,7 @@ public class ContinuationSupport
* @deprecated use {@link #getContinuation(ServletRequest)}
* @return
*/
@Deprecated
public static Continuation getContinuation(final ServletRequest request, final ServletResponse response)
{
return getContinuation(request);

View File

@ -425,6 +425,7 @@ class FauxContinuation implements FilteredContinuation
this.notifyAll();
}
@Override
public String toString()
{
return getStatusString();

View File

@ -2,6 +2,7 @@ package org.eclipse.jetty.continuation;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletResponseWrapper;

View File

@ -107,6 +107,7 @@ public class ContextDeployer extends AbstractLifeCycle
{
undeploy(filename);
}
@Override
public String toString()
{
return "ContextDeployer$Scanner";
@ -193,6 +194,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @throws Exception
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public void setConfigurationDir(String dir) throws Exception
{
setConfigurationDir(Resource.newResource(dir));
@ -204,6 +206,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @throws Exception
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public void setConfigurationDir(File file) throws Exception
{
setConfigurationDir(Resource.newResource(file.toURL()));
@ -214,6 +217,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @param resource
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public void setConfigurationDir(Resource resource)
{
if (isStarted()||isStarting())
@ -226,6 +230,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @param directory
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public void setDirectory(String directory) throws Exception
{
setConfigurationDir(directory);
@ -236,6 +241,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @return
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public String getDirectory()
{
return getConfigurationDir().getName();
@ -246,6 +252,7 @@ public class ContextDeployer extends AbstractLifeCycle
* @return
* @deprecated use {@link #setContextsDir(String)}
*/
@Deprecated
public Resource getConfigurationDir()
{
return _contextsDir;
@ -359,6 +366,7 @@ public class ContextDeployer extends AbstractLifeCycle
*
* @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStart()
*/
@Override
protected void doStart() throws Exception
{
if (_contextsDir==null)
@ -401,6 +409,7 @@ public class ContextDeployer extends AbstractLifeCycle
*
* @see org.eclipse.jetty.util.component.AbstractLifeCycle#doStop()
*/
@Override
protected void doStop() throws Exception
{
_scanner.removeListener(_scannerListener);

View File

@ -164,6 +164,7 @@ public class WebAppDeployer extends AbstractLifeCycle
/**
* @throws Exception
*/
@Override
public void doStart() throws Exception
{
_deployed=new ArrayList();
@ -292,6 +293,7 @@ public class WebAppDeployer extends AbstractLifeCycle
}
}
@Override
public void doStop() throws Exception
{
for (int i=_deployed.size();i-->0;)

View File

@ -33,6 +33,7 @@ public class EncodedHttpURI extends HttpURI
}
@Override
public String getScheme()
{
if (_scheme==_authority)
@ -55,6 +56,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_scheme,_authority-_scheme-1,_encoding);
}
@Override
public String getAuthority()
{
if (_authority==_path)
@ -62,6 +64,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_authority,_path-_authority,_encoding);
}
@Override
public String getHost()
{
if (_host==_port)
@ -69,6 +72,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_host,_port-_host,_encoding);
}
@Override
public int getPort()
{
if (_port==_path)
@ -76,6 +80,7 @@ public class EncodedHttpURI extends HttpURI
return TypeUtil.parseInt(_raw, _port+1, _path-_port-1,10);
}
@Override
public String getPath()
{
if (_path==_param)
@ -83,6 +88,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_path,_param-_path,_encoding);
}
@Override
public String getDecodedPath()
{
if (_path==_param)
@ -90,6 +96,7 @@ public class EncodedHttpURI extends HttpURI
return URIUtil.decodePath(_raw,_path,_param-_path);
}
@Override
public String getPathAndParam()
{
if (_path==_query)
@ -97,6 +104,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_path,_query-_path,_encoding);
}
@Override
public String getCompletePath()
{
if (_path==_end)
@ -104,6 +112,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_path,_end-_path,_encoding);
}
@Override
public String getParam()
{
if (_param==_query)
@ -111,6 +120,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_param+1,_query-_param-1,_encoding);
}
@Override
public String getQuery()
{
if (_query==_fragment)
@ -118,11 +128,13 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding);
}
@Override
public boolean hasQuery()
{
return (_fragment>_query);
}
@Override
public String getFragment()
{
if (_fragment==_end)
@ -130,6 +142,7 @@ public class EncodedHttpURI extends HttpURI
return StringUtil.toString(_raw,_fragment+1,_end-_fragment-1,_encoding);
}
@Override
public void decodeQueryTo(MultiMap parameters)
{
if (_query==_fragment)
@ -137,6 +150,7 @@ public class EncodedHttpURI extends HttpURI
UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding),parameters,_encoding);
}
@Override
public void decodeQueryTo(MultiMap parameters, String encoding)
throws UnsupportedEncodingException
{
@ -148,6 +162,7 @@ public class EncodedHttpURI extends HttpURI
UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding);
}
@Override
public String toString()
{
if (_rawString==null)

View File

@ -75,6 +75,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle
_responseBuffers.setHeaderSize(6*1024);
}
@Override
protected void doStart()
throws Exception
{
@ -85,6 +86,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle
* @return Returns the headerBufferSize.
* @deprecated use {@link #getRequestHeaderSize()} or {@link #getResponseHeaderSize()}
*/
@Deprecated
public int getHeaderBufferSize()
{
return _requestBuffers.getHeaderSize();
@ -160,6 +162,7 @@ public abstract class HttpBuffers extends AbstractLifeCycle
* @param headerBufferSize The headerBufferSize to set.
* @deprecated
*/
@Deprecated
public void setHeaderBufferSize( int headerBufferSize )
{
setRequestHeaderSize(headerBufferSize);

View File

@ -79,6 +79,7 @@ public class HttpException extends IOException
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return ("HttpException("+_status+","+_reason+","+super.getCause()+")");

View File

@ -40,7 +40,6 @@ import org.eclipse.jetty.util.LazyList;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringMap;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
/* ------------------------------------------------------------ */

View File

@ -122,6 +122,7 @@ public class HttpGenerator extends AbstractGenerator
}
/* ------------------------------------------------------------------------------- */
@Override
public void reset(boolean returnBuffers)
{
super.reset(returnBuffers);
@ -270,6 +271,7 @@ public class HttpGenerator extends AbstractGenerator
* @return the available space in the buffer.
* @throws IOException
*/
@Override
public int prepareUncheckedAddContent() throws IOException
{
if (_noContent)
@ -301,6 +303,7 @@ public class HttpGenerator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public boolean isBufferFull()
{
// Should we flush the buffers?
@ -347,6 +350,7 @@ public class HttpGenerator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public void completeHeader(HttpFields fields, boolean allContentAdded) throws IOException
{
if (_state != STATE_HEADER)
@ -740,6 +744,7 @@ public class HttpGenerator extends AbstractGenerator
*
* @throws IOException
*/
@Override
public void complete() throws IOException
{
if (_state == STATE_END)
@ -758,6 +763,7 @@ public class HttpGenerator extends AbstractGenerator
}
/* ------------------------------------------------------------ */
@Override
public long flushBuffer() throws IOException
{
try
@ -979,6 +985,7 @@ public class HttpGenerator extends AbstractGenerator
(_content==null||_content.length()==0);
}
@Override
public String toString()
{
return "HttpGenerator s="+_state+

View File

@ -1002,6 +1002,7 @@ public class HttpParser implements Parser
}
/* ------------------------------------------------------------------------------- */
@Override
public String toString()
{
return "state=" + _state + " length=" + _length + " len=" + _contentLength;

View File

@ -581,6 +581,7 @@ public class HttpURI
_encoded=false;
}
@Override
public String toString()
{
if (_rawString==null)

View File

@ -143,6 +143,7 @@ public class PathMap extends HashMap implements Externalizable
* path specifications.
* @param object The object the path maps to
*/
@Override
public Object put(Object pathSpec, Object object)
{
StringTokenizer tok = new StringTokenizer(pathSpec.toString(),__pathSpecSeparators);
@ -335,6 +336,7 @@ public class PathMap extends HashMap implements Externalizable
}
/* --------------------------------------------------------------- */
@Override
public Object remove(Object pathSpec)
{
if (pathSpec!=null)
@ -362,6 +364,7 @@ public class PathMap extends HashMap implements Externalizable
}
/* --------------------------------------------------------------- */
@Override
public void clear()
{
_exactMap.clear();
@ -537,6 +540,7 @@ public class PathMap extends HashMap implements Externalizable
throw new UnsupportedOperationException();
}
@Override
public String toString()
{
if (string==null)

View File

@ -87,6 +87,7 @@ public class Constraint implements Cloneable, Serializable
}
/* ------------------------------------------------------------ */
@Override
public Object clone() throws CloneNotSupportedException
{
return super.clone();
@ -200,6 +201,7 @@ public class Constraint implements Cloneable, Serializable
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return "SC{" + _name

View File

@ -13,7 +13,6 @@
package org.eclipse.jetty.http.security;
import java.lang.reflect.Array;
import java.security.MessageDigest;
import org.eclipse.jetty.util.StringUtil;
@ -81,6 +80,7 @@ public abstract class Credential
_cooked = cooked.startsWith(Crypt.__TYPE) ? cooked.substring(__TYPE.length()) : cooked;
}
@Override
public boolean check(Object credentials)
{
if (credentials instanceof char[])
@ -126,6 +126,7 @@ public abstract class Credential
}
/* ------------------------------------------------------------ */
@Override
public boolean check(Object credentials)
{
try

View File

@ -68,6 +68,7 @@ public class Password extends Credential
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return _pw;
@ -80,6 +81,7 @@ public class Password extends Credential
}
/* ------------------------------------------------------------ */
@Override
public boolean check(Object credentials)
{
if (this == credentials) return true;
@ -96,6 +98,7 @@ public class Password extends Credential
}
/* ------------------------------------------------------------ */
@Override
public boolean equals(Object o)
{
if (this == o)
@ -118,6 +121,7 @@ public class Password extends Credential
}
/* ------------------------------------------------------------ */
@Override
public int hashCode()
{
return null == _pw ? super.hashCode() : _pw.hashCode();

View File

@ -23,7 +23,6 @@
package org.eclipse.jetty.http.security;
import org.eclipse.jetty.util.StringUtil;
/* ------------------------------------------------------------ */
/**
@ -141,10 +140,10 @@ public class UnixCrypt
for (int i = 0; i < 64; i++)
{
int k;
if ((k = (int) PC2[i]) == 0) continue;
if ((k = PC2[i]) == 0) continue;
k += Rotates[0] - 1;
if ((k % 28) < Rotates[0]) k -= 28;
k = (int) PC1[k];
k = PC1[k];
if (k > 0)
{
k--;
@ -163,12 +162,12 @@ public class UnixCrypt
perm[i] = temp[i] = 0;
for (int i = 0; i < 64; i++)
{
if ((k = (int) PC2[i]) == 0) continue;
if ((k = PC2[i]) == 0) continue;
temp[k - 1] = (byte) (i + 1);
}
for (int i = 0; i < 64; i++)
{
if ((k = (int) PC2[i]) == 0) continue;
if ((k = PC2[i]) == 0) continue;
k += j;
if ((k % 28) <= j) k -= 28;
perm[i] = temp[k];
@ -233,7 +232,7 @@ public class UnixCrypt
temp[4 * t + i] = (byte) ((k >> i) & 0x01);
long kk = 0;
for (int i = 24; --i >= 0;)
kk = ((kk << 1) | ((long) temp[perm[i] - 1]) << 32 | ((long) temp[perm[i + 24] - 1]));
kk = ((kk << 1) | ((long) temp[perm[i] - 1]) << 32 | (temp[perm[i + 24] - 1]));
SPE[t][j] = to_six_bit(kk);
}

View File

@ -100,6 +100,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
/* (non-Javadoc)
* @see org.eclipse.io.nio.SelectChannelEndPoint#idleExpired()
*/
@Override
protected void idleExpired()
{
try
@ -125,6 +126,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
}
/* ------------------------------------------------------------ */
@Override
public void close() throws IOException
{
// TODO - this really should not be done in a loop here - but with async callbacks.
@ -816,18 +818,21 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
}
/* ------------------------------------------------------------ */
@Override
public boolean isBufferingInput()
{
return _inNIOBuffer.hasContent();
}
/* ------------------------------------------------------------ */
@Override
public boolean isBufferingOutput()
{
return _outNIOBuffer.hasContent();
}
/* ------------------------------------------------------------ */
@Override
public boolean isBufferred()
{
return true;
@ -840,6 +845,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return super.toString()+","+_engine.getHandshakeStatus()+", in/out="+_inNIOBuffer.length()+"/"+_outNIOBuffer.length()+" "+_result;

View File

@ -236,33 +236,34 @@ public class HttpGeneratorClientTest extends TestCase
{
view.setPutIndex(i*inc);
view.setGetIndex((i-1)*inc);
hb.addContent(view,HttpGenerator.MORE);
if (hb.isBufferFull() && hb.isState(HttpGenerator.STATE_HEADER))
hb.completeHeader(fields, HttpGenerator.MORE);
hb.addContent(view,Generator.MORE);
if (hb.isBufferFull() && hb.isState(AbstractGenerator.STATE_HEADER))
hb.completeHeader(fields, Generator.MORE);
if (i%2==0)
{
if (hb.isState(HttpGenerator.STATE_HEADER))
if (hb.isState(AbstractGenerator.STATE_HEADER))
{
if (version<11)
fields.addLongField("Content-Length",body.length());
hb.completeHeader(fields, HttpGenerator.MORE);
hb.completeHeader(fields, Generator.MORE);
}
hb.flushBuffer();
}
}
view.setPutIndex(buf.putIndex());
view.setGetIndex((chunks-1)*inc);
hb.addContent(view,HttpGenerator.LAST);
if(hb.isState(HttpGenerator.STATE_HEADER))
hb.completeHeader(fields, HttpGenerator.LAST);
hb.addContent(view,Generator.LAST);
if(hb.isState(AbstractGenerator.STATE_HEADER))
hb.completeHeader(fields, Generator.LAST);
}
else
{
hb.completeHeader(fields, HttpGenerator.LAST);
hb.completeHeader(fields, Generator.LAST);
}
hb.complete();
}
@Override
public String toString()
{
return "["+values[0]+","+values[1]+","+(body==null?"none":"_content")+"]";
@ -292,6 +293,7 @@ public class HttpGeneratorClientTest extends TestCase
{
int index=0;
@Override
public void content(Buffer ref)
{
if (index == 0)
@ -301,6 +303,7 @@ public class HttpGeneratorClientTest extends TestCase
}
@Override
public void startRequest(Buffer tok0, Buffer tok1, Buffer tok2)
{
h= -1;
@ -320,6 +323,7 @@ public class HttpGeneratorClientTest extends TestCase
/* (non-Javadoc)
* @see org.eclipse.jetty.EventHandler#startResponse(org.eclipse.io.Buffer, int, org.eclipse.io.Buffer)
*/
@Override
public void startResponse(Buffer version, int status, Buffer reason)
{
h= -1;
@ -334,17 +338,20 @@ public class HttpGeneratorClientTest extends TestCase
index=0;
}
@Override
public void parsedHeader(Buffer name,Buffer value)
{
hdr[++h]= name.toString();
val[h]= value.toString();
}
@Override
public void headerComplete()
{
content= null;
}
@Override
public void messageComplete(long contentLength)
{
}

View File

@ -154,29 +154,30 @@ public class HttpGeneratorTest extends TestCase
{
view.setPutIndex(i*inc);
view.setGetIndex((i-1)*inc);
hb.addContent(view,HttpGenerator.MORE);
if (hb.isBufferFull() && hb.isState(HttpGenerator.STATE_HEADER))
hb.completeHeader(fields, HttpGenerator.MORE);
hb.addContent(view,Generator.MORE);
if (hb.isBufferFull() && hb.isState(AbstractGenerator.STATE_HEADER))
hb.completeHeader(fields, Generator.MORE);
if (i%2==0)
{
if (hb.isState(HttpGenerator.STATE_HEADER))
hb.completeHeader(fields, HttpGenerator.MORE);
if (hb.isState(AbstractGenerator.STATE_HEADER))
hb.completeHeader(fields, Generator.MORE);
hb.flushBuffer();
}
}
view.setPutIndex(buf.putIndex());
view.setGetIndex((chunks-1)*inc);
hb.addContent(view,HttpGenerator.LAST);
if(hb.isState(HttpGenerator.STATE_HEADER))
hb.completeHeader(fields, HttpGenerator.LAST);
hb.addContent(view,Generator.LAST);
if(hb.isState(AbstractGenerator.STATE_HEADER))
hb.completeHeader(fields, Generator.LAST);
}
else
{
hb.completeHeader(fields, HttpGenerator.LAST);
hb.completeHeader(fields, Generator.LAST);
}
hb.complete();
}
@Override
public String toString()
{
return "["+code+","+values[0]+","+values[1]+","+(body==null?"none":"_content")+"]";
@ -207,6 +208,7 @@ public class HttpGeneratorTest extends TestCase
{
int index=0;
@Override
public void content(Buffer ref)
{
if (index == 0)
@ -216,6 +218,7 @@ public class HttpGeneratorTest extends TestCase
}
@Override
public void startRequest(Buffer tok0, Buffer tok1, Buffer tok2)
{
h= -1;
@ -235,6 +238,7 @@ public class HttpGeneratorTest extends TestCase
/* (non-Javadoc)
* @see org.eclipse.jetty.EventHandler#startResponse(org.eclipse.io.Buffer, int, org.eclipse.io.Buffer)
*/
@Override
public void startResponse(Buffer version, int status, Buffer reason)
{
h= -1;
@ -249,17 +253,20 @@ public class HttpGeneratorTest extends TestCase
index=0;
}
@Override
public void parsedHeader(Buffer name,Buffer value)
{
hdr[++h]= name.toString();
val[h]= value.toString();
}
@Override
public void headerComplete()
{
content= null;
}
@Override
public void messageComplete(long contentLength)
{
}

View File

@ -149,6 +149,7 @@ public abstract class AbstractBuffer implements Buffer
}
}
@Override
public boolean equals(Object obj)
{
if (obj==this)
@ -274,6 +275,7 @@ public abstract class AbstractBuffer implements Buffer
return _put > _get;
}
@Override
public int hashCode()
{
if (_hash == 0 || _hashGet!=_get || _hashPut!=_put)
@ -613,6 +615,7 @@ public abstract class AbstractBuffer implements Buffer
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
if (isImmutable())

View File

@ -143,6 +143,7 @@ public class BufferCache
}
@Override
public String toString()
{
return "CACHE["+

View File

@ -97,6 +97,7 @@ public class ByteArrayBuffer extends AbstractBuffer
return _bytes.length;
}
@Override
public void compact()
{
if (isReadOnly())
@ -116,6 +117,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
@Override
public boolean equals(Object obj)
{
if (obj==this)
@ -155,6 +157,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
@Override
public boolean equalsIgnoreCase(Buffer b)
{
if (b==this)
@ -206,11 +209,13 @@ public class ByteArrayBuffer extends AbstractBuffer
return true;
}
@Override
public byte get()
{
return _bytes[_get++];
}
@Override
public int hashCode()
{
if (_hash == 0 || _hashGet!=_get || _hashPut!=_put)
@ -268,6 +273,7 @@ public class ByteArrayBuffer extends AbstractBuffer
_bytes[index] = b;
}
@Override
public int poke(int index, Buffer src)
{
_hash=0;
@ -303,6 +309,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
@Override
public int poke(int index, byte[] b, int offset, int length)
{
_hash=0;
@ -358,6 +365,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
/* ------------------------------------------------------------ */
@Override
public void writeTo(OutputStream out)
throws IOException
{
@ -366,6 +374,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
/* ------------------------------------------------------------ */
@Override
public int readFrom(InputStream in,int max) throws IOException
{
if (max<0||max>space())
@ -394,6 +403,7 @@ public class ByteArrayBuffer extends AbstractBuffer
}
/* ------------------------------------------------------------ */
@Override
public int space()
{
return _bytes.length - _put;
@ -415,6 +425,7 @@ public class ByteArrayBuffer extends AbstractBuffer
super(b,o,l,rw);
}
@Override
public boolean equals(Object obj)
{
return obj instanceof Buffer && equalsIgnoreCase((Buffer)obj);

View File

@ -13,7 +13,6 @@
package org.eclipse.jetty.io;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
/* ------------------------------------------------------------ */
/** Abstract Buffer pool.
@ -28,6 +27,7 @@ public abstract class ThreadLocalBuffers implements Buffers
/* ------------------------------------------------------------ */
private final ThreadLocal<ThreadBuffers> _buffers=new ThreadLocal<ThreadBuffers>()
{
@Override
protected ThreadBuffers initialValue()
{
return new ThreadBuffers();

View File

@ -15,8 +15,8 @@
package org.eclipse.jetty.io;
import java.io.BufferedWriter;
import java.io.InterruptedIOException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@ -107,6 +107,7 @@ public class UncheckedPrintWriter extends PrintWriter
/**
* Flush the stream.
*/
@Override
public void flush() {
try {
synchronized (lock) {
@ -125,6 +126,7 @@ public class UncheckedPrintWriter extends PrintWriter
/**
* Close the stream.
*/
@Override
public void close() {
try {
synchronized (lock) {
@ -143,6 +145,7 @@ public class UncheckedPrintWriter extends PrintWriter
* Write a single character.
* @param c int specifying a character to be written.
*/
@Override
public void write(int c) {
try {
synchronized (lock) {
@ -167,6 +170,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param off Offset from which to start writing characters
* @param len Number of characters to write
*/
@Override
public void write(char buf[], int off, int len) {
try {
synchronized (lock) {
@ -190,6 +194,7 @@ public class UncheckedPrintWriter extends PrintWriter
* Writer class because it must suppress I/O exceptions.
* @param buf Array of characters to be written
*/
@Override
public void write(char buf[]) {
this.write(buf, 0, buf.length);
}
@ -201,6 +206,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param off Offset from which to start writing characters
* @param len Number of characters to write
*/
@Override
public void write(String s, int off, int len) {
try {
synchronized (lock) {
@ -224,6 +230,7 @@ public class UncheckedPrintWriter extends PrintWriter
* because it must suppress I/O exceptions.
* @param s String to be written
*/
@Override
public void write(String s) {
this.write(s, 0, s.length());
}
@ -260,6 +267,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param b The <code>boolean</code> to be printed
*/
@Override
public void print(boolean b) {
this.write(b ? "true" : "false");
}
@ -273,6 +281,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param c The <code>char</code> to be printed
*/
@Override
public void print(char c) {
this.write(c);
}
@ -288,6 +297,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param i The <code>int</code> to be printed
* @see java.lang.Integer#toString(int)
*/
@Override
public void print(int i) {
this.write(String.valueOf(i));
}
@ -303,6 +313,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param l The <code>long</code> to be printed
* @see java.lang.Long#toString(long)
*/
@Override
public void print(long l) {
this.write(String.valueOf(l));
}
@ -318,6 +329,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param f The <code>float</code> to be printed
* @see java.lang.Float#toString(float)
*/
@Override
public void print(float f) {
this.write(String.valueOf(f));
}
@ -333,6 +345,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param d The <code>double</code> to be printed
* @see java.lang.Double#toString(double)
*/
@Override
public void print(double d) {
this.write(String.valueOf(d));
}
@ -348,6 +361,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @throws NullPointerException If <code>s</code> is <code>null</code>
*/
@Override
public void print(char s[]) {
this.write(s);
}
@ -362,6 +376,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param s The <code>String</code> to be printed
*/
@Override
public void print(String s) {
if (s == null) {
s = "null";
@ -380,6 +395,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param obj The <code>Object</code> to be printed
* @see java.lang.Object#toString()
*/
@Override
public void print(Object obj) {
this.write(String.valueOf(obj));
}
@ -394,6 +410,7 @@ public class UncheckedPrintWriter extends PrintWriter
* <code>line.separator</code>, and is not necessarily a single newline
* character (<code>'\n'</code>).
*/
@Override
public void println() {
this.newLine();
}
@ -406,6 +423,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>boolean</code> value to be printed
*/
@Override
public void println(boolean x) {
synchronized (lock) {
this.print(x);
@ -421,6 +439,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>char</code> value to be printed
*/
@Override
public void println(char x) {
synchronized (lock) {
this.print(x);
@ -436,6 +455,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>int</code> value to be printed
*/
@Override
public void println(int x) {
synchronized (lock) {
this.print(x);
@ -451,6 +471,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>long</code> value to be printed
*/
@Override
public void println(long x) {
synchronized (lock) {
this.print(x);
@ -466,6 +487,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>float</code> value to be printed
*/
@Override
public void println(float x) {
synchronized (lock) {
this.print(x);
@ -482,6 +504,7 @@ public class UncheckedPrintWriter extends PrintWriter
* @param x the <code>double</code> value to be printed
*/
/* ------------------------------------------------------------ */
@Override
public void println(double x) {
synchronized (lock) {
this.print(x);
@ -497,6 +520,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the array of <code>char</code> values to be printed
*/
@Override
public void println(char x[]) {
synchronized (lock) {
this.print(x);
@ -512,6 +536,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>String</code> value to be printed
*/
@Override
public void println(String x) {
synchronized (lock) {
this.print(x);
@ -527,6 +552,7 @@ public class UncheckedPrintWriter extends PrintWriter
*
* @param x the <code>Object</code> value to be printed
*/
@Override
public void println(Object x) {
synchronized (lock) {
this.print(x);

View File

@ -92,6 +92,7 @@ public class View extends AbstractBuffer
/**
* @return The {@link Buffer#buffer()} from the underlying buffer.
*/
@Override
public Buffer buffer()
{
return _buffer.buffer();
@ -108,6 +109,7 @@ public class View extends AbstractBuffer
/**
*
*/
@Override
public void clear()
{
setMarkIndex(-1);
@ -119,6 +121,7 @@ public class View extends AbstractBuffer
/**
*
*/
@Override
public void compact()
{
// TODO
@ -129,6 +132,7 @@ public class View extends AbstractBuffer
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj)
{
return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj);
@ -137,6 +141,7 @@ public class View extends AbstractBuffer
/**
* @return Whether the underlying buffer is {@link Buffer#isReadOnly read only}
*/
@Override
public boolean isReadOnly()
{
return _buffer.isReadOnly();
@ -145,6 +150,7 @@ public class View extends AbstractBuffer
/**
* @return Whether the underlying buffer is {@link Buffer#isVolatile volatile}
*/
@Override
public boolean isVolatile()
{
return true;
@ -169,6 +175,7 @@ public class View extends AbstractBuffer
/**
* @return The result of calling {@link Buffer#peek(int, int)} on the underlying buffer
*/
@Override
public Buffer peek(int index, int length)
{
return _buffer.peek(index, length);
@ -178,6 +185,7 @@ public class View extends AbstractBuffer
* @param index
* @param src
*/
@Override
public int poke(int index, Buffer src)
{
return _buffer.poke(index,src);
@ -198,11 +206,13 @@ public class View extends AbstractBuffer
* @param offset
* @param length
*/
@Override
public int poke(int index, byte[] b, int offset, int length)
{
return _buffer.poke(index,b,offset,length);
}
@Override
public String toString()
{
if (_buffer==null)
@ -227,6 +237,7 @@ public class View extends AbstractBuffer
super(buffer);
}
@Override
public boolean equals(Object obj)
{
return this==obj ||((obj instanceof Buffer)&&((Buffer)obj).equalsIgnoreCase(this)) || super.equals(obj);

View File

@ -46,6 +46,7 @@ public class WriterOutputStream extends OutputStream
}
/* ------------------------------------------------------------ */
@Override
public void close()
throws IOException
{
@ -53,6 +54,7 @@ public class WriterOutputStream extends OutputStream
}
/* ------------------------------------------------------------ */
@Override
public void flush()
throws IOException
{
@ -60,6 +62,7 @@ public class WriterOutputStream extends OutputStream
}
/* ------------------------------------------------------------ */
@Override
public void write(byte[] b)
throws IOException
{
@ -70,6 +73,7 @@ public class WriterOutputStream extends OutputStream
}
/* ------------------------------------------------------------ */
@Override
public void write(byte[] b, int off, int len)
throws IOException
{
@ -80,6 +84,7 @@ public class WriterOutputStream extends OutputStream
}
/* ------------------------------------------------------------ */
@Override
public synchronized void write(int b)
throws IOException
{

View File

@ -46,6 +46,7 @@ public class SocketEndPoint extends StreamEndPoint
/* (non-Javadoc)
* @see org.eclipse.io.BufferIO#isClosed()
*/
@Override
public boolean isOpen()
{
return super.isOpen() && _socket!=null && !_socket.isClosed() && !_socket.isInputShutdown() && !_socket.isOutputShutdown();
@ -54,6 +55,7 @@ public class SocketEndPoint extends StreamEndPoint
/* (non-Javadoc)
* @see org.eclipse.io.BufferIO#close()
*/
@Override
public void close() throws IOException
{
if (!_socket.isClosed() && !_socket.isOutputShutdown())
@ -81,6 +83,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getLocalAddr()
*/
@Override
public String getLocalAddr()
{
if (_local==null)
@ -96,6 +99,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getLocalHost()
*/
@Override
public String getLocalHost()
{
if (_local==null)
@ -111,6 +115,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getLocalPort()
*/
@Override
public int getLocalPort()
{
if (_local==null)
@ -124,6 +129,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getRemoteAddr()
*/
@Override
public String getRemoteAddr()
{
if (_remote==null)
@ -138,6 +144,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getRemoteHost()
*/
@Override
public String getRemoteHost()
{
if (_remote==null)
@ -151,6 +158,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getRemotePort()
*/
@Override
public int getRemotePort()
{
if (_remote==null)
@ -164,6 +172,7 @@ public class SocketEndPoint extends StreamEndPoint
/*
* @see org.eclipse.io.EndPoint#getConnection()
*/
@Override
public Object getTransport()
{
return _socket;

View File

@ -15,7 +15,6 @@ package org.eclipse.jetty.io.bio;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.eclipse.jetty.util.StringUtil;

View File

@ -130,6 +130,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer
_buf.put(index,b);
}
@Override
public int poke(int index, Buffer src)
{
if (isReadOnly()) throw new IllegalStateException(__READONLY);
@ -174,6 +175,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer
}
}
@Override
public int poke(int index, byte[] b, int offset, int length)
{
if (isReadOnly()) throw new IllegalStateException(__READONLY);
@ -212,6 +214,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer
}
/* ------------------------------------------------------------ */
@Override
public int readFrom(InputStream in, int max) throws IOException
{
if (_in==null || !_in.isOpen() || in!=_inStream)
@ -276,6 +279,7 @@ public class DirectNIOBuffer extends AbstractBuffer implements NIOBuffer
}
/* ------------------------------------------------------------ */
@Override
public void writeTo(OutputStream out) throws IOException
{
if (_out==null || !_out.isOpen() || out!=_outStream)

View File

@ -76,6 +76,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer
return _capacity;
}
@Override
public void clear()
{
try
@ -93,6 +94,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer
}
@Override
public byte peek()
{
synchronized (_file)
@ -158,6 +160,7 @@ public class RandomAccessFileBuffer extends AbstractBuffer implements Buffer
}
}
@Override
public int poke(int index, byte[] b, int offset, int length)
{
synchronized (_file)

View File

@ -18,7 +18,6 @@ import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jetty.io.AsyncEndPoint;
import org.eclipse.jetty.io.Buffer;
@ -208,6 +207,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/* ------------------------------------------------------------ */
/*
*/
@Override
public int flush(Buffer header, Buffer buffer, Buffer trailer) throws IOException
{
int l = super.flush(header, buffer, trailer);
@ -218,6 +218,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/* ------------------------------------------------------------ */
/*
*/
@Override
public int flush(Buffer buffer) throws IOException
{
int l = super.flush(buffer);
@ -238,6 +239,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/*
* Allows thread to block waiting for further events.
*/
@Override
public boolean blockReadable(long timeoutMs) throws IOException
{
synchronized (this)
@ -274,6 +276,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/*
* Allows thread to block waiting for further events.
*/
@Override
public boolean blockWritable(long timeoutMs) throws IOException
{
synchronized (this)
@ -480,6 +483,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/*
* @see org.eclipse.io.nio.ChannelEndPoint#close()
*/
@Override
public void close() throws IOException
{
try
@ -497,6 +501,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
synchronized(this)
@ -527,11 +532,13 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements Runnable,
/*
* @see org.eclipse.thread.Timeout.Task#expire()
*/
@Override
public void expired()
{
idleExpired();
}
@Override
public String toString()
{
return "TimeoutTask:" + SelectChannelEndPoint.this.toString();

View File

@ -21,8 +21,6 @@ import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jetty.io.Connection;
@ -196,6 +194,7 @@ public abstract class SelectorManager extends AbstractLifeCycle
/* (non-Javadoc)
* @see org.eclipse.component.AbstractLifeCycle#doStart()
*/
@Override
protected void doStart() throws Exception
{
_selectSet = new SelectSet[_selectSets];
@ -207,6 +206,7 @@ public abstract class SelectorManager extends AbstractLifeCycle
/* ------------------------------------------------------------------------------- */
@Override
protected void doStop() throws Exception
{
SelectSet[] sets= _selectSet;
@ -596,7 +596,7 @@ public abstract class SelectorManager extends AbstractLifeCycle
else if (__BUSY_KEY>0 && selected==1 && _selects>__MAX_SELECTS)
{
// Look for busy key
SelectionKey busy = (SelectionKey)selector.selectedKeys().iterator().next();
SelectionKey busy = selector.selectedKeys().iterator().next();
if (busy==_busyKey)
{
if (++_busyKeyCount>__BUSY_KEY)

View File

@ -40,6 +40,7 @@ public class BufferCacheTest extends TestCase
/**
* @see TestCase#setUp()
*/
@Override
protected void setUp() throws Exception
{
super.setUp();
@ -52,6 +53,7 @@ public class BufferCacheTest extends TestCase
/**
* @see TestCase#tearDown()
*/
@Override
protected void tearDown() throws Exception
{
super.tearDown();

View File

@ -39,6 +39,7 @@ public class BufferTest extends TestCase
/*
* @see TestCase#setUp()
*/
@Override
protected void setUp() throws Exception
{
super.setUp();
@ -57,6 +58,7 @@ public class BufferTest extends TestCase
/*
* @see TestCase#tearDown()
*/
@Override
protected void tearDown() throws Exception
{
super.tearDown();

View File

@ -14,10 +14,8 @@
package org.eclipse.jetty.io;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import junit.framework.TestCase;
@ -40,12 +38,14 @@ public class ThreadLocalBuffersTest
AtomicLong buffersRetrieved;
@Override
protected void setUp()
throws Exception
{
super.setUp();
}
@Override
protected void tearDown()
throws Exception
{
@ -262,6 +262,7 @@ public class ThreadLocalBuffersTest
start();
}
@Override
public void run()
{
while ( true )

View File

@ -15,7 +15,7 @@ package org.eclipse.jetty.security.jaspi;
import java.security.Principal;
import java.util.Map;
import java.util.Set;
import java.util.Set;
import javax.security.auth.Subject;
import javax.security.auth.message.AuthException;
@ -28,9 +28,9 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.eclipse.jetty.security.Authenticator;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.authentication.DeferredAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;

View File

@ -29,8 +29,8 @@ import javax.servlet.ServletContext;
import org.eclipse.jetty.security.Authenticator;
import org.eclipse.jetty.security.DefaultAuthenticatorFactory;
import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.LoginService;
import org.eclipse.jetty.security.Authenticator.Configuration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.log.Log;

View File

@ -13,15 +13,10 @@
package org.eclipse.jetty.plus.annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.jetty.util.log.Log;

View File

@ -14,7 +14,6 @@
package org.eclipse.jetty.security;
import java.security.Principal;
import java.util.Map;
import javax.security.auth.Subject;

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.security;
import java.security.Principal;
import javax.security.auth.Subject;
import org.eclipse.jetty.server.UserIdentity;

View File

@ -28,7 +28,6 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.security.authentication.DeferredAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.UserIdentity;

View File

@ -23,8 +23,8 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.security.B64Code;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.Authentication.User;

View File

@ -24,8 +24,8 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.security.B64Code;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.Authentication.User;

View File

@ -25,8 +25,8 @@ import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.security.B64Code;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.http.security.Credential;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.UserIdentity;

View File

@ -30,11 +30,10 @@ import javax.servlet.http.HttpSession;
import org.eclipse.jetty.http.HttpHeaders;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.security.Authenticator;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.security.ServerAuthException;
import org.eclipse.jetty.security.UserAuthentication;
import org.eclipse.jetty.server.Authentication;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.Authentication.Deferred;
import org.eclipse.jetty.server.Authentication.User;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.URIUtil;

View File

@ -18,7 +18,6 @@ import java.security.Principal;
import javax.security.auth.Subject;
import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.server.UserIdentity;
/**
* This is similar to the jaspi PasswordValidationCallback but includes user

View File

@ -16,11 +16,13 @@ package org.eclipse.jetty.security;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import junit.framework.TestCase;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.http.security.Password;
import org.eclipse.jetty.security.authentication.FormAuthenticator;

View File

@ -18,11 +18,13 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import junit.framework.TestCase;
import org.eclipse.jetty.http.security.B64Code;
import org.eclipse.jetty.http.security.Constraint;
import org.eclipse.jetty.http.security.Password;

View File

@ -17,6 +17,7 @@ import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.servlet.ServletRequest;
import org.eclipse.jetty.http.HttpBuffers;
@ -107,36 +108,42 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
}
/* ------------------------------------------------------------------------------- */
@Override
public Buffer newRequestBuffer(int size)
{
return new ByteArrayBuffer(size);
}
/* ------------------------------------------------------------------------------- */
@Override
public Buffer newRequestHeader(int size)
{
return new ByteArrayBuffer(size);
}
/* ------------------------------------------------------------------------------- */
@Override
public Buffer newResponseBuffer(int size)
{
return new ByteArrayBuffer(size);
}
/* ------------------------------------------------------------------------------- */
@Override
public Buffer newResponseHeader(int size)
{
return new ByteArrayBuffer(size);
}
/* ------------------------------------------------------------------------------- */
@Override
protected boolean isRequestHeader(Buffer buffer)
{
return true;
}
/* ------------------------------------------------------------------------------- */
@Override
protected boolean isResponseHeader(Buffer buffer)
{
return true;
@ -319,6 +326,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
}
/* ------------------------------------------------------------ */
@Override
protected void doStart() throws Exception
{
if (_server==null)
@ -353,6 +361,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
}
/* ------------------------------------------------------------ */
@Override
protected void doStop() throws Exception
{
try{close();} catch(IOException e) {Log.warn(e);}
@ -696,6 +705,7 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
String name = this.getClass().getName();

View File

@ -19,11 +19,10 @@ import java.util.List;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.ServletResponseWrapper;
import org.eclipse.jetty.continuation.ContinuationThrowable;
import org.eclipse.jetty.continuation.ContinuationListener;
import org.eclipse.jetty.continuation.Continuation;
import org.eclipse.jetty.continuation.ContinuationListener;
import org.eclipse.jetty.continuation.ContinuationThrowable;
import org.eclipse.jetty.io.AsyncEndPoint;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.handler.ContextHandler;
@ -183,6 +182,7 @@ public class AsyncContinuation implements AsyncContext, Continuation
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
synchronized (this)
@ -871,6 +871,7 @@ public class AsyncContinuation implements AsyncContext, Continuation
return _path;
}
@Override
public void expired()
{
AsyncContinuation.this.expired();

View File

@ -120,7 +120,8 @@ public interface Authentication
* This convenience instance is for non mandatory authentication where credentials
* have been presented and checked, but failed authentication.
*/
public final static Authentication UNAUTHENTICATED = new Authentication(){public String toString(){return "UNAUTHENTICATED";}};
public final static Authentication UNAUTHENTICATED = new Authentication(){@Override
public String toString(){return "UNAUTHENTICATED";}};
/* ------------------------------------------------------------ */
/** Authentication not checked
@ -128,20 +129,24 @@ public interface Authentication
* This convenience instance us for non mandatory authentication when no
* credentials are present to be checked.
*/
public final static Authentication NOT_CHECKED = new Authentication(){public String toString(){return "NOT CHECKED";}};
public final static Authentication NOT_CHECKED = new Authentication(){@Override
public String toString(){return "NOT CHECKED";}};
/* ------------------------------------------------------------ */
/** Authentication challenge sent.
* <p>
* This convenience instance is for when an authentication challenge has been sent.
*/
public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){public String toString(){return "CHALLENGE";}};
public final static Authentication SEND_CONTINUE = new Authentication.Challenge(){@Override
public String toString(){return "CHALLENGE";}};
/* ------------------------------------------------------------ */
/** Authentication failure sent.
* <p>
* This convenience instance is for when an authentication failure has been sent.
*/
public final static Authentication SEND_FAILURE = new Authentication.Failure(){public String toString(){return "FAILURE";}};
public final static Authentication SEND_SUCCESS = new SendSuccess(){public String toString(){return "SEND_SUCCESS";}};
public final static Authentication SEND_FAILURE = new Authentication.Failure(){@Override
public String toString(){return "FAILURE";}};
public final static Authentication SEND_SUCCESS = new SendSuccess(){@Override
public String toString(){return "SEND_SUCCESS";}};
}

View File

@ -13,11 +13,9 @@
package org.eclipse.jetty.server;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.util.LazyList;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;

View File

@ -477,6 +477,7 @@ public class Dispatcher implements RequestDispatcher
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return "FORWARD+"+_attr.toString();
@ -583,6 +584,7 @@ public class Dispatcher implements RequestDispatcher
}
/* ------------------------------------------------------------ */
@Override
public String toString()
{
return "INCLUDE+"+_attr.toString();

View File

@ -16,6 +16,7 @@ package org.eclipse.jetty.server;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
@ -39,12 +40,12 @@ import org.eclipse.jetty.http.HttpVersions;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.http.Parser;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.BufferCache.CachedBuffer;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.io.RuntimeIOException;
import org.eclipse.jetty.io.UncheckedPrintWriter;
import org.eclipse.jetty.io.BufferCache.CachedBuffer;
import org.eclipse.jetty.io.nio.SelectChannelEndPoint;
import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringUtil;
@ -672,7 +673,7 @@ public class HttpConnection implements Connection
_response.reset();
_generator.reset(true);
_generator.setResponse(HttpStatus.INTERNAL_SERVER_ERROR_500,null);
_generator.completeHeader(_responseFields,HttpGenerator.LAST);
_generator.completeHeader(_responseFields,Generator.LAST);
_generator.complete();
throw new HttpException(HttpStatus.INTERNAL_SERVER_ERROR_500);
}
@ -690,7 +691,7 @@ public class HttpConnection implements Connection
_generator.setResponse(_response.getStatus(), _response.getReason());
try
{
_generator.completeHeader(_responseFields, HttpGenerator.LAST);
_generator.completeHeader(_responseFields, Generator.LAST);
}
catch(IOException io)
{
@ -704,7 +705,7 @@ public class HttpConnection implements Connection
_response.reset();
_generator.reset(true);
_generator.setResponse(HttpStatus.INTERNAL_SERVER_ERROR_500,null);
_generator.completeHeader(_responseFields,HttpGenerator.LAST);
_generator.completeHeader(_responseFields,Generator.LAST);
_generator.complete();
throw new HttpException(HttpStatus.INTERNAL_SERVER_ERROR_500);
}
@ -718,7 +719,7 @@ public class HttpConnection implements Connection
{
try
{
commitResponse(HttpGenerator.MORE);
commitResponse(Generator.MORE);
_generator.flushBuffer();
}
catch(IOException e)
@ -792,6 +793,7 @@ public class HttpConnection implements Connection
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#startRequest(org.eclipse.io.Buffer,
* org.eclipse.io.Buffer, org.eclipse.io.Buffer)
*/
@Override
public void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException
{
_host = false;
@ -835,6 +837,7 @@ public class HttpConnection implements Connection
/*
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#parsedHeaderValue(org.eclipse.io.Buffer)
*/
@Override
public void parsedHeader(Buffer name, Buffer value)
{
int ho = HttpHeaders.CACHE.getOrdinal(name);
@ -939,6 +942,7 @@ public class HttpConnection implements Connection
/*
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#headerComplete()
*/
@Override
public void headerComplete() throws IOException
{
_requests++;
@ -989,6 +993,7 @@ public class HttpConnection implements Connection
/*
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#content(int, org.eclipse.io.Buffer)
*/
@Override
public void content(Buffer ref) throws IOException
{
if (_delayedHandling)
@ -1004,6 +1009,7 @@ public class HttpConnection implements Connection
*
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#messageComplete(int)
*/
@Override
public void messageComplete(long contentLength) throws IOException
{
if (_delayedHandling)
@ -1020,6 +1026,7 @@ public class HttpConnection implements Connection
* @see org.eclipse.jetty.server.server.HttpParser.EventHandler#startResponse(org.eclipse.io.Buffer, int,
* org.eclipse.io.Buffer)
*/
@Override
public void startResponse(Buffer version, int status, Buffer reason)
{
Log.debug("Bad request!: "+version+" "+status+" "+reason);
@ -1042,13 +1049,14 @@ public class HttpConnection implements Connection
/*
* @see java.io.OutputStream#close()
*/
@Override
public void close() throws IOException
{
if (_closed)
return;
if (!isIncluding() && !super._generator.isCommitted())
commitResponse(HttpGenerator.LAST);
commitResponse(Generator.LAST);
else
flushResponse();
@ -1060,10 +1068,11 @@ public class HttpConnection implements Connection
/*
* @see java.io.OutputStream#flush()
*/
@Override
public void flush() throws IOException
{
if (!super._generator.isCommitted())
commitResponse(HttpGenerator.MORE);
commitResponse(Generator.MORE);
super.flush();
}
@ -1071,6 +1080,7 @@ public class HttpConnection implements Connection
/*
* @see javax.servlet.ServletOutputStream#print(java.lang.String)
*/
@Override
public void print(String s) throws IOException
{
if (_closed)
@ -1151,8 +1161,8 @@ public class HttpConnection implements Connection
if (content instanceof Buffer)
{
super._generator.addContent((Buffer) content, HttpGenerator.LAST);
commitResponse(HttpGenerator.LAST);
super._generator.addContent((Buffer) content, Generator.LAST);
commitResponse(Generator.LAST);
}
else if (content instanceof InputStream)
{

View File

@ -36,6 +36,7 @@ public class HttpInput extends ServletInputStream
/*
* @see java.io.InputStream#read()
*/
@Override
public int read() throws IOException
{
int c=-1;
@ -49,6 +50,7 @@ public class HttpInput extends ServletInputStream
/*
* @see java.io.InputStream#read(byte[], int, int)
*/
@Override
public int read(byte[] b, int off, int len) throws IOException
{
int l=-1;

View File

@ -59,6 +59,7 @@ public class HttpOutput extends ServletOutputStream
/*
* @see java.io.OutputStream#close()
*/
@Override
public void close() throws IOException
{
_closed=true;
@ -71,12 +72,14 @@ public class HttpOutput extends ServletOutputStream
}
/* ------------------------------------------------------------ */
@Override
public void flush() throws IOException
{
_generator.flush(_maxIdleTime);
}
/* ------------------------------------------------------------ */
@Override
public void write(byte[] b, int off, int len) throws IOException
{
_buf.wrap(b, off, len);
@ -87,6 +90,7 @@ public class HttpOutput extends ServletOutputStream
/*
* @see java.io.OutputStream#write(byte[])
*/
@Override
public void write(byte[] b) throws IOException
{
_buf.wrap(b);
@ -97,6 +101,7 @@ public class HttpOutput extends ServletOutputStream
/*
* @see java.io.OutputStream#write(int)
*/
@Override
public void write(int b) throws IOException
{
if (_closed)
@ -166,6 +171,7 @@ public class HttpOutput extends ServletOutputStream
/*
* @see javax.servlet.ServletOutputStream#print(java.lang.String)
*/
@Override
public void print(String s) throws IOException
{
write(s.getBytes());

View File

@ -74,18 +74,21 @@ public class HttpWriter extends Writer
}
/* ------------------------------------------------------------ */
@Override
public void close() throws IOException
{
_out.close();
}
/* ------------------------------------------------------------ */
@Override
public void flush() throws IOException
{
_out.flush();
}
/* ------------------------------------------------------------ */
@Override
public void write (String s,int offset, int length) throws IOException
{
while (length > MAX_OUTPUT_CHARS)
@ -105,6 +108,7 @@ public class HttpWriter extends Writer
}
/* ------------------------------------------------------------ */
@Override
public void write (char[] s,int offset, int length) throws IOException
{
HttpOutput out = _out;

Some files were not shown because too many files have changed in this diff Show More