Merged branch 'origin/master' into 'jetty-http2'.

This commit is contained in:
Simone Bordet 2014-06-25 12:34:19 +02:00
commit 66f3913527
87 changed files with 686 additions and 367 deletions

View File

@ -62,6 +62,7 @@ public class ALPNServerConnection extends NegotiatingServerConnection implements
{
negotiated = getDefaultProtocol();
}
if (LOG.isDebugEnabled())
LOG.debug("{} protocol selected {}", this, negotiated);
setProtocol(negotiated);
ALPN.remove(getSSLEngine());

View File

@ -86,6 +86,7 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
if (result.isFailed())
{
Throwable failure = result.getFailure();
if (LOG.isDebugEnabled())
LOG.debug("Authentication challenge failed {}", failure);
forwardFailureComplete(request, result.getRequestFailure(), response, result.getResponseFailure());
return;
@ -95,6 +96,7 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
if (conversation.getAttribute(AUTHENTICATION_ATTRIBUTE) != null)
{
// We have already tried to authenticate, but we failed again
if (LOG.isDebugEnabled())
LOG.debug("Bad credentials for {}", request);
forwardSuccessComplete(request, response);
return;
@ -104,6 +106,7 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
List<Authentication.HeaderInfo> headerInfos = parseAuthenticateHeader(response, header);
if (headerInfos.isEmpty())
{
if (LOG.isDebugEnabled())
LOG.debug("Authentication challenge without {} header", header);
forwardFailureComplete(request, null, response, new HttpResponseException("HTTP protocol violation: Authentication challenge without " + header + " header", response));
return;
@ -126,12 +129,14 @@ public abstract class AuthenticationProtocolHandler implements ProtocolHandler
}
if (authentication == null)
{
if (LOG.isDebugEnabled())
LOG.debug("No authentication available for {}", request);
forwardSuccessComplete(request, response);
return;
}
final Authentication.Result authnResult = authentication.authenticate(request, response, headerInfo, conversation);
if (LOG.isDebugEnabled())
LOG.debug("Authentication result {}", authnResult);
if (authnResult == null)
{

View File

@ -81,6 +81,7 @@ public class ConnectionPool implements Closeable, Dumpable
if (next > maxConnections)
{
if (LOG.isDebugEnabled())
LOG.debug("Max connections {}/{} reached", current, maxConnections);
// Try again the idle connections
return acquireIdleConnection();
@ -88,6 +89,7 @@ public class ConnectionPool implements Closeable, Dumpable
if (connectionCount.compareAndSet(current, next))
{
if (LOG.isDebugEnabled())
LOG.debug("Connection {}/{} creation", next, maxConnections);
destination.newConnection(new Promise<Connection>()
@ -95,6 +97,7 @@ public class ConnectionPool implements Closeable, Dumpable
@Override
public void succeeded(Connection connection)
{
if (LOG.isDebugEnabled())
LOG.debug("Connection {}/{} creation succeeded {}", next, maxConnections, connection);
if (activate(connection))
connectionPromise.succeeded(connection);
@ -103,6 +106,7 @@ public class ConnectionPool implements Closeable, Dumpable
@Override
public void failed(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Connection " + next + "/" + maxConnections + " creation failed", x);
connectionCount.decrementAndGet();
connectionPromise.failed(x);
@ -127,12 +131,14 @@ public class ConnectionPool implements Closeable, Dumpable
{
if (activeConnections.offer(connection))
{
if (LOG.isDebugEnabled())
LOG.debug("Connection active {}", connection);
acquired(connection);
return true;
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Connection active overflow {}", connection);
connection.close();
return false;
@ -151,11 +157,13 @@ public class ConnectionPool implements Closeable, Dumpable
// Make sure we use "hot" connections first
if (idleConnections.offerFirst(connection))
{
if (LOG.isDebugEnabled())
LOG.debug("Connection idle {}", connection);
return true;
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Connection idle overflow {}", connection);
connection.close();
}
@ -177,6 +185,7 @@ public class ConnectionPool implements Closeable, Dumpable
if (removed)
{
int pooled = connectionCount.decrementAndGet();
if (LOG.isDebugEnabled())
LOG.debug("Connection removed {} - pooled: {}", connection, pooled);
}
return removed;

View File

@ -46,6 +46,7 @@ public abstract class HttpChannel
if (this.exchange.compareAndSet(null, exchange))
{
exchange.associate(this);
if (LOG.isDebugEnabled())
LOG.debug("{} associated to {}", exchange, this);
}
else
@ -59,6 +60,7 @@ public abstract class HttpChannel
HttpExchange exchange = this.exchange.getAndSet(null);
if (exchange != null)
exchange.disassociate(this);
if (LOG.isDebugEnabled())
LOG.debug("{} disassociated from {}", exchange, this);
return exchange;
}

View File

@ -480,9 +480,14 @@ public class HttpClient extends ContainerLifeCycle
{
HttpDestination existing = destinations.putIfAbsent(origin, destination);
if (existing != null)
{
destination = existing;
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Created {}", destination);
}
if (!isRunning())
destinations.remove(origin);
}

View File

@ -130,6 +130,7 @@ public class HttpContent implements Callback, Closeable
if (content != AFTER)
{
content = buffer = AFTER;
if (LOG.isDebugEnabled())
LOG.debug("Advanced content past last chunk");
}
return false;

View File

@ -175,6 +175,7 @@ public abstract class HttpDestination implements Destination, Closeable, Dumpabl
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Queued {}", request);
requestNotifier.notifyQueued(request);
send();
@ -182,6 +183,7 @@ public abstract class HttpDestination implements Destination, Closeable, Dumpabl
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Max queue size {} exceeded by {}", client.getMaxRequestsQueuedPerDestination(), request);
request.abort(new RejectedExecutionException("Max requests per destination " + client.getMaxRequestsQueuedPerDestination() + " exceeded for " + this));
}

View File

@ -151,6 +151,7 @@ public class HttpExchange
if ((current & terminated) == terminated)
{
// Request and response terminated
if (LOG.isDebugEnabled())
LOG.debug("{} terminated", this);
return new Result(getRequest(), getRequestFailure(), getResponse(), getResponseFailure());
}
@ -174,6 +175,7 @@ public class HttpExchange
requestFailure = failure;
if ((code & 0b0100) == 0b0100)
responseFailure = failure;
if (LOG.isDebugEnabled())
LOG.debug("{} updated", this);
}
break;
@ -185,6 +187,7 @@ public class HttpExchange
{
if (destination.remove(this))
{
if (LOG.isDebugEnabled())
LOG.debug("Aborting while queued {}: {}", this, cause);
return fail(cause);
}
@ -195,6 +198,7 @@ public class HttpExchange
return fail(cause);
boolean aborted = channel.abort(cause);
if (LOG.isDebugEnabled())
LOG.debug("Aborted while active ({}) {}: {}", aborted, this, cause);
return aborted;
}
@ -204,6 +208,7 @@ public class HttpExchange
{
if (update(0b0101, cause) == 0b0101)
{
if (LOG.isDebugEnabled())
LOG.debug("Failing {}: {}", this, cause);
destination.getRequestNotifier().notifyFailure(request, cause);
List<Response.ResponseListener> listeners = getConversation().getResponseListeners();

View File

@ -186,6 +186,7 @@ public class HttpProxy extends ProxyConfiguration.Proxy
// Avoid setting fill interest in the old Connection,
// without closing the underlying EndPoint.
oldConnection.softClose();
if (LOG.isDebugEnabled())
LOG.debug("HTTP tunnel established: {} over {}", oldConnection, newConnection);
}
catch (Throwable x)

View File

@ -117,10 +117,12 @@ public abstract class HttpReceiver
if (protocolHandler != null)
{
handlerListener = protocolHandler.getResponseListener();
if (LOG.isDebugEnabled())
LOG.debug("Found protocol handler {}", protocolHandler);
}
exchange.getConversation().updateResponseListeners(handlerListener);
if (LOG.isDebugEnabled())
LOG.debug("Response begin {}", response);
ResponseNotifier notifier = destination.getResponseNotifier();
notifier.notifyBegin(conversation.getResponseListeners(), response);
@ -337,6 +339,7 @@ public abstract class HttpReceiver
Result result = exchange.terminateResponse(null);
HttpResponse response = exchange.getResponse();
if (LOG.isDebugEnabled())
LOG.debug("Response success {}", response);
List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners();
ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
@ -347,6 +350,7 @@ public abstract class HttpReceiver
boolean ordered = getHttpDestination().getHttpClient().isStrictEventOrdering();
if (!ordered)
channel.exchangeTerminated(result);
if (LOG.isDebugEnabled())
LOG.debug("Request/Response succeeded {}", response);
notifier.notifyComplete(listeners, result);
if (ordered)
@ -388,6 +392,7 @@ public abstract class HttpReceiver
Result result = exchange.terminateResponse(failure);
HttpResponse response = exchange.getResponse();
if (LOG.isDebugEnabled())
LOG.debug("Response failure {} {}", response, failure);
List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners();
ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
@ -398,6 +403,7 @@ public abstract class HttpReceiver
boolean ordered = getHttpDestination().getHttpClient().isStrictEventOrdering();
if (!ordered)
channel.exchangeTerminated(result);
if (LOG.isDebugEnabled())
LOG.debug("Request/Response failed {}", response);
notifier.notifyComplete(listeners, result);
if (ordered)

View File

@ -156,6 +156,7 @@ public class HttpRedirector
URI newURI = extractRedirectURI(response);
if (newURI != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Redirecting to {} (Location: {})", newURI, location);
return redirect(request, response, listener, newURI);
}

View File

@ -99,6 +99,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
SenderState newSenderState = SenderState.SENDING;
if (updateSenderState(current, newSenderState))
{
if (LOG.isDebugEnabled())
LOG.debug("Deferred content available, {} -> {}", current, newSenderState);
contentCallback.iterate();
return;
@ -110,6 +111,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
SenderState newSenderState = SenderState.SENDING_WITH_CONTENT;
if (updateSenderState(current, newSenderState))
{
if (LOG.isDebugEnabled())
LOG.debug("Deferred content available, {} -> {}", current, newSenderState);
return;
}
@ -120,6 +122,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
SenderState newSenderState = SenderState.EXPECTING_WITH_CONTENT;
if (updateSenderState(current, newSenderState))
{
if (LOG.isDebugEnabled())
LOG.debug("Deferred content available, {} -> {}", current, newSenderState);
return;
}
@ -130,6 +133,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
SenderState newSenderState = SenderState.PROCEEDING_WITH_CONTENT;
if (updateSenderState(current, newSenderState))
{
if (LOG.isDebugEnabled())
LOG.debug("Deferred content available, {} -> {}", current, newSenderState);
return;
}
@ -140,6 +144,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
case PROCEEDING_WITH_CONTENT:
case WAITING:
{
if (LOG.isDebugEnabled())
LOG.debug("Deferred content available, {}", current);
return;
}
@ -194,6 +199,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
{
if (!updateRequestState(RequestState.QUEUED, RequestState.BEGIN))
return false;
if (LOG.isDebugEnabled())
LOG.debug("Request begin {}", request);
RequestNotifier notifier = getHttpChannel().getHttpDestination().getRequestNotifier();
notifier.notifyBegin(request);
@ -215,6 +221,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
{
if (!updateRequestState(RequestState.HEADERS, RequestState.COMMIT))
return false;
if (LOG.isDebugEnabled())
LOG.debug("Request committed {}", request);
RequestNotifier notifier = getHttpChannel().getHttpDestination().getRequestNotifier();
notifier.notifyCommit(request);
@ -272,6 +279,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
// It is important to notify completion *after* we reset because
// the notification may trigger another request/response
Request request = exchange.getRequest();
if (LOG.isDebugEnabled())
LOG.debug("Request success {}", request);
HttpDestination destination = getHttpChannel().getHttpDestination();
destination.getRequestNotifier().notifySuccess(exchange.getRequest());
@ -281,6 +289,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
boolean ordered = destination.getHttpClient().isStrictEventOrdering();
if (!ordered)
channel.exchangeTerminated(result);
if (LOG.isDebugEnabled())
LOG.debug("Request/Response succeded {}", request);
HttpConversation conversation = exchange.getConversation();
destination.getResponseNotifier().notifyComplete(conversation.getResponseListeners(), result);
@ -321,6 +330,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
Result result = exchange.terminateRequest(failure);
Request request = exchange.getRequest();
if (LOG.isDebugEnabled())
LOG.debug("Request failure {} {}", exchange, failure);
HttpDestination destination = getHttpChannel().getHttpDestination();
destination.getRequestNotifier().notifyFailure(request, failure);
@ -332,6 +342,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
if (exchange.responseComplete())
{
result = exchange.terminateResponse(failure);
if (LOG.isDebugEnabled())
LOG.debug("Failed response from request {}", exchange);
}
}
@ -341,6 +352,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
boolean ordered = destination.getHttpClient().isStrictEventOrdering();
if (!ordered)
channel.exchangeTerminated(result);
if (LOG.isDebugEnabled())
LOG.debug("Request/Response failed {}", request);
HttpConversation conversation = exchange.getConversation();
destination.getResponseNotifier().notifyComplete(conversation.getResponseListeners(), result);
@ -426,6 +438,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
// We are still sending the headers, but we already got the 100 Continue.
if (updateSenderState(current, SenderState.PROCEEDING))
{
if (LOG.isDebugEnabled())
LOG.debug("Proceeding while expecting");
return;
}
@ -441,6 +454,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
// WritePendingException).
if (updateSenderState(current, SenderState.PROCEEDING_WITH_CONTENT))
{
if (LOG.isDebugEnabled())
LOG.debug("Proceeding while scheduled");
return;
}
@ -451,6 +465,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
// We received the 100 Continue, now send the content if any.
if (!updateSenderState(current, SenderState.SENDING))
throw illegalSenderState(current);
if (LOG.isDebugEnabled())
LOG.debug("Proceeding while waiting");
contentCallback.iterate();
return;

View File

@ -94,6 +94,7 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
{
HttpClient client = getHttpClient();
final HttpExchange exchange = getHttpExchanges().poll();
if (LOG.isDebugEnabled())
LOG.debug("Processing {} on {}", exchange, connection);
if (exchange == null)
return false;
@ -102,6 +103,7 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
Throwable cause = request.getAbortCause();
if (cause != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Aborted before processing {}: {}", exchange, cause);
// It may happen that the request is aborted before the exchange
// is created. Aborting the exchange a second time will result in

View File

@ -93,6 +93,7 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
{
HttpClient client = getHttpClient();
final HttpExchange exchange = getHttpExchanges().poll();
if (LOG.isDebugEnabled())
LOG.debug("Processing exchange {} on connection {}", exchange, connection);
if (exchange == null)
{
@ -101,6 +102,7 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
if (!client.isRunning())
{
if (LOG.isDebugEnabled())
LOG.debug("{} is stopping", client);
connection.close();
}
@ -111,6 +113,7 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
Throwable cause = request.getAbortCause();
if (cause != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Aborted before processing {}: {}", exchange, cause);
// It may happen that the request is aborted before the exchange
// is created. Aborting the exchange a second time will result in
@ -145,17 +148,24 @@ public abstract class PoolingHttpDestination<C extends Connection> extends HttpD
{
@SuppressWarnings("unchecked")
C connection = (C)c;
if (LOG.isDebugEnabled())
LOG.debug("{} released", connection);
HttpClient client = getHttpClient();
if (client.isRunning())
{
if (connectionPool.isActive(connection))
{
process(connection, false);
else
LOG.debug("{} explicit", connection);
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("{} explicit", connection);
}
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("{} is stopped", client);
close(connection);
connection.close();

View File

@ -133,6 +133,7 @@ public class Socks4Proxy extends ProxyConfiguration.Proxy
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("Written SOCKS4 connect request");
fillInterested();
}
@ -153,6 +154,7 @@ public class Socks4Proxy extends ProxyConfiguration.Proxy
{
ByteBuffer buffer = BufferUtil.allocate(8);
int filled = getEndPoint().fill(buffer);
if (LOG.isDebugEnabled())
LOG.debug("Read SOCKS4 connect response, {} bytes", filled);
if (filled != 8)
throw new IOException("Invalid response from SOCKS4 proxy");
@ -179,6 +181,7 @@ public class Socks4Proxy extends ProxyConfiguration.Proxy
connectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
org.eclipse.jetty.io.Connection connection = connectionFactory.newConnection(getEndPoint(), context);
ClientConnectionFactory.Helper.replaceConnection(this, connection);
if (LOG.isDebugEnabled())
LOG.debug("SOCKS4 tunnel established: {} over {}", this, connection);
}
catch (Throwable x)

View File

@ -48,6 +48,7 @@ public class TimeoutCompleteListener implements Response.CompleteListener, Runna
if (task != null)
{
boolean cancelled = task.cancel();
if (LOG.isDebugEnabled())
LOG.debug("Cancelled (successfully: {}) timeout task {}", cancelled, task);
}
}
@ -58,6 +59,7 @@ public class TimeoutCompleteListener implements Response.CompleteListener, Runna
Scheduler.Task task = scheduler.schedule(this, timeout, TimeUnit.MILLISECONDS);
if (this.task.getAndSet(task) != null)
throw new IllegalStateException();
if (LOG.isDebugEnabled())
LOG.debug("Scheduled timeout task {} in {} ms for {}", task, timeout, request);
return true;
}
@ -65,6 +67,7 @@ public class TimeoutCompleteListener implements Response.CompleteListener, Runna
@Override
public void run()
{
if (LOG.isDebugEnabled())
LOG.debug("Executing timeout task {} for {}", task, request);
request.abort(new TimeoutException("Total timeout elapsed"));
}

View File

@ -85,6 +85,7 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec
@Override
protected boolean onReadTimeout()
{
if (LOG.isDebugEnabled())
LOG.debug("{} idle timeout", this);
close(new TimeoutException());
return false;
@ -127,8 +128,10 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec
// from an onFailure() handler or by blocking code waiting for completion.
getHttpDestination().close(this);
getEndPoint().shutdownOutput();
if (LOG.isDebugEnabled())
LOG.debug("{} oshut", this);
getEndPoint().close();
if (LOG.isDebugEnabled())
LOG.debug("{} closed", this);
abort(failure);

View File

@ -227,6 +227,7 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
@Override
public void resume()
{
if (LOG.isDebugEnabled())
LOG.debug("Content consumed asynchronously, resuming processing");
process();
}

View File

@ -149,6 +149,7 @@ public class InputStreamContentProvider implements ContentProvider
byte[] bytes = new byte[bufferSize];
int read = stream.read(bytes);
if (LOG.isDebugEnabled())
LOG.debug("Read {} bytes from {}", read, stream);
if (read > 0)
{

View File

@ -116,22 +116,26 @@ public class InputStreamResponseListener extends Listener.Adapter
byte[] bytes = new byte[remaining];
content.get(bytes);
if (LOG.isDebugEnabled())
LOG.debug("Queuing {}/{} bytes", bytes, remaining);
queue.offer(bytes);
long newLength = length.addAndGet(remaining);
while (newLength >= maxBufferSize)
{
if (LOG.isDebugEnabled())
LOG.debug("Queued bytes limit {}/{} exceeded, waiting", newLength, maxBufferSize);
// Block to avoid infinite buffering
if (!await())
break;
newLength = length.get();
if (LOG.isDebugEnabled())
LOG.debug("Queued bytes limit {}/{} exceeded, woken up", newLength, maxBufferSize);
}
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Queuing skipped, empty content {}", content);
}
}
@ -147,11 +151,13 @@ public class InputStreamResponseListener extends Listener.Adapter
this.result = result;
if (result.isSucceeded())
{
if (LOG.isDebugEnabled())
LOG.debug("Queuing end of content {}{}", EOF, "");
queue.offer(EOF);
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Queuing failure {} {}", FAILURE, failure);
queue.offer(FAILURE);
this.failure = result.getFailure();
@ -288,6 +294,7 @@ public class InputStreamResponseListener extends Listener.Adapter
else
{
bytes = take();
if (LOG.isDebugEnabled())
LOG.debug("Dequeued {}/{} bytes", bytes, bytes.length);
}
}
@ -319,6 +326,7 @@ public class InputStreamResponseListener extends Listener.Adapter
if (!closed)
{
super.close();
if (LOG.isDebugEnabled())
LOG.debug("Queuing close {}{}", CLOSED, "");
queue.offer(CLOSED);
closed = true;

View File

@ -107,6 +107,7 @@ public class PathContentProvider extends AbstractTypedContentProvider
if (channel == null)
{
channel = Files.newByteChannel(filePath, StandardOpenOption.READ);
if (LOG.isDebugEnabled())
LOG.debug("Opened file {}", filePath);
}

View File

@ -70,6 +70,7 @@ public class HttpClientTransportOverFCGI extends AbstractHttpClientTransport
{
HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
HttpConnectionOverFCGI connection = new HttpConnectionOverFCGI(endPoint, destination, isMultiplexed());
if (LOG.isDebugEnabled())
LOG.debug("Created {}", connection);
@SuppressWarnings("unchecked")
Promise<Connection> promise = (Promise<Connection>)context.get(HTTP_CONNECTION_PROMISE_CONTEXT_KEY);

View File

@ -415,6 +415,7 @@ public class HttpConnectionOverFCGI extends AbstractConnection implements Connec
private void noChannel(int request)
{
if (LOG.isDebugEnabled())
LOG.debug("Channel not found for request {}", request);
}
}

View File

@ -137,6 +137,7 @@ public class Flusher
private void shutdown()
{
if (LOG.isDebugEnabled())
LOG.debug("Shutting down {}", endPoint);
endPoint.shutdownOutput();
}

View File

@ -89,6 +89,7 @@ public class ResponseContentParser extends StreamContentParser
public boolean parse(ByteBuffer buffer)
{
if (LOG.isDebugEnabled())
LOG.debug("Response {} {} content {} {}", request, FCGI.StreamType.STD_OUT, state, buffer);
int remaining = buffer.remaining();

View File

@ -137,6 +137,7 @@ public class HttpChannelOverFCGI extends HttpChannel
while (true)
{
State current = state.get();
if (LOG.isDebugEnabled())
LOG.debug("Dispatching, state={}", current);
switch (current)
{
@ -172,6 +173,7 @@ public class HttpChannelOverFCGI extends HttpChannel
while (true)
{
State current = state.get();
if (LOG.isDebugEnabled())
LOG.debug("Running, state={}", current);
switch (current)
{

View File

@ -287,6 +287,7 @@ public class HttpGenerator
{
if (BufferUtil.hasContent(content))
{
if (LOG.isDebugEnabled())
LOG.debug("discarding content in COMPLETING");
BufferUtil.clear(content);
}
@ -310,6 +311,7 @@ public class HttpGenerator
case END:
if (BufferUtil.hasContent(content))
{
if (LOG.isDebugEnabled())
LOG.debug("discarding content in COMPLETING");
BufferUtil.clear(content);
}
@ -436,6 +438,7 @@ public class HttpGenerator
{
if (BufferUtil.hasContent(content))
{
if (LOG.isDebugEnabled())
LOG.debug("discarding content in COMPLETING");
BufferUtil.clear(content);
}
@ -462,6 +465,7 @@ public class HttpGenerator
case END:
if (BufferUtil.hasContent(content))
{
if (LOG.isDebugEnabled())
LOG.debug("discarding content in COMPLETING");
BufferUtil.clear(content);
}

View File

@ -124,6 +124,7 @@ public abstract class AbstractConnection implements Connection
*/
public void fillInterested()
{
if (LOG.isDebugEnabled())
LOG.debug("fillInterested {}",this);
while(true)
@ -136,6 +137,7 @@ public abstract class AbstractConnection implements Connection
public void fillInterested(Callback callback)
{
if (LOG.isDebugEnabled())
LOG.debug("fillInterested {}",this);
while(true)
@ -162,6 +164,7 @@ public abstract class AbstractConnection implements Connection
*/
protected void onFillInterestedFailed(Throwable cause)
{
if (LOG.isDebugEnabled())
LOG.debug("{} onFillInterestedFailed {}", this, cause);
if (_endPoint.isOpen())
{
@ -193,6 +196,7 @@ public abstract class AbstractConnection implements Connection
@Override
public void onOpen()
{
if (LOG.isDebugEnabled())
LOG.debug("onOpen {}", this);
for (Listener listener : listeners)
@ -202,6 +206,7 @@ public abstract class AbstractConnection implements Connection
@Override
public void onClose()
{
if (LOG.isDebugEnabled())
LOG.debug("onClose {}",this);
for (Listener listener : listeners)
@ -262,6 +267,7 @@ public abstract class AbstractConnection implements Connection
return true;
if(_state.compareAndSet(state,next))
{
if (LOG.isDebugEnabled())
LOG.debug("{}-->{} {}",state,next,this);
if (next!=state)
next.onEnter(AbstractConnection.this);

View File

@ -94,6 +94,7 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
@Override
public void onOpen()
{
if (LOG.isDebugEnabled())
LOG.debug("onOpen {}",this);
super.onOpen();
}
@ -102,6 +103,7 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
public void onClose()
{
super.onClose();
if (LOG.isDebugEnabled())
LOG.debug("onClose {}",this);
_writeFlusher.onClose();
_fillInterest.onClose();

View File

@ -61,6 +61,7 @@ public class ChannelEndPoint extends AbstractEndPoint
protected void shutdownInput()
{
if (LOG.isDebugEnabled())
LOG.debug("ishut {}", this);
_ishut=true;
if (_oshut)
@ -70,6 +71,7 @@ public class ChannelEndPoint extends AbstractEndPoint
@Override
public void shutdownOutput()
{
if (LOG.isDebugEnabled())
LOG.debug("oshut {}", this);
_oshut = true;
if (_channel.isOpen())
@ -109,6 +111,7 @@ public class ChannelEndPoint extends AbstractEndPoint
public void close()
{
super.close();
if (LOG.isDebugEnabled())
LOG.debug("close {}", this);
try
{

View File

@ -142,12 +142,14 @@ public abstract class IdleTimeout
long idleElapsed = System.currentTimeMillis() - idleTimestamp;
long idleLeft = idleTimeout - idleElapsed;
if (LOG.isDebugEnabled())
LOG.debug("{} idle timeout check, elapsed: {} ms, remaining: {} ms", this, idleElapsed, idleLeft);
if (idleTimestamp != 0 && idleTimeout > 0)
{
if (idleLeft <= 0)
{
if (LOG.isDebugEnabled())
LOG.debug("{} idle timeout expired", this);
try
{

View File

@ -132,17 +132,20 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements SelectorMa
{
if (_interestOps.compareAndSet(oldInterestOps, newInterestOps))
{
if (LOG.isDebugEnabled())
LOG.debug("Local interests updated {} -> {} for {}", oldInterestOps, newInterestOps, this);
_selector.updateKey(_updateTask);
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Local interests update conflict: now {}, was {}, attempted {} for {}", _interestOps.get(), oldInterestOps, newInterestOps, this);
continue;
}
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Ignoring local interests update {} -> {} for {}", oldInterestOps, newInterestOps, this);
}
break;
@ -152,6 +155,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements SelectorMa
private void setKeyInterests(int oldInterestOps, int newInterestOps)
{
if (LOG.isDebugEnabled())
LOG.debug("Key interests updated {} -> {}", oldInterestOps, newInterestOps);
_key.interestOps(newInterestOps);
}

View File

@ -377,10 +377,12 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
@Override
protected void doStop() throws Exception
{
if (LOG.isDebugEnabled())
LOG.debug("Stopping {}", this);
Stop stop = new Stop();
submit(stop);
stop.await(getStopTimeout());
if (LOG.isDebugEnabled())
LOG.debug("Stopped {}", this);
}
@ -419,6 +421,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
// change to the queue and process the state.
_changes.offer(change);
if (LOG.isDebugEnabled())
LOG.debug("Queued change {}", change);
out: while (true)
@ -463,6 +466,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
{
try
{
if (LOG.isDebugEnabled())
LOG.debug("Running change {}", change);
change.run();
}
@ -480,6 +484,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
try
{
_thread.setName(name + "-selector-" + SelectorManager.this.getClass().getSimpleName()+"@"+Integer.toHexString(SelectorManager.this.hashCode())+"/"+_id);
if (LOG.isDebugEnabled())
LOG.debug("Starting {} on {}", _thread, this);
while (isRunning())
select();
@ -487,6 +492,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
}
finally
{
if (LOG.isDebugEnabled())
LOG.debug("Stopped {} on {}", _thread, this);
_thread.setName(name);
}
@ -671,12 +677,14 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
Connection connection = newConnection(channel, endPoint, selectionKey.attachment());
endPoint.setConnection(connection);
connectionOpened(connection);
if (LOG.isDebugEnabled())
LOG.debug("Created {}", endPoint);
return endPoint;
}
public void destroyEndPoint(EndPoint endPoint)
{
if (LOG.isDebugEnabled())
LOG.debug("Destroyed {}", endPoint);
Connection connection = endPoint.getConnection();
if (connection != null)
@ -792,6 +800,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
try
{
SelectionKey key = _channel.register(_selector, SelectionKey.OP_ACCEPT, null);
if (LOG.isDebugEnabled())
LOG.debug("{} acceptor={}", this, key);
}
catch (Throwable x)
@ -881,6 +890,7 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
SocketChannel channel = connect.channel;
if (channel.isConnectionPending())
{
if (LOG.isDebugEnabled())
LOG.debug("Channel {} timed out while connecting, closing it", channel);
connect.failed(new SocketTimeoutException());
}

View File

@ -129,6 +129,7 @@ public class UncheckedPrintWriter extends PrintWriter
_ioException.initCause(th);
}
if (LOG.isDebugEnabled())
LOG.debug(th);
}

View File

@ -128,6 +128,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable
@Override
public void beanAdded(Container parent, Object obj)
{
if (LOG.isDebugEnabled())
LOG.debug("beanAdded {}->{}",parent,obj);
// Is their an object name for the parent
@ -206,6 +207,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable
}
ObjectInstance oinstance = _mbeanServer.registerMBean(mbean, oname);
if (LOG.isDebugEnabled())
LOG.debug("Registered {}", oinstance.getObjectName());
_beans.put(obj, oinstance.getObjectName());
@ -219,6 +221,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable
@Override
public void beanRemoved(Container parent, Object obj)
{
if (LOG.isDebugEnabled())
LOG.debug("beanRemoved {}",obj);
ObjectName bean = _beans.remove(obj);
@ -227,6 +230,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable
try
{
_mbeanServer.unregisterMBean(bean);
if (LOG.isDebugEnabled())
LOG.debug("Unregistered {}", bean);
}
catch (javax.management.InstanceNotFoundException e)

View File

@ -132,6 +132,7 @@ public class ObjectMBean implements DynamicMBean
{
Class<?> mClass = (Object.class.equals(oClass))?oClass=ObjectMBean.class:Loader.loadClass(oClass,mName);
if (LOG.isDebugEnabled())
LOG.debug("ObjectMbean: mbeanFor {} mClass={}", o, mClass);
try
@ -149,6 +150,7 @@ public class ObjectMBean implements DynamicMBean
}
}
if (LOG.isDebugEnabled())
LOG.debug("mbeanFor {} is {}", o, mbean);
return mbean;
@ -241,6 +243,7 @@ public class ObjectMBean implements DynamicMBean
Class<?> o_class=_managed.getClass();
List<Class<?>> influences = findInfluences(new ArrayList<Class<?>>(), _managed.getClass());
if (LOG.isDebugEnabled())
LOG.debug("Influence Count: {}", influences.size() );
// Process Type Annotations
@ -252,6 +255,7 @@ public class ObjectMBean implements DynamicMBean
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("No @ManagedObject declared on {}", _managed.getClass());
}
@ -263,9 +267,12 @@ public class ObjectMBean implements DynamicMBean
ManagedObject typeAnnotation = oClass.getAnnotation( ManagedObject.class );
if (LOG.isDebugEnabled())
LOG.debug("Influenced by: " + oClass.getCanonicalName() );
if ( typeAnnotation == null )
{
if (LOG.isDebugEnabled())
LOG.debug("Annotations not found for: {}", oClass.getCanonicalName() );
continue;
}
@ -279,6 +286,7 @@ public class ObjectMBean implements DynamicMBean
if (methodAttributeAnnotation != null)
{
// TODO sort out how a proper name could get here, its a method name as an attribute at this point.
if (LOG.isDebugEnabled())
LOG.debug("Attribute Annotation found for: {}", method.getName());
MBeanAttributeInfo mai = defineAttribute(method,methodAttributeAnnotation);
if ( mai != null )
@ -291,9 +299,9 @@ public class ObjectMBean implements DynamicMBean
if (methodOperationAnnotation != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Method Annotation found for: {}", method.getName());
MBeanOperationInfo oi = defineOperation(method,methodOperationAnnotation);
if (oi != null)
{
operations.add(oi);
@ -480,6 +488,7 @@ public class ObjectMBean implements DynamicMBean
/* ------------------------------------------------------------ */
public AttributeList setAttributes(AttributeList attrs)
{
if (LOG.isDebugEnabled())
LOG.debug("setAttributes");
AttributeList results = new AttributeList(attrs.size());
@ -503,6 +512,7 @@ public class ObjectMBean implements DynamicMBean
/* ------------------------------------------------------------ */
public Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException
{
if (LOG.isDebugEnabled())
LOG.debug("ObjectMBean:invoke " + name);
String methodKey = name + "(";
@ -562,11 +572,13 @@ public class ObjectMBean implements DynamicMBean
try
{
Class<?> mbeanClazz = Class.forName(mName);
if (LOG.isDebugEnabled())
LOG.debug("MBean Influence found for " + aClass.getSimpleName());
influences.add(mbeanClazz);
}
catch (ClassNotFoundException cnfe)
{
if (LOG.isDebugEnabled())
LOG.debug("No MBean Influence for " + aClass.getSimpleName());
}
@ -637,6 +649,7 @@ public class ObjectMBean implements DynamicMBean
String uName = name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1);
Class<?> oClass = onMBean ? this.getClass() : _managed.getClass();
if (LOG.isDebugEnabled())
LOG.debug("defineAttribute {} {}:{}:{}:{}",name,onMBean,readonly,oClass,description);
Method setter = null;
@ -646,7 +659,9 @@ public class ObjectMBean implements DynamicMBean
{
String declaredSetter = attributeAnnotation.setter();
if (LOG.isDebugEnabled())
LOG.debug("DeclaredSetter: {}", declaredSetter);
Method[] methods = oClass.getMethods();
for (int m = 0; m < methods.length; m++)
{
@ -670,6 +685,7 @@ public class ObjectMBean implements DynamicMBean
LOG.warn("Type conflict for mbean attr {} in {}", name, oClass);
continue;
}
if (LOG.isDebugEnabled())
LOG.debug("Declared Setter: " + declaredSetter);
}
}
@ -705,6 +721,7 @@ public class ObjectMBean implements DynamicMBean
LOG.warn("Cannot convert mbean primative {}", name);
return null;
}
if (LOG.isDebugEnabled())
LOG.debug("passed convert checks {} for type {}", name, component_type);
}
@ -772,6 +789,7 @@ public class ObjectMBean implements DynamicMBean
if ( returnType.isArray() )
{
if (LOG.isDebugEnabled())
LOG.debug("returnType is array, get component type");
returnType = returnType.getComponentType();
}
@ -783,7 +801,7 @@ public class ObjectMBean implements DynamicMBean
String impactName = methodAnnotation.impact();
if (LOG.isDebugEnabled())
LOG.debug("defineOperation {} {}:{}:{}", method.getName(), onMBean, impactName, description);
String signature = method.getName();
@ -836,6 +854,8 @@ public class ObjectMBean implements DynamicMBean
signature += ")";
Class<?> returnClass = method.getReturnType();
if (LOG.isDebugEnabled())
LOG.debug("Method Cache: " + signature );
if ( _methods.containsKey(signature) )

View File

@ -53,6 +53,7 @@ public class NPNServerConnection extends NegotiatingServerConnection implements
@Override
public void protocolSelected(String protocol)
{
if (LOG.isDebugEnabled())
LOG.debug("{} protocol selected {}", this, protocol);
setProtocol(protocol != null ? protocol : getDefaultProtocol());
NextProtoNego.remove(getSSLEngine());

View File

@ -186,6 +186,7 @@ public class ConnectHandler extends HandlerWrapper
if (HttpMethod.CONNECT.is(request.getMethod()))
{
String serverAddress = request.getRequestURI();
if (LOG.isDebugEnabled())
LOG.debug("CONNECT request for {}", serverAddress);
try
{
@ -222,6 +223,7 @@ public class ConnectHandler extends HandlerWrapper
boolean proceed = handleAuthentication(request, response, serverAddress);
if (!proceed)
{
if (LOG.isDebugEnabled())
LOG.debug("Missing proxy authentication");
sendConnectResponse(request, response, HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED);
return;
@ -238,6 +240,7 @@ public class ConnectHandler extends HandlerWrapper
if (!validateDestination(host, port))
{
if (LOG.isDebugEnabled())
LOG.debug("Destination {}:{} forbidden", host, port);
sendConnectResponse(request, response, HttpServletResponse.SC_FORBIDDEN);
return;
@ -252,6 +255,7 @@ public class ConnectHandler extends HandlerWrapper
AsyncContext asyncContext = request.startAsync();
asyncContext.setTimeout(0);
if (LOG.isDebugEnabled())
LOG.debug("Connecting to {}", address);
ConnectContext connectContext = new ConnectContext(request, response, asyncContext, HttpConnection.getCurrentConnection());
selector.connect(channel, connectContext);
@ -286,6 +290,7 @@ public class ConnectHandler extends HandlerWrapper
upstreamConnection.setConnection(downstreamConnection);
downstreamConnection.setConnection(upstreamConnection);
if (LOG.isDebugEnabled())
LOG.debug("Connection setup completed: {}<->{}", downstreamConnection, upstreamConnection);
HttpServletResponse response = connectContext.getResponse();
@ -297,6 +302,7 @@ public class ConnectHandler extends HandlerWrapper
protected void onConnectFailure(HttpServletRequest request, HttpServletResponse response, AsyncContext asyncContext, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("CONNECT failed", failure);
sendConnectResponse(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
if (asyncContext != null)
@ -311,6 +317,7 @@ public class ConnectHandler extends HandlerWrapper
if (statusCode != HttpServletResponse.SC_OK)
response.setHeader(HttpHeader.CONNECTION.asString(), HttpHeaderValue.CLOSE.asString());
response.getOutputStream().close();
if (LOG.isDebugEnabled())
LOG.debug("CONNECT response sent {} {}", request.getProtocol(), response.getStatus());
}
catch (IOException x)
@ -353,6 +360,7 @@ public class ConnectHandler extends HandlerWrapper
// so that Jetty understands that it has to upgrade the connection
request.setAttribute(HttpConnection.UPGRADE_CONNECTION_ATTRIBUTE, connection);
response.setStatus(HttpServletResponse.SC_SWITCHING_PROTOCOLS);
if (LOG.isDebugEnabled())
LOG.debug("Upgraded connection to {}", connection);
}
@ -379,6 +387,7 @@ public class ConnectHandler extends HandlerWrapper
*/
protected void write(EndPoint endPoint, ByteBuffer buffer, Callback callback)
{
if (LOG.isDebugEnabled())
LOG.debug("{} writing {} bytes", this, buffer.remaining());
endPoint.write(callback, buffer);
}
@ -407,6 +416,7 @@ public class ConnectHandler extends HandlerWrapper
{
if (!whiteList.contains(hostPort))
{
if (LOG.isDebugEnabled())
LOG.debug("Host {}:{} not whitelisted", host, port);
return false;
}
@ -415,6 +425,7 @@ public class ConnectHandler extends HandlerWrapper
{
if (blackList.contains(hostPort))
{
if (LOG.isDebugEnabled())
LOG.debug("Host {}:{} blacklisted", host, port);
return false;
}
@ -565,6 +576,7 @@ public class ConnectHandler extends HandlerWrapper
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("{} wrote initial {} bytes to server", DownstreamConnection.this, remaining);
fillInterested();
}
@ -572,6 +584,7 @@ public class ConnectHandler extends HandlerWrapper
@Override
public void failed(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug(this + " failed to write initial " + remaining + " bytes to server", x);
close();
getConnection().close();

View File

@ -73,6 +73,7 @@ public abstract class ProxyConnection extends AbstractConnection
try
{
final int filled = read(getEndPoint(), buffer);
if (LOG.isDebugEnabled())
LOG.debug("{} filled {} bytes", this, filled);
if (filled > 0)
{
@ -81,6 +82,7 @@ public abstract class ProxyConnection extends AbstractConnection
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("{} wrote {} bytes", this, filled);
bufferPool.release(buffer);
invoker.invoke(null);

View File

@ -30,7 +30,6 @@ import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.http.BadMessageException;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpGenerator;
import org.eclipse.jetty.http.HttpGenerator.ResponseInfo;
@ -40,7 +39,6 @@ import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.ChannelEndPoint;
import org.eclipse.jetty.io.EndPoint;
@ -214,6 +212,7 @@ public class HttpChannel implements Runnable
*/
public boolean handle()
{
if (LOG.isDebugEnabled())
LOG.debug("{} handle enter", this);
final HttpChannel last = setCurrentHttpChannel(this);
@ -237,6 +236,7 @@ public class HttpChannel implements Runnable
boolean error=false;
try
{
if (LOG.isDebugEnabled())
LOG.debug("{} action {}",this,action);
switch(action)
@ -378,6 +378,7 @@ public class HttpChannel implements Runnable
}
}
if (LOG.isDebugEnabled())
LOG.debug("{} handle exit, result {}", this, action);
return action!=Action.WAIT;
@ -523,6 +524,7 @@ public class HttpChannel implements Runnable
public void onRequestComplete()
{
if (LOG.isDebugEnabled())
LOG.debug("{} onRequestComplete", this);
_request.getHttpInput().messageComplete();
}

View File

@ -100,6 +100,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
HttpInput input = newHttpInput();
_channel = newHttpChannel(input);
_parser = newHttpParser();
if (LOG.isDebugEnabled())
LOG.debug("New HTTP Connection {}", this);
}
@ -188,6 +189,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
@Override
public void onFillable()
{
if (LOG.isDebugEnabled())
LOG.debug("{} onFillable {}", this, _channel.getState());
final HttpConnection last=setCurrentConnection(this);
@ -325,6 +327,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
Connection connection = (Connection)_channel.getRequest().getAttribute(UPGRADE_CONNECTION_ATTRIBUTE);
if (connection != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Upgrade from {} to {}", this, connection);
onClose();
getEndPoint().setConnection(connection);

View File

@ -174,6 +174,7 @@ public abstract class HttpInput extends ServletInputStream implements Runnable
{
if (_eofState != null)
{
if (LOG.isDebugEnabled())
LOG.debug("{} eof {}", this, _eofState);
_contentState = _eofState;
}
@ -281,6 +282,7 @@ public abstract class HttpInput extends ServletInputStream implements Runnable
{
if (!isEOF())
{
if (LOG.isDebugEnabled())
LOG.debug("{} early EOF", this);
_eofState = EARLY_EOF;
if (_listener == null)
@ -300,6 +302,7 @@ public abstract class HttpInput extends ServletInputStream implements Runnable
{
if (!isEOF())
{
if (LOG.isDebugEnabled())
LOG.debug("{} EOF", this);
_eofState = EOF;
if (_listener == null)

View File

@ -62,6 +62,7 @@ public class HttpInputOverHTTP extends HttpInput implements Callback
try (Blocker blocker=_readBlocker.acquire())
{
_httpConnection.fillInterested(blocker);
if (LOG.isDebugEnabled())
LOG.debug("{} block readable on {}",this,blocker);
blocker.block();
}

View File

@ -755,6 +755,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
{
Throwable th=_onError;
_onError=null;
if (LOG.isDebugEnabled())
LOG.debug("onError",th);
_writeListener.onError(th);
close();
@ -763,7 +764,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
}
}
continue loop;
continue;
}
switch(_state.get())

View File

@ -133,11 +133,13 @@ public class LocalConnector extends AbstractConnector
*/
public ByteBuffer getResponses(ByteBuffer requestsBuffer,long idleFor,TimeUnit units) throws Exception
{
if (LOG.isDebugEnabled())
LOG.debug("requests {}", BufferUtil.toUTF8String(requestsBuffer));
LocalEndPoint endp = executeRequest(requestsBuffer);
endp.waitUntilClosedOrIdleFor(idleFor,units);
ByteBuffer responses = endp.takeOutput();
endp.getConnection().close();
if (LOG.isDebugEnabled())
LOG.debug("responses {}", BufferUtil.toUTF8String(responses));
return responses;
}
@ -164,6 +166,7 @@ public class LocalConnector extends AbstractConnector
@Override
protected void accept(int acceptorID) throws IOException, InterruptedException
{
if (LOG.isDebugEnabled())
LOG.debug("accepting {}", acceptorID);
LocalEndPoint endPoint = _connects.take();
endPoint.onOpen();
@ -249,6 +252,7 @@ public class LocalConnector extends AbstractConnector
{
if (size==getOutput().remaining())
{
if (LOG.isDebugEnabled())
LOG.debug("idle for {} {}",idleFor,units);
return;
}

View File

@ -26,8 +26,6 @@ import javax.net.ssl.SSLEngineResult;
import org.eclipse.jetty.io.AbstractConnection;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -95,6 +93,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection
if (engine.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING)
{
// Here the SSL handshake is finished, but the protocol has not been negotiated.
if (LOG.isDebugEnabled())
LOG.debug("{} could not negotiate protocol, SSLEngine: {}", this, engine);
close();
}
@ -110,6 +109,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection
ConnectionFactory connectionFactory = connector.getConnectionFactory(protocol);
if (connectionFactory == null)
{
if (LOG.isDebugEnabled())
LOG.debug("{} application selected protocol '{}', but no correspondent {} has been configured",
this, protocol, ConnectionFactory.class.getName());
close();
@ -119,6 +119,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection
EndPoint endPoint = getEndPoint();
Connection oldConnection = endPoint.getConnection();
Connection newConnection = connectionFactory.newConnection(connector, endPoint);
if (LOG.isDebugEnabled())
LOG.debug("{} switching from {} to {}", this, oldConnection, newConnection);
oldConnection.onClose();
endPoint.setConnection(newConnection);
@ -129,6 +130,7 @@ public abstract class NegotiatingServerConnection extends AbstractConnection
else if (filled < 0)
{
// Something went bad, we need to close.
if (LOG.isDebugEnabled())
LOG.debug("{} closing on client close", this);
close();
}

View File

@ -56,6 +56,7 @@ public class QueuedHttpInput extends HttpInput
{
boolean wasEmpty = _inputQ.isEmpty();
_inputQ.add(item);
if (LOG.isDebugEnabled())
LOG.debug("{} queued {}", this, item);
if (wasEmpty)
{
@ -90,6 +91,7 @@ public class QueuedHttpInput extends HttpInput
while (item != null && remaining(item) == 0)
{
_inputQ.pollUnsafe();
if (LOG.isDebugEnabled())
LOG.debug("{} consumed {}", this, item);
item = _inputQ.peekUnsafe();
}
@ -105,6 +107,7 @@ public class QueuedHttpInput extends HttpInput
{
try
{
if (LOG.isDebugEnabled())
LOG.debug("{} waiting for content", this);
lock().wait();
}

View File

@ -384,6 +384,7 @@ public class Server extends HandlerWrapper implements Attributes
if (stopTimeout>0)
{
long stop_by=System.currentTimeMillis()+stopTimeout;
if (LOG.isDebugEnabled())
LOG.debug("Graceful shutdown {} by ",this,new Date(stop_by));
// Wait for shutdowns

View File

@ -54,6 +54,7 @@ public abstract class AbstractHandler extends ContainerLifeCycle implements Hand
@Override
protected void doStart() throws Exception
{
if (LOG.isDebugEnabled())
LOG.debug("starting {}",this);
if (_server==null)
LOG.warn("No Server set for {}",this);
@ -67,6 +68,7 @@ public abstract class AbstractHandler extends ContainerLifeCycle implements Hand
@Override
protected void doStop() throws Exception
{
if (LOG.isDebugEnabled())
LOG.debug("stopping {}",this);
super.doStop();
}

View File

@ -56,6 +56,7 @@ public class AllowSymLinkAliasChecker implements AliasCheck
URI real = file.toPath().toRealPath().toUri();
if (real.equals(resource.getAlias()))
{
if (LOG.isDebugEnabled())
LOG.debug("Allow symlink {} --> {}",resource,real);
return true;
}
@ -79,6 +80,7 @@ public class AllowSymLinkAliasChecker implements AliasCheck
}
if (resource.getAlias().equals(d.toURI()))
{
if (LOG.isDebugEnabled())
LOG.debug("Allow symlink {} --> {}",resource,d);
return true;
}

View File

@ -796,6 +796,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
/* ------------------------------------------------------------ */
protected void callContextInitialized (ServletContextListener l, ServletContextEvent e)
{
if (LOG.isDebugEnabled())
LOG.debug("contextInitialized: {}->{}",e,l);
l.contextInitialized(e);
}
@ -803,6 +804,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
/* ------------------------------------------------------------ */
protected void callContextDestroyed (ServletContextListener l, ServletContextEvent e)
{
if (LOG.isDebugEnabled())
LOG.debug("contextDestroyed: {}->{}",e,l);
l.contextDestroyed(e);
}

View File

@ -224,6 +224,7 @@ public class ShutdownHandler extends HandlerWrapper
private boolean hasCorrectSecurityToken(HttpServletRequest request)
{
String tok = request.getParameter("token");
if (LOG.isDebugEnabled())
LOG.debug("Token: {}", tok);
return _shutdownToken.equals(tok);
}

View File

@ -19,13 +19,10 @@
package org.eclipse.jetty.server.session;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSessionActivationListener;
@ -335,6 +332,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
{
try
{
if (LOG.isDebugEnabled())
LOG.debug("invalidate {}",_clusterId);
if (isValid())
clearAttributes();

View File

@ -167,6 +167,7 @@ public abstract class AbstractSessionIdManager extends AbstractLifeCycle impleme
// random chance to reseed
if (_reseed>0 && (r0%_reseed)== 1L)
{
if (LOG.isDebugEnabled())
LOG.debug("Reseeding {}",this);
if (_random instanceof SecureRandom)
{

View File

@ -477,6 +477,7 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager
throws SQLException
{
_dbName = dbMeta.getDatabaseProductName().toLowerCase(Locale.ENGLISH);
if (LOG.isDebugEnabled())
LOG.debug ("Using database {}",_dbName);
_isLower = dbMeta.storesLowerCaseIdentifiers();
_isUpper = dbMeta.storesUpperCaseIdentifiers();

View File

@ -512,16 +512,19 @@ public class JDBCSessionManager extends AbstractSessionManager
{
if (memSession==null)
{
if (LOG.isDebugEnabled())
LOG.debug("getSession("+idInCluster+"): no session in session map. Reloading session data from db.");
session = loadSession(idInCluster, canonicalize(_context.getContextPath()), getVirtualHost(_context));
}
else if ((now - memSession._lastSaved) >= (_saveIntervalSec * 1000L))
{
if (LOG.isDebugEnabled())
LOG.debug("getSession("+idInCluster+"): stale session. Reloading session data from db.");
session = loadSession(idInCluster, canonicalize(_context.getContextPath()), getVirtualHost(_context));
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("getSession("+idInCluster+"): session in session map");
session = memSession;
}
@ -562,6 +565,7 @@ public class JDBCSessionManager extends AbstractSessionManager
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("getSession ({}): Session has expired", idInCluster);
//ensure that the session id for the expired session is deleted so that a new session with the
//same id cannot be created (because the idInUse() test would succeed)
@ -574,6 +578,7 @@ public class JDBCSessionManager extends AbstractSessionManager
{
//the session loaded from the db and the one in memory are the same, so keep using the one in memory
session = memSession;
if (LOG.isDebugEnabled())
LOG.debug("getSession({}): Session not stale {}", idInCluster,session);
}
}

View File

@ -262,6 +262,7 @@ public class SessionHandler extends ScopedHandler
requested_session_id = cookies[i].getValue();
requested_session_id_from_cookie = true;
if (LOG.isDebugEnabled())
LOG.debug("Got Session ID {} from cookie",requested_session_id);
if (requested_session_id != null)

View File

@ -257,6 +257,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
throw new UnavailableException("resourceCache specified with resource bases");
_cache=(ResourceCache)_servletContext.getAttribute(resourceCache);
if (LOG.isDebugEnabled())
LOG.debug("Cache {}={}",resourceCache,_cache);
}
@ -560,6 +561,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
// else look for a welcome file
else if (null!=(welcome=getWelcomeFile(pathInContext)))
{
if (LOG.isDebugEnabled())
LOG.debug("welcome={}",welcome);
if (_redirectWelcome)
{

View File

@ -133,6 +133,7 @@ public class FilterHolder extends Holder<Filter>
}
_config=new Config();
if (LOG.isDebugEnabled())
LOG.debug("Filter.init {}",_filter);
_filter.init(_config);
}

View File

@ -160,6 +160,7 @@ public class ServletHandler extends ScopedHandler
if (getServletMapping("/")==null && _ensureDefaultServlet)
{
if (LOG.isDebugEnabled())
LOG.debug("Adding Default404Servlet to {}",this);
addServletWithMapping(Default404Servlet.class,"/");
updateMappings();
@ -543,7 +544,9 @@ public class ServletHandler extends ScopedHandler
}
}
if (LOG.isDebugEnabled())
LOG.debug("chain={}",chain);
Throwable th=null;
try
{
@ -1528,6 +1531,7 @@ public class ServletHandler extends ScopedHandler
/* ------------------------------------------------------------ */
protected void notFound(Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
if (LOG.isDebugEnabled())
LOG.debug("Not Found {}",request.getRequestURI());
if (getHandler()!=null)
nextHandle(URIUtil.addPaths(request.getServletPath(),request.getPathInfo()),baseRequest,request,response);
@ -1630,6 +1634,7 @@ public class ServletHandler extends ScopedHandler
// pass to next filter
if (_filterHolder!=null)
{
if (LOG.isDebugEnabled())
LOG.debug("call filter {}", _filterHolder);
Filter filter= _filterHolder.getFilter();
@ -1729,6 +1734,7 @@ public class ServletHandler extends ScopedHandler
notFound((request instanceof Request)?((Request)request):HttpChannel.getCurrentHttpChannel().getRequest(), srequest, (HttpServletResponse)response);
else
{
if (LOG.isDebugEnabled())
LOG.debug("call servlet {}", _servletHolder);
_servletHolder.handle(_baseRequest,request, response);
}

View File

@ -290,10 +290,12 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
{
// Look for a precompiled JSP Servlet
String precompiled=getClassNameForJsp(_forcedPath);
if (LOG.isDebugEnabled())
LOG.debug("Checking for precompiled servlet {} for jsp {}", precompiled, _forcedPath);
ServletHolder jsp=getServletHandler().getServlet(precompiled);
if (jsp!=null)
{
if (LOG.isDebugEnabled())
LOG.debug("JSP file {} for {} mapped to Servlet {}",_forcedPath, getName(),jsp.getClassName());
// set the className for this servlet to the precompiled one
setClassName(jsp.getClassName());
@ -306,6 +308,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
jsp=getServletHandler().getServlet("jsp");
if (jsp!=null)
{
if (LOG.isDebugEnabled())
LOG.debug("JSP file {} for {} mapped to Servlet {}",_forcedPath, getName(),jsp.getClassName());
setClassName(jsp.getClassName());
//copy jsp init params that don't exist for this servlet
@ -592,6 +595,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
initMultiPart();
if (LOG.isDebugEnabled())
LOG.debug("Filter.init {}",_servlet);
_servlet.init(_config);
}
@ -643,6 +647,7 @@ public class ServletHolder extends Holder<Servlet> implements UserIdentity.Scope
if ("?".equals(getInitParameter("classpath")))
{
String classpath = ch.getClassPath();
if (LOG.isDebugEnabled())
LOG.debug("classpath=" + classpath);
if (classpath != null)
setInitParameter("classpath", classpath);

View File

@ -60,6 +60,7 @@ public class ELContextCleaner implements ServletContextListener
//Get rid of references
purgeEntries(field);
if (LOG.isDebugEnabled())
LOG.debug("javax.el.BeanELResolver purged");
}
@ -67,15 +68,7 @@ public class ELContextCleaner implements ServletContextListener
{
//BeanELResolver not on classpath, ignore
}
catch (SecurityException e)
{
LOG.warn("Cannot purge classes from javax.el.BeanELResolver", e);
}
catch (IllegalArgumentException e)
{
LOG.warn("Cannot purge classes from javax.el.BeanELResolver", e);
}
catch (IllegalAccessException e)
catch (SecurityException | IllegalArgumentException | IllegalAccessException e)
{
LOG.warn("Cannot purge classes from javax.el.BeanELResolver", e);
}
@ -113,14 +106,19 @@ public class ELContextCleaner implements ServletContextListener
while (itor.hasNext())
{
Class clazz = itor.next();
if (LOG.isDebugEnabled())
LOG.debug("Clazz: "+clazz+" loaded by "+clazz.getClassLoader());
if (Thread.currentThread().getContextClassLoader().equals(clazz.getClassLoader()))
{
itor.remove();
if (LOG.isDebugEnabled())
LOG.debug("removed");
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("not removed: "+"contextclassloader="+Thread.currentThread().getContextClassLoader()+"clazz's classloader="+clazz.getClassLoader());
}
}
}
}

View File

@ -139,10 +139,12 @@ public class SPDYConnection extends AbstractConnection implements Controller, Id
EndPoint endPoint = getEndPoint();
// We need to gently close first, to allow
// SSL close alerts to be sent by Jetty
if (LOG.isDebugEnabled())
LOG.debug("Shutting down output {}", endPoint);
endPoint.shutdownOutput();
if (!onlyOutput)
{
if (LOG.isDebugEnabled())
LOG.debug("Closing {}", endPoint);
endPoint.close();
}
@ -158,6 +160,7 @@ public class SPDYConnection extends AbstractConnection implements Controller, Id
protected boolean onReadTimeout()
{
boolean idle = this.idle;
if (LOG.isDebugEnabled())
LOG.debug("Idle timeout on {}, idle={}", this, idle);
if (idle)
goAway(session);

View File

@ -339,10 +339,12 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
notifyIdle(idleListener, false);
try
{
if (LOG.isDebugEnabled())
LOG.debug("Processing {}", frame);
if (goAwaySent.get())
{
if (LOG.isDebugEnabled())
LOG.debug("Skipped processing of {}", frame);
return;
}
@ -417,10 +419,12 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
notifyIdle(idleListener, false);
try
{
if (LOG.isDebugEnabled())
LOG.debug("Processing {}, {} data bytes", frame, data.remaining());
if (goAwaySent.get())
{
if (LOG.isDebugEnabled())
LOG.debug("Skipped processing of {}", frame);
return;
}
@ -430,6 +434,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
if (stream == null)
{
RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
if (LOG.isDebugEnabled())
LOG.debug("Unknown stream {}", rstInfo);
rst(rstInfo, Callback.Adapter.INSTANCE);
}
@ -569,12 +574,14 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
throw duplicateIdException;
}
RstInfo rstInfo = new RstInfo(streamId, StreamStatus.PROTOCOL_ERROR);
if (LOG.isDebugEnabled())
LOG.debug("Duplicate stream, {}", rstInfo);
rst(rstInfo, Callback.Adapter.INSTANCE); // We don't care (too much) if the reset fails.
return null;
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Created {}", stream);
notifyStreamCreated(stream);
return stream;
@ -617,6 +624,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
if (streamIds.get() % 2 == stream.getId() % 2)
localStreamCount.decrementAndGet();
if (LOG.isDebugEnabled())
LOG.debug("Removed {}", stream);
notifyStreamClosed(stream);
}
@ -652,6 +660,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
if (stream == null)
{
RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
if (LOG.isDebugEnabled())
LOG.debug("Unknown stream {}", rstInfo);
rst(rstInfo, Callback.Adapter.INSTANCE);
}
@ -689,6 +698,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
int windowSize = windowSizeSetting.value();
setWindowSize(windowSize);
if (LOG.isDebugEnabled())
LOG.debug("Updated session window size to {}", windowSize);
}
Settings.Setting maxConcurrentStreamsSetting = frame.getSettings().get(Settings.ID.MAX_CONCURRENT_STREAMS);
@ -696,6 +706,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
int maxConcurrentStreamsValue = maxConcurrentStreamsSetting.value();
maxConcurrentLocalStreams = maxConcurrentStreamsValue;
if (LOG.isDebugEnabled())
LOG.debug("Updated session maxConcurrentLocalStreams to {}", maxConcurrentStreamsValue);
}
SettingsInfo settingsInfo = new SettingsInfo(frame.getSettings(), frame.isClearPersisted());
@ -735,6 +746,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
if (stream == null)
{
RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
if (LOG.isDebugEnabled())
LOG.debug("Unknown stream, {}", rstInfo);
rst(rstInfo, Callback.Adapter.INSTANCE);
}
@ -777,6 +789,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", x, listener);
listener.onFailure(this, x);
}
@ -798,6 +811,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener == null)
return null;
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", pushInfo, listener);
return listener.onPush(stream, pushInfo);
}
@ -819,6 +833,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener == null)
return null;
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", synInfo, listener);
return listener.onSyn(stream, synInfo);
}
@ -840,6 +855,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", rstInfo, listener);
listener.onRst(this, rstInfo);
}
@ -861,6 +877,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", settingsInfo, listener);
listener.onSettings(this, settingsInfo);
}
@ -882,6 +899,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", pingResultInfo, listener);
listener.onPing(this, pingResultInfo);
}
@ -903,6 +921,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking callback with {} on listener {}", goAwayResultInfo, listener);
listener.onGoAway(this, goAwayResultInfo);
}
@ -936,6 +955,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
synchronized (this)
{
ByteBuffer buffer = generator.control(frame);
if (LOG.isDebugEnabled())
LOG.debug("Queuing {} on {}", frame, stream);
frameBytes = new ControlFrameBytes(stream, callback, frame, buffer);
if (timeout > 0)
@ -966,6 +986,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
@Override
public void data(IStream stream, DataInfo dataInfo, long timeout, TimeUnit unit, Callback callback)
{
if (LOG.isDebugEnabled())
LOG.debug("Queuing {} on {}", dataInfo, stream);
DataFrameBytes frameBytes = new DataFrameBytes(stream, callback, dataInfo);
if (timeout > 0)

View File

@ -141,6 +141,7 @@ public class StandardStream extends IdleTimeout implements IStream
public void updateWindowSize(int delta)
{
int size = windowSize.addAndGet(delta);
if (LOG.isDebugEnabled())
LOG.debug("Updated window size {} -> {} for {}", size - delta, size, this);
}
@ -183,6 +184,7 @@ public class StandardStream extends IdleTimeout implements IStream
@Override
public void updateCloseState(boolean close, boolean local)
{
if (LOG.isDebugEnabled())
LOG.debug("{} close={} local={}", this, close, local);
if (close)
{
@ -265,12 +267,14 @@ public class StandardStream extends IdleTimeout implements IStream
// ignore data frame if this stream is remotelyClosed already
if (isRemotelyClosed())
{
if (LOG.isDebugEnabled())
LOG.debug("Stream is remotely closed, ignoring {}", dataInfo);
return;
}
if (!canReceive())
{
if (LOG.isDebugEnabled())
LOG.debug("Protocol error receiving {}, resetting", dataInfo);
session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), Callback.Adapter.INSTANCE);
return;
@ -301,6 +305,7 @@ public class StandardStream extends IdleTimeout implements IStream
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking reply callback with {} on listener {}", replyInfo, listener);
listener.onReply(this, replyInfo);
}
@ -323,6 +328,7 @@ public class StandardStream extends IdleTimeout implements IStream
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking headers callback with {} on listener {}", headersInfo, listener);
listener.onHeaders(this, headersInfo);
}
@ -345,8 +351,10 @@ public class StandardStream extends IdleTimeout implements IStream
{
if (listener != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking data callback with {} on listener {}", dataInfo, listener);
listener.onData(this, dataInfo);
if (LOG.isDebugEnabled())
LOG.debug("Invoked data callback with {} on listener {}", dataInfo, listener);
}
}

View File

@ -576,6 +576,7 @@ public class StandardSessionTest
StandardSession.FrameBytes frameBytes = (StandardSession.FrameBytes)callback;
int streamId = frameBytes.getStream().getId();
if (LOG.isDebugEnabled())
LOG.debug("last: {}, current: {}", lastStreamId, streamId);
if (lastStreamId < streamId)
lastStreamId = streamId;

View File

@ -94,6 +94,7 @@ public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory
// can arrive on the same connection, so we need to create an
// HttpChannel for each SYN in order to run concurrently.
if (LOG.isDebugEnabled())
LOG.debug("Received {} on {}", synInfo, stream);
Fields headers = synInfo.getHeaders();
@ -136,6 +137,7 @@ public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory
@Override
public void onHeaders(Stream stream, HeadersInfo headersInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("Received {} on {}", headersInfo, stream);
HttpChannelOverSPDY channel = (HttpChannelOverSPDY)stream.getAttribute(CHANNEL_ATTRIBUTE);
channel.requestHeaders(headersInfo.getHeaders(), headersInfo.isClose());
@ -150,6 +152,7 @@ public class HTTPSPDYServerConnectionFactory extends SPDYServerConnectionFactory
@Override
public void onData(Stream stream, final DataInfo dataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("Received {} on {}", dataInfo, stream);
HttpChannelOverSPDY channel = (HttpChannelOverSPDY)stream.getAttribute(CHANNEL_ATTRIBUTE);
channel.requestContent(dataInfo, dataInfo.isClose());

View File

@ -71,6 +71,7 @@ public class HttpChannelOverSPDY extends HttpChannel
public void requestContent(final DataInfo dataInfo, boolean endRequest)
{
if (LOG.isDebugEnabled())
LOG.debug("HTTP > {} bytes of content", dataInfo.length());
// We need to copy the dataInfo since we do not know when its bytes
@ -104,6 +105,7 @@ public class HttpChannelOverSPDY extends HttpChannel
HttpURI uri = new HttpURI(uriHeader.getValue());
if (LOG.isDebugEnabled())
LOG.debug("HTTP > {} {} {}", httpMethod, uriHeader.getValue(), httpVersion);
Fields.Field schemeHeader = headers.get(HTTPSPDYHeader.SCHEME.name(version));
@ -146,6 +148,7 @@ public class HttpChannelOverSPDY extends HttpChannel
{
// Spec says headers must be single valued
String value = header.getValue();
if (LOG.isDebugEnabled())
LOG.debug("HTTP > {}: {}", name, value);
fields.add(new HttpField(name, value));
break;

View File

@ -130,6 +130,7 @@ public class HttpTransportOverSPDY implements HttpTransport
StreamException exception = new StreamException(stream.getId(), StreamStatus.PROTOCOL_ERROR,
"Stream already committed!");
callback.failed(exception);
if (LOG.isDebugEnabled())
LOG.debug("Committed response twice.", exception);
return;
}
@ -147,6 +148,7 @@ public class HttpTransportOverSPDY implements HttpTransport
if (hasContent)
{
// send the data and let it call the callback
if (LOG.isDebugEnabled())
LOG.debug("Send content: {} on stream: {} lastContent={}", BufferUtil.toDetailString(content), stream,
lastContent);
stream.data(new ByteBufferDataInfo(endPoint.getIdleTimeout(), TimeUnit.MILLISECONDS, content, lastContent
@ -156,6 +158,7 @@ public class HttpTransportOverSPDY implements HttpTransport
else if (lastContent && info == null)
{
// send empty data to close and let the send call the callback
if (LOG.isDebugEnabled())
LOG.debug("No content and lastContent=true. Sending empty ByteBuffer to close stream: {}", stream);
stream.data(new ByteBufferDataInfo(endPoint.getIdleTimeout(), TimeUnit.MILLISECONDS,
BufferUtil.EMPTY_BUFFER, lastContent), callback);
@ -180,6 +183,7 @@ public class HttpTransportOverSPDY implements HttpTransport
if (reason != null)
httpStatus.append(" ").append(reason);
headers.put(HTTPSPDYHeader.STATUS.name(version), httpStatus.toString());
if (LOG.isDebugEnabled())
LOG.debug("HTTP < {} {}", httpVersion, httpStatus);
// TODO merge the two Field classes into one
@ -192,6 +196,7 @@ public class HttpTransportOverSPDY implements HttpTransport
String name = field.getName();
String value = field.getValue();
headers.add(name, value);
if (LOG.isDebugEnabled())
LOG.debug("HTTP < {}: {}", name, value);
}
}
@ -202,6 +207,7 @@ public class HttpTransportOverSPDY implements HttpTransport
headers.add(HttpHeader.X_POWERED_BY.asString(), HttpConfiguration.SERVER_VERSION);
ReplyInfo reply = new ReplyInfo(headers, close);
if (LOG.isDebugEnabled())
LOG.debug("Sending reply: {} on stream: {}", reply, stream);
reply(stream, reply, callback);
}
@ -209,6 +215,7 @@ public class HttpTransportOverSPDY implements HttpTransport
@Override
public void completed()
{
if (LOG.isDebugEnabled())
LOG.debug("Completed {}", this);
}
@ -249,6 +256,7 @@ public class HttpTransportOverSPDY implements HttpTransport
public void completed()
{
Stream stream = getStream();
if (LOG.isDebugEnabled())
LOG.debug("Resource pushed for {} on {}",
getRequestHeaders().get(HTTPSPDYHeader.URI.name(version)), stream);
coordinator.complete();
@ -268,6 +276,7 @@ public class HttpTransportOverSPDY implements HttpTransport
private void coordinate()
{
if (LOG.isDebugEnabled())
LOG.debug("Pushing resources: {}", resources);
// Must send all push frames to the client at once before we
// return from this method and send the main resource data
@ -277,12 +286,14 @@ public class HttpTransportOverSPDY implements HttpTransport
private void sendNextResourceData()
{
if (LOG.isDebugEnabled())
LOG.debug("{} sendNextResourceData active: {}", hashCode(), active.get());
if (active.compareAndSet(false, true))
{
PushResource resource = queue.poll();
if (resource != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Opening new push channel for: {}", resource);
HttpChannelOverSPDY pushChannel = newHttpChannelOverSPDY(resource.getPushStream(), resource.getPushRequestHeaders());
pushChannel.requestStart(resource.getPushRequestHeaders(), true);
@ -322,6 +333,7 @@ public class HttpTransportOverSPDY implements HttpTransport
@Override
public void succeeded(Stream pushStream)
{
if (LOG.isDebugEnabled())
LOG.debug("Headers pushed for {} on {}", pushHeaders.get(HTTPSPDYHeader.URI.name(version)), pushStream);
queue.offer(new PushResource(pushStream, pushRequestHeaders));
sendNextResourceData();

View File

@ -167,6 +167,7 @@ public class ReferrerPushStrategy implements PushStrategy
String origin = scheme + "://" + host;
String url = requestHeaders.get(HTTPSPDYHeader.URI.name(version)).getValue();
String absoluteURL = origin + url;
if (LOG.isDebugEnabled())
LOG.debug("Applying push strategy for {}", absoluteURL);
if (isMainResource(url, responseHeaders))
{
@ -190,6 +191,7 @@ public class ReferrerPushStrategy implements PushStrategy
result = getPushResources(absoluteURL);
}
}
if (LOG.isDebugEnabled())
LOG.debug("Pushing {} resources for {}: {}", result.size(), absoluteURL, result);
}
return result;
@ -208,6 +210,7 @@ public class ReferrerPushStrategy implements PushStrategy
MainResource mainResource = mainResources.get(absoluteURL);
if (mainResource == null)
{
if (LOG.isDebugEnabled())
LOG.debug("Creating new main resource for {}", absoluteURL);
MainResource value = new MainResource(absoluteURL);
mainResource = mainResources.putIfAbsent(absoluteURL, value);
@ -283,6 +286,7 @@ public class ReferrerPushStrategy implements PushStrategy
long delay = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - firstResourceAdded.get());
if (!referrer.startsWith(origin) && !isPushOriginAllowed(origin))
{
if (LOG.isDebugEnabled())
LOG.debug("Skipped store of push metadata {} for {}: Origin: {} doesn't match or origin not allowed",
url, name, origin);
return false;
@ -293,17 +297,20 @@ public class ReferrerPushStrategy implements PushStrategy
// although in rare cases few more resources will be stored
if (resources.size() >= maxAssociatedResources)
{
if (LOG.isDebugEnabled())
LOG.debug("Skipped store of push metadata {} for {}: max associated resources ({}) reached",
url, name, maxAssociatedResources);
return false;
}
if (delay > referrerPushPeriod)
{
LOG.debug("Delay: {}ms longer than referrerPushPeriod ({}ms). Not adding resource: {} for: {}", delay,
referrerPushPeriod, url, name);
if (LOG.isDebugEnabled())
LOG.debug("Delay: {}ms longer than referrerPushPeriod ({}ms). Not adding resource: {} for: {}",
delay, referrerPushPeriod, url, name);
return false;
}
if (LOG.isDebugEnabled())
LOG.debug("Adding: {} to: {} with delay: {}ms.", url, this, delay);
resources.add(url);
return true;

View File

@ -88,6 +88,7 @@ public class HTTPProxyEngine extends ProxyEngine
String host = proxyServerInfo.getHost();
int port = proxyServerInfo.getAddress().getPort();
if (LOG.isDebugEnabled())
LOG.debug("Sending HTTP request to: {}", host + ":" + port);
final Request request = httpClient.newRequest(host, port)
.path(path)
@ -119,6 +120,7 @@ public class HTTPProxyEngine extends ProxyEngine
@Override
public void onData(Stream clientStream, final DataInfo clientDataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("received clientDataInfo: {} for stream: {}", clientDataInfo, clientStream);
DeferredContentProvider contentProvider = (DeferredContentProvider)request.getContent();
@ -139,6 +141,7 @@ public class HTTPProxyEngine extends ProxyEngine
@Override
public void onHeaders(final Response response)
{
if (LOG.isDebugEnabled())
LOG.debug("onHeaders called with response: {}. Sending replyInfo to client.", response);
Fields responseHeaders = createResponseHeaders(clientStream, response);
removeHopHeaders(responseHeaders);
@ -163,6 +166,7 @@ public class HTTPProxyEngine extends ProxyEngine
@Override
public void onContent(final Response response, ByteBuffer content)
{
if (LOG.isDebugEnabled())
LOG.debug("onContent called with response: {} and content: {}. Sending response content to client.",
response, content);
final ByteBuffer contentCopy = httpClient.getByteBufferPool().acquire(content.remaining(), true);
@ -194,6 +198,7 @@ public class HTTPProxyEngine extends ProxyEngine
@Override
public void onSuccess(Response response)
{
if (LOG.isDebugEnabled())
LOG.debug("onSuccess called. Closing client stream.");
clientStream.data(new ByteBufferDataInfo(BufferUtil.EMPTY_BUFFER, true), LOGGING_CALLBACK);
}
@ -264,6 +269,7 @@ public class HTTPProxyEngine extends ProxyEngine
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("succeeded");
}
}

View File

@ -57,6 +57,7 @@ public class ProxyEngineSelector extends ServerSessionFrameListener.Adapter
@Override
public final StreamFrameListener onSyn(final Stream clientStream, SynInfo clientSynInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("C -> P {} on {}", clientSynInfo, clientStream);
final Session clientSession = clientStream.getSession();
@ -66,6 +67,7 @@ public class ProxyEngineSelector extends ServerSessionFrameListener.Adapter
Fields.Field hostHeader = headers.get(HTTPSPDYHeader.HOST.name(clientVersion));
if (hostHeader == null)
{
if (LOG.isDebugEnabled())
LOG.debug("No host header found: " + headers);
rst(clientStream);
return null;
@ -79,6 +81,7 @@ public class ProxyEngineSelector extends ServerSessionFrameListener.Adapter
ProxyServerInfo proxyServerInfo = getProxyServerInfo(host);
if (proxyServerInfo == null)
{
if (LOG.isDebugEnabled())
LOG.debug("No matching ProxyServerInfo found for: " + host);
rst(clientStream);
return null;
@ -88,10 +91,12 @@ public class ProxyEngineSelector extends ServerSessionFrameListener.Adapter
ProxyEngine proxyEngine = proxyEngines.get(protocol);
if (proxyEngine == null)
{
if (LOG.isDebugEnabled())
LOG.debug("No matching ProxyEngine found for: " + protocol);
rst(clientStream);
return null;
}
if (LOG.isDebugEnabled())
LOG.debug("Forwarding request: {} -> {}", clientSynInfo, proxyServerInfo);
return proxyEngine.proxy(clientStream, clientSynInfo, proxyServerInfo);
}

View File

@ -154,6 +154,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void onData(Stream clientStream, final DataInfo clientDataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("C -> P {} on {}", clientDataInfo, clientStream);
ByteBufferDataInfo serverDataInfo = new ByteBufferDataInfo(clientDataInfo.asByteBuffer(false), clientDataInfo.isClose())
@ -185,6 +186,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
{
SPDYClient client = factory.newSPDYClient(version);
session = client.connect(address, sessionListener);
if (LOG.isDebugEnabled())
LOG.debug("Proxy session connected to {}", address);
Session existing = serverSessions.putIfAbsent(host, session);
if (existing != null)
@ -237,6 +239,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public StreamFrameListener onPush(Stream stream, PushInfo pushInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("S -> P pushed {} on {}. Opening new PushStream P -> C now.", pushInfo, stream);
PushStreamPromise newPushStreamPromise = new PushStreamPromise(stream, pushInfo);
this.pushStreamPromise.push(newPushStreamPromise);
@ -259,6 +262,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void onData(Stream serverStream, final DataInfo serverDataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("S -> P pushed {} on {}", serverDataInfo, serverStream);
ByteBufferDataInfo clientDataInfo = new ByteBufferDataInfo(serverDataInfo.asByteBuffer(false), serverDataInfo.isClose())
@ -293,6 +297,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public StreamFrameListener onPush(Stream senderStream, PushInfo pushInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("S -> P {} on {}");
PushInfo newPushInfo = convertPushInfo(pushInfo, senderStream, receiverStream);
PushStreamPromise pushStreamPromise = new PushStreamPromise(senderStream, newPushInfo);
@ -303,6 +308,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void onReply(final Stream stream, ReplyInfo replyInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("S -> P {} on {}", replyInfo, stream);
final ReplyInfo clientReplyInfo = new ReplyInfo(convertHeaders(stream, receiverStream, replyInfo.getHeaders()),
replyInfo.isClose());
@ -316,6 +322,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("P -> C {} from {} to {}", clientReplyInfo, stream, receiverStream);
}
@ -338,6 +345,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void onData(final Stream stream, final DataInfo dataInfo)
{
if (LOG.isDebugEnabled())
LOG.debug("S -> P {} on {}", dataInfo, stream);
data(stream, dataInfo);
}
@ -359,6 +367,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void succeeded()
{
if (LOG.isDebugEnabled())
LOG.debug("P -> C {} from {} to {}", clientDataInfo, stream, receiverStream);
}
@ -396,6 +405,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
@Override
public void succeeded(Stream stream)
{
if (LOG.isDebugEnabled())
LOG.debug("P -> S {} from {} to {}", info, senderStream, stream);
stream.setAttribute(CLIENT_STREAM_ATTRIBUTE, senderStream);
@ -409,17 +419,20 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
{
if (dataInfoCallback.flushing)
{
if (LOG.isDebugEnabled())
LOG.debug("SYN completed, flushing {}, queue size {}", dataInfoCallback.dataInfo, queue.size());
dataInfoCallback = null;
}
else
{
dataInfoCallback.flushing = true;
if (LOG.isDebugEnabled())
LOG.debug("SYN completed, queue size {}", queue.size());
}
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("SYN completed, queue empty");
}
}
@ -448,17 +461,20 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
dataInfoCallbackToFlush = queue.peek();
if (dataInfoCallbackToFlush.flushing)
{
if (LOG.isDebugEnabled())
LOG.debug("Queued {}, flushing {}, queue size {}", dataInfo, dataInfoCallbackToFlush.dataInfo, queue.size());
receiverStream = null;
}
else
{
dataInfoCallbackToFlush.flushing = true;
if (LOG.isDebugEnabled())
LOG.debug("Queued {}, queue size {}", dataInfo, queue.size());
}
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Queued {}, SYN incomplete, queue size {}", dataInfo, queue.size());
}
}
@ -468,6 +484,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
private void flush(Stream receiverStream, DataInfoCallback dataInfoCallback)
{
if (LOG.isDebugEnabled())
LOG.debug("P -> S {} on {}", dataInfoCallback.dataInfo, receiverStream);
receiverStream.data(dataInfoCallback.dataInfo, dataInfoCallback); //TODO: timeout???
}
@ -498,10 +515,12 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
{
assert !dataInfoCallback.flushing;
dataInfoCallback.flushing = true;
if (LOG.isDebugEnabled())
LOG.debug("Completed {}, queue size {}", dataInfo, queue.size());
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("Completed {}, queue empty", dataInfo);
}
}
@ -550,6 +569,7 @@ public class SPDYProxyEngine extends ProxyEngine implements StreamFrameListener
{
super.succeeded(receiverStream);
if (LOG.isDebugEnabled())
LOG.debug("P -> C PushStreamPromise.succeeded() called with pushStreamPromise: {}", pushStreamPromise);
PushStreamPromise promise = pushStreamPromise;

View File

@ -138,6 +138,7 @@ public class LeakDetector<T> extends AbstractLifeCycle implements Runnable
{
@SuppressWarnings("unchecked")
LeakInfo leakInfo = (LeakInfo)queue.remove();
if (LOG.isDebugEnabled())
LOG.debug("Resource GC'ed: {}", leakInfo);
if (resources.remove(leakInfo.id) != null)
leaked(leakInfo);

View File

@ -557,13 +557,17 @@ public class Scanner extends AbstractLifeCycle
{
if ((_filter == null) || ((_filter != null) && _filter.accept(f.getParentFile(), f.getName())))
{
if (LOG.isDebugEnabled())
LOG.debug("scan accepted {}",f);
String name = f.getCanonicalPath();
scanInfoMap.put(name, new TimeNSize(f.lastModified(),f.length()));
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("scan rejected {}",f);
}
}
// If it is a directory, scan if it is a known directory or the depth is OK.
if (f.isDirectory() && (depth<_scanDepth || _scanDepth==-1 || _scanDirs.contains(f)))

View File

@ -148,6 +148,7 @@ public class SocketAddressResolver
long start = System.nanoTime();
InetSocketAddress result = new InetSocketAddress(host, port);
long elapsed = System.nanoTime() - start;
if (LOG.isDebugEnabled())
LOG.debug("Resolved {} in {} ms", host, TimeUnit.NANOSECONDS.toMillis(elapsed));
if (complete.compareAndSet(false, true))
{

View File

@ -570,6 +570,7 @@ public class TypeUtil
// target has no annotations
if ( parameterAnnotations == null || parameterAnnotations.length == 0 )
{
if (LOG.isDebugEnabled())
LOG.debug("Target has no parameter annotations");
return constructor.newInstance(arguments);
}
@ -588,11 +589,13 @@ public class TypeUtil
if (namedArgMap.containsKey(param.value()))
{
if (LOG.isDebugEnabled())
LOG.debug("placing named {} in position {}", param.value(), count);
swizzled[count] = namedArgMap.get(param.value());
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("placing {} in position {}", arguments[count], count);
swizzled[count] = arguments[count];
}
@ -600,6 +603,7 @@ public class TypeUtil
}
else
{
if (LOG.isDebugEnabled())
LOG.debug("passing on annotation {}", annotation);
}
}

View File

@ -174,7 +174,6 @@ public abstract class AbstractLifeCycle implements LifeCycle
{
_state = __STARTED;
if (LOG.isDebugEnabled())
LOG.debug(STARTED+" @{}ms {}",ManagementFactory.getRuntimeMXBean().getUptime(),this);
for (Listener listener : _listeners)
listener.lifeCycleStarted(this);
@ -182,6 +181,7 @@ public abstract class AbstractLifeCycle implements LifeCycle
private void setStarting()
{
if (LOG.isDebugEnabled())
LOG.debug("starting {}",this);
_state = __STARTING;
for (Listener listener : _listeners)
@ -190,6 +190,7 @@ public abstract class AbstractLifeCycle implements LifeCycle
private void setStopping()
{
if (LOG.isDebugEnabled())
LOG.debug("stopping {}",this);
_state = __STOPPING;
for (Listener listener : _listeners)
@ -199,6 +200,7 @@ public abstract class AbstractLifeCycle implements LifeCycle
private void setStopped()
{
_state = __STOPPED;
if (LOG.isDebugEnabled())
LOG.debug("{} {}",STOPPED,this);
for (Listener listener : _listeners)
listener.lifeCycleStopped(this);

View File

@ -320,6 +320,7 @@ public class ContainerLifeCycle extends AbstractLifeCycle implements Container,
throw new RuntimeException(e);
}
if (LOG.isDebugEnabled())
LOG.debug("{} added {}",this,new_bean);
return true;

View File

@ -86,6 +86,7 @@ public class FileDestroyable implements Destroyable
{
if (file.exists())
{
if (LOG.isDebugEnabled())
LOG.debug("Destroy {}",file);
IO.delete(file);
}

View File

@ -40,6 +40,7 @@ public class AWTLeakPreventer extends AbstractLeakPreventer
@Override
public void prevent(ClassLoader loader)
{
if (LOG.isDebugEnabled())
LOG.debug("Pinning classloader for java.awt.EventQueue using "+loader);
Toolkit.getDefaultToolkit();
}

View File

@ -34,6 +34,7 @@ public class AppContextLeakPreventer extends AbstractLeakPreventer
@Override
public void prevent(ClassLoader loader)
{
if (LOG.isDebugEnabled())
LOG.debug("Pinning classloader for AppContext.getContext() with "+loader);
ImageIO.getUseCache();
}

View File

@ -35,6 +35,7 @@ public class DriverManagerLeakPreventer extends AbstractLeakPreventer
@Override
public void prevent(ClassLoader loader)
{
if (LOG.isDebugEnabled())
LOG.debug("Pinning DriverManager classloader with "+loader);
DriverManager.getDrivers();
}

View File

@ -148,6 +148,7 @@ public class FileResource extends Resource
if (!abs.equals(can))
{
if (LOG.isDebugEnabled())
LOG.debug("ALIAS abs={} can={}",abs,can);
URI alias=new File(can).toURI();

View File

@ -73,6 +73,7 @@ class JarFileResource extends JarResource
{
try
{
if (LOG.isDebugEnabled())
LOG.debug("Closing JarFile "+_jarFile.getName());
_jarFile.close();
}

View File

@ -251,6 +251,7 @@ public class SslContextFactory extends AbstractLifeCycle
if (_trustAll)
{
if (LOG.isDebugEnabled())
LOG.debug("No keystore or trust store configured. ACCEPTING UNTRUSTED CERTIFICATES!!!!!");
// Create a trust manager that does not validate certificate chains
trust_managers = TRUST_ALL_CERTS;
@ -304,11 +305,13 @@ public class SslContextFactory extends AbstractLifeCycle
}
SSLEngine engine = newSSLEngine();
LOG.debug("Enabled Protocols {} of {}",Arrays.asList(engine.getEnabledProtocols()),Arrays.asList(engine.getSupportedProtocols()));
if (LOG.isDebugEnabled())
{
LOG.debug("Enabled Protocols {} of {}",Arrays.asList(engine.getEnabledProtocols()),Arrays.asList(engine.getSupportedProtocols()));
LOG.debug("Enabled Ciphers {} of {}",Arrays.asList(engine.getEnabledCipherSuites()),Arrays.asList(engine.getSupportedCipherSuites()));
}
}
}
@Override
protected void doStop() throws Exception