293739 - Deprecate static Jetty Log usage in favor of named logs
+ Finished conversion of jetty-ajp, jetty-client, jetty-deploy, jetty-jaspi, jetty-jndi, jetty-plus, jetty-webapp
This commit is contained in:
parent
f7f7e0af75
commit
3399242d83
|
@ -27,9 +27,10 @@ import org.eclipse.jetty.io.Buffer;
|
|||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.server.BlockingHttpConnection;
|
||||
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.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* Connection implementation of the Ajp13 protocol. <p/> XXX Refactor to remove
|
||||
|
@ -38,6 +39,8 @@ import org.eclipse.jetty.server.Server;
|
|||
*/
|
||||
public class Ajp13Connection extends BlockingHttpConnection
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Ajp13Connection.class);
|
||||
|
||||
public Ajp13Connection(Connector connector, EndPoint endPoint, Server server)
|
||||
{
|
||||
super(connector, endPoint, server,
|
||||
|
@ -124,8 +127,8 @@ public class Ajp13Connection extends BlockingHttpConnection
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
org.eclipse.jetty.util.log.Log.warn(e.toString());
|
||||
org.eclipse.jetty.util.log.Log.ignore(e);
|
||||
LOG.warn(e.toString());
|
||||
LOG.ignore(e);
|
||||
if (sslCert!=null)
|
||||
_request.setAttribute("javax.servlet.request.X509Certificate", sslCert.toString());
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.io.EofException;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -36,6 +37,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class Ajp13Generator extends AbstractGenerator
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Ajp13Generator.class);
|
||||
|
||||
private static HashMap __headerHash = new HashMap();
|
||||
|
||||
static
|
||||
|
@ -214,7 +217,7 @@ public class Ajp13Generator extends AbstractGenerator
|
|||
|
||||
if (_last || _state == STATE_END)
|
||||
{
|
||||
Log.debug("Ignoring extra content {}", content);
|
||||
LOG.debug("Ignoring extra content {}", content);
|
||||
content.clear();
|
||||
return;
|
||||
}
|
||||
|
@ -627,7 +630,7 @@ public class Ajp13Generator extends AbstractGenerator
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
throw (e instanceof EofException) ? e : new EofException(e);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,12 +27,15 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.io.EofException;
|
||||
import org.eclipse.jetty.io.View;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Ajp13Parser implements Parser
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Ajp13Parser.class);
|
||||
|
||||
private final static int STATE_START = -1;
|
||||
private final static int STATE_END = 0;
|
||||
private final static int STATE_AJP13CHUNK_START = 1;
|
||||
|
@ -205,7 +208,7 @@ public class Ajp13Parser implements Parser
|
|||
catch (IOException e)
|
||||
{
|
||||
// This is normal in AJP since the socket closes on timeout only
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
reset();
|
||||
throw (e instanceof EofException) ? e : new EofException(e);
|
||||
}
|
||||
|
@ -328,7 +331,7 @@ public class Ajp13Parser implements Parser
|
|||
default:
|
||||
// XXX Throw an Exception here?? Close
|
||||
// connection!
|
||||
Log.warn("AJP13 message type ({PING}: "+packetType+" ) not supported/recognized as an AJP request");
|
||||
LOG.warn("AJP13 message type ({PING}: "+packetType+" ) not supported/recognized as an AJP request");
|
||||
throw new IllegalStateException("PING is not implemented");
|
||||
}
|
||||
|
||||
|
@ -459,7 +462,7 @@ public class Ajp13Parser implements Parser
|
|||
|
||||
break;
|
||||
default:
|
||||
Log.warn("Unsupported Ajp13 Request Attribute {}", new Integer(attr_type));
|
||||
LOG.warn("Unsupported Ajp13 Request Attribute {}", new Integer(attr_type));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -681,37 +684,37 @@ public class Ajp13Parser implements Parser
|
|||
|
||||
if(!Ajp13SocketConnector.__allowShutdown)
|
||||
{
|
||||
Log.warn("AJP13: Shutdown Request is Denied, allowShutdown is set to false!!!");
|
||||
LOG.warn("AJP13: Shutdown Request is Denied, allowShutdown is set to false!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(Ajp13SocketConnector.__secretWord != null)
|
||||
{
|
||||
Log.warn("AJP13: Validating Secret Word");
|
||||
LOG.warn("AJP13: Validating Secret Word");
|
||||
try
|
||||
{
|
||||
String secretWord = Ajp13RequestPacket.getString(_buffer, _tok1).toString();
|
||||
|
||||
if(!Ajp13SocketConnector.__secretWord.equals(secretWord))
|
||||
{
|
||||
Log.warn("AJP13: Shutdown Request Denied, Invalid Sercret word!!!");
|
||||
LOG.warn("AJP13: Shutdown Request Denied, Invalid Sercret word!!!");
|
||||
throw new IllegalStateException("AJP13: Secret Word is Invalid: Peer has requested shutdown but, Secret Word did not match");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("AJP13: Secret Word is Required!!!");
|
||||
Log.debug(e);
|
||||
LOG.warn("AJP13: Secret Word is Required!!!");
|
||||
LOG.debug(e);
|
||||
throw new IllegalStateException("AJP13: Secret Word is Required: Peer has requested shutdown but, has not provided a Secret Word");
|
||||
}
|
||||
|
||||
|
||||
Log.warn("AJP13: Shutdown Request is Denied, allowShutdown is set to false!!!");
|
||||
LOG.warn("AJP13: Shutdown Request is Denied, allowShutdown is set to false!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
Log.warn("AJP13: Peer Has Requested for Shutdown!!!");
|
||||
Log.warn("AJP13: Jetty 6 is shutting down !!!");
|
||||
LOG.warn("AJP13: Peer Has Requested for Shutdown!!!");
|
||||
LOG.warn("AJP13: Jetty 6 is shutting down !!!");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.server.Request;
|
||||
import org.eclipse.jetty.server.bio.SocketConnector;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -29,6 +30,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class Ajp13SocketConnector extends SocketConnector
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Ajp13SocketConnector.class);
|
||||
|
||||
static String __secretWord = null;
|
||||
static boolean __allowShutdown = false;
|
||||
public Ajp13SocketConnector()
|
||||
|
@ -46,7 +49,7 @@ public class Ajp13SocketConnector extends SocketConnector
|
|||
protected void doStart() throws Exception
|
||||
{
|
||||
super.doStart();
|
||||
Log.info("AJP13 is not a secure protocol. Please protect port {}",Integer.toString(getLocalPort()));
|
||||
LOG.info("AJP13 is not a secure protocol. Please protect port {}",Integer.toString(getLocalPort()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,34 +93,34 @@ public class Ajp13SocketConnector extends SocketConnector
|
|||
@Deprecated
|
||||
public void setHeaderBufferSize(int headerBufferSize)
|
||||
{
|
||||
Log.debug(Log.IGNORED);
|
||||
LOG.debug(Log.IGNORED);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public void setRequestBufferSize(int requestBufferSize)
|
||||
{
|
||||
Log.debug(Log.IGNORED);
|
||||
LOG.debug(Log.IGNORED);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public void setResponseBufferSize(int responseBufferSize)
|
||||
{
|
||||
Log.debug(Log.IGNORED);
|
||||
LOG.debug(Log.IGNORED);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setAllowShutdown(boolean allowShutdown)
|
||||
{
|
||||
Log.warn("AJP13: Shutdown Request is: " + allowShutdown);
|
||||
LOG.warn("AJP13: Shutdown Request is: " + allowShutdown);
|
||||
__allowShutdown = allowShutdown;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setSecretWord(String secretWord)
|
||||
{
|
||||
Log.warn("AJP13: Shutdown Request secret word is : " + secretWord);
|
||||
LOG.warn("AJP13: Shutdown Request secret word is : " + secretWord);
|
||||
__secretWord = secretWord;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
|
@ -42,6 +43,8 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
public class Ajp13ConnectionTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Ajp13ConnectionTest.class);
|
||||
|
||||
private static Server _server;
|
||||
private static Ajp13SocketConnector _connector;
|
||||
private Socket _client;
|
||||
|
@ -305,7 +308,7 @@ public class Ajp13ConnectionTest
|
|||
}
|
||||
catch(SocketTimeoutException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
return bout.toString("utf-8");
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.jetty.io.nio.SslSelectChannelEndPoint;
|
|||
import org.eclipse.jetty.util.component.AggregateLifeCycle;
|
||||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Timeout;
|
||||
|
||||
/**
|
||||
|
@ -50,6 +51,8 @@ import org.eclipse.jetty.util.thread.Timeout;
|
|||
*/
|
||||
public class HttpConnection extends AbstractConnection implements Dumpable
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HttpConnection.class);
|
||||
|
||||
private HttpDestination _destination;
|
||||
private HttpGenerator _generator;
|
||||
private HttpParser _parser;
|
||||
|
@ -195,7 +198,7 @@ public class HttpConnection extends AbstractConnection implements Dumpable
|
|||
_parser.skipCRLF();
|
||||
if (_parser.isMoreInBuffer())
|
||||
{
|
||||
Log.warn("Unexpected data received but no request sent");
|
||||
LOG.warn("Unexpected data received but no request sent");
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
@ -292,7 +295,7 @@ public class HttpConnection extends AbstractConnection implements Dumpable
|
|||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
Log.debug("Failure on " + _exchange, e);
|
||||
LOG.debug("Failure on " + _exchange, e);
|
||||
|
||||
if (e instanceof ThreadDeath)
|
||||
throw (ThreadDeath)e;
|
||||
|
@ -706,7 +709,7 @@ public class HttpConnection extends AbstractConnection implements Dumpable
|
|||
}
|
||||
catch (IOException x)
|
||||
{
|
||||
Log.ignore(x);
|
||||
LOG.ignore(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,12 +38,15 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.util.component.AggregateLifeCycle;
|
||||
import org.eclipse.jetty.util.component.Dumpable;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* @version $Revision: 879 $ $Date: 2009-09-11 16:13:28 +0200 (Fri, 11 Sep 2009) $
|
||||
*/
|
||||
public class HttpDestination implements Dumpable
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HttpDestination.class);
|
||||
|
||||
private final List<HttpExchange> _queue = new LinkedList<HttpExchange>();
|
||||
private final List<HttpConnection> _connections = new LinkedList<HttpConnection>();
|
||||
private final BlockingQueue<Object> _newQueue = new ArrayBlockingQueue<Object>(10, true);
|
||||
|
@ -197,7 +200,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -210,7 +213,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -266,7 +269,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
onConnectionFailed(e);
|
||||
}
|
||||
}
|
||||
|
@ -308,7 +311,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -373,7 +376,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -391,7 +394,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,7 +441,7 @@ public class HttpDestination implements Dumpable
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
|
||||
boolean startConnection = false;
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.eclipse.jetty.io.ByteArrayBuffer;
|
|||
import org.eclipse.jetty.io.Connection;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Timeout;
|
||||
|
||||
/**
|
||||
|
@ -66,6 +67,8 @@ import org.eclipse.jetty.util.thread.Timeout;
|
|||
*/
|
||||
public class HttpExchange
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HttpExchange.class);
|
||||
|
||||
public static final int STATUS_START = 0;
|
||||
public static final int STATUS_WAITING_FOR_CONNECTION = 1;
|
||||
public static final int STATUS_WAITING_FOR_COMMIT = 2;
|
||||
|
@ -348,7 +351,7 @@ public class HttpExchange
|
|||
}
|
||||
catch (IOException x)
|
||||
{
|
||||
Log.warn(x);
|
||||
LOG.warn(x);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -693,7 +696,7 @@ public class HttpExchange
|
|||
}
|
||||
catch (IOException x)
|
||||
{
|
||||
Log.debug(x);
|
||||
LOG.debug(x);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -838,7 +841,7 @@ public class HttpExchange
|
|||
*/
|
||||
protected void onConnectionFailed(Throwable x)
|
||||
{
|
||||
Log.warn("CONNECTION FAILED " + this,x);
|
||||
LOG.warn("CONNECTION FAILED " + this,x);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -848,7 +851,7 @@ public class HttpExchange
|
|||
*/
|
||||
protected void onException(Throwable x)
|
||||
{
|
||||
Log.warn("EXCEPTION " + this,x);
|
||||
LOG.warn("EXCEPTION " + this,x);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -857,7 +860,7 @@ public class HttpExchange
|
|||
*/
|
||||
protected void onExpire()
|
||||
{
|
||||
Log.warn("EXPIRED " + this);
|
||||
LOG.warn("EXPIRED " + this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1042,7 +1045,7 @@ public class HttpExchange
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,13 @@ import org.eclipse.jetty.io.nio.SelectorManager;
|
|||
import org.eclipse.jetty.io.nio.SslSelectChannelEndPoint;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.thread.Timeout;
|
||||
|
||||
class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector, Runnable
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(SelectConnector.class);
|
||||
|
||||
private final HttpClient _httpClient;
|
||||
private final Manager _selectorManager=new Manager();
|
||||
private final Map<SocketChannel, Timeout.Task> _connectingChannels = new ConcurrentHashMap<SocketChannel, Timeout.Task>();
|
||||
|
@ -128,8 +131,8 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e.toString());
|
||||
Log.debug(e);
|
||||
LOG.warn(e.toString());
|
||||
LOG.debug(e);
|
||||
Thread.yield();
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +178,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
|
|||
Timeout.Task connectTimeout = _connectingChannels.remove(channel);
|
||||
if (connectTimeout != null)
|
||||
connectTimeout.cancel();
|
||||
Log.debug("Channels with connection pending: {}", _connectingChannels.size());
|
||||
LOG.debug("Channels with connection pending: {}", _connectingChannels.size());
|
||||
|
||||
// key should have destination at this point (will be replaced by endpoint after this call)
|
||||
HttpDestination dest=(HttpDestination)key.attachment();
|
||||
|
@ -261,7 +264,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
|
|||
{
|
||||
if (channel.isConnectionPending())
|
||||
{
|
||||
Log.debug("Channel {} timed out while connecting, closing it", channel);
|
||||
LOG.debug("Channel {} timed out while connecting, closing it", channel);
|
||||
try
|
||||
{
|
||||
// This will unregister the channel from the selector
|
||||
|
@ -269,7 +272,7 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
|
|||
}
|
||||
catch (IOException x)
|
||||
{
|
||||
Log.ignore(x);
|
||||
LOG.ignore(x);
|
||||
}
|
||||
destination.onConnectionFailed(new SocketTimeoutException());
|
||||
}
|
||||
|
|
|
@ -24,9 +24,12 @@ import org.eclipse.jetty.io.EndPoint;
|
|||
import org.eclipse.jetty.io.bio.SocketEndPoint;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
class SocketConnector extends AbstractLifeCycle implements HttpClient.Connector
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(SocketConnector.class);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -51,7 +54,7 @@ class SocketConnector extends AbstractLifeCycle implements HttpClient.Connector
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.debug("Using Regular Socket");
|
||||
LOG.debug("Using Regular Socket");
|
||||
socket = SocketFactory.getDefault().createSocket();
|
||||
}
|
||||
|
||||
|
@ -87,10 +90,10 @@ class SocketConnector extends AbstractLifeCycle implements HttpClient.Connector
|
|||
catch (IOException e)
|
||||
{
|
||||
if (e instanceof InterruptedIOException)
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
else
|
||||
{
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
destination.onException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.jetty.http.HttpStatus;
|
|||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -35,7 +36,9 @@ import org.eclipse.jetty.util.log.Log;
|
|||
* HttpExchange.
|
||||
*/
|
||||
public class SecurityListener extends HttpEventListenerWrapper
|
||||
{
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(SecurityListener.class);
|
||||
|
||||
private HttpDestination _destination;
|
||||
private HttpExchange _exchange;
|
||||
private boolean _requestComplete;
|
||||
|
@ -105,7 +108,7 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.debug("SecurityListener: missed scraping authentication details - " + token );
|
||||
LOG.debug("SecurityListener: missed scraping authentication details - " + token );
|
||||
}
|
||||
}
|
||||
return authenticationDetails;
|
||||
|
@ -116,8 +119,8 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
public void onResponseStatus( Buffer version, int status, Buffer reason )
|
||||
throws IOException
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("SecurityListener:Response Status: " + status );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("SecurityListener:Response Status: " + status );
|
||||
|
||||
if ( status == HttpStatus.UNAUTHORIZED_401 && _attempts<_destination.getHttpClient().maxRetries())
|
||||
{
|
||||
|
@ -139,8 +142,8 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
public void onResponseHeader( Buffer name, Buffer value )
|
||||
throws IOException
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug( "SecurityListener:Header: " + name.toString() + " / " + value.toString() );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug( "SecurityListener:Header: " + name.toString() + " / " + value.toString() );
|
||||
|
||||
|
||||
if (!isDelegatingResponses())
|
||||
|
@ -168,7 +171,7 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
|
||||
if ( realm == null )
|
||||
{
|
||||
Log.warn( "Unknown Security Realm: " + details.get("realm") );
|
||||
LOG.warn( "Unknown Security Realm: " + details.get("realm") );
|
||||
}
|
||||
else if ("digest".equalsIgnoreCase(type))
|
||||
{
|
||||
|
@ -196,8 +199,8 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
{
|
||||
if (_requestComplete && _responseComplete)
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("onRequestComplete, Both complete: Resending from onResponseComplete "+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onRequestComplete, Both complete: Resending from onResponseComplete "+_exchange);
|
||||
_responseComplete = false;
|
||||
_requestComplete = false;
|
||||
setDelegatingRequests(true);
|
||||
|
@ -206,15 +209,15 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("onRequestComplete, Response not yet complete onRequestComplete, calling super for "+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onRequestComplete, Response not yet complete onRequestComplete, calling super for "+_exchange);
|
||||
super.onRequestComplete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("onRequestComplete, delegating to super with Request complete="+_requestComplete+", response complete="+_responseComplete+" "+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onRequestComplete, delegating to super with Request complete="+_requestComplete+", response complete="+_responseComplete+" "+_exchange);
|
||||
super.onRequestComplete();
|
||||
}
|
||||
}
|
||||
|
@ -228,8 +231,8 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
{
|
||||
if (_requestComplete && _responseComplete)
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("onResponseComplete, Both complete: Resending from onResponseComplete"+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onResponseComplete, Both complete: Resending from onResponseComplete"+_exchange);
|
||||
_responseComplete = false;
|
||||
_requestComplete = false;
|
||||
setDelegatingResponses(true);
|
||||
|
@ -239,15 +242,15 @@ public class SecurityListener extends HttpEventListenerWrapper
|
|||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("onResponseComplete, Request not yet complete from onResponseComplete, calling super "+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onResponseComplete, Request not yet complete from onResponseComplete, calling super "+_exchange);
|
||||
super.onResponseComplete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("OnResponseComplete, delegating to super with Request complete="+_requestComplete+", response complete="+_responseComplete+" "+_exchange);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("OnResponseComplete, delegating to super with Request complete="+_requestComplete+", response complete="+_responseComplete+" "+_exchange);
|
||||
super.onResponseComplete();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,10 +19,13 @@ import org.eclipse.jetty.client.CachedExchange;
|
|||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
public class MkcolExchange extends CachedExchange
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(MkcolExchange.class);
|
||||
|
||||
boolean exists = false;
|
||||
|
||||
public MkcolExchange()
|
||||
|
@ -36,13 +39,13 @@ public class MkcolExchange extends CachedExchange
|
|||
{
|
||||
if ( status == HttpStatus.CREATED_201 )
|
||||
{
|
||||
Log.debug( "MkcolExchange:Status: Successfully created resource" );
|
||||
LOG.debug( "MkcolExchange:Status: Successfully created resource" );
|
||||
exists = true;
|
||||
}
|
||||
|
||||
if ( status == HttpStatus.METHOD_NOT_ALLOWED_405 ) // returned when resource exists
|
||||
{
|
||||
Log.debug( "MkcolExchange:Status: Resource must exist" );
|
||||
LOG.debug( "MkcolExchange:Status: Resource must exist" );
|
||||
exists = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,10 +19,13 @@ import org.eclipse.jetty.client.HttpExchange;
|
|||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
public class PropfindExchange extends HttpExchange
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PropfindExchange.class);
|
||||
|
||||
boolean _propertyExists = false;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -31,12 +34,12 @@ public class PropfindExchange extends HttpExchange
|
|||
{
|
||||
if ( status == HttpStatus.OK_200 )
|
||||
{
|
||||
Log.debug( "PropfindExchange:Status: Exists" );
|
||||
LOG.debug( "PropfindExchange:Status: Exists" );
|
||||
_propertyExists = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.debug( "PropfindExchange:Status: Not Exists" );
|
||||
LOG.debug( "PropfindExchange:Status: Not Exists" );
|
||||
}
|
||||
|
||||
super.onResponseStatus(version, status, reason);
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.jetty.http.HttpStatus;
|
|||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* WebdavListener
|
||||
|
@ -35,6 +36,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class WebdavListener extends HttpEventListenerWrapper
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebdavListener.class);
|
||||
|
||||
private HttpDestination _destination;
|
||||
private HttpExchange _exchange;
|
||||
private boolean _requestComplete;
|
||||
|
@ -67,8 +70,8 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
return;
|
||||
}
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavListener:Response Status: " + status );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavListener:Response Status: " + status );
|
||||
|
||||
// The dav spec says that CONFLICT should be returned when the parent collection doesn't exist but I am seeing
|
||||
// FORBIDDEN returned instead so running with that.
|
||||
|
@ -76,15 +79,15 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
{
|
||||
if ( _webdavEnabled )
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavListener:Response Status: dav enabled, taking a stab at resolving put issue" );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavListener:Response Status: dav enabled, taking a stab at resolving put issue" );
|
||||
setDelegatingResponses( false ); // stop delegating, we can try and fix this request
|
||||
_needIntercept = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavListener:Response Status: Webdav Disabled" );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavListener:Response Status: Webdav Disabled" );
|
||||
setDelegatingResponses( true ); // just make sure we delegate
|
||||
setDelegatingRequests( true );
|
||||
_needIntercept = false;
|
||||
|
@ -130,14 +133,14 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
}
|
||||
catch ( IOException ioe )
|
||||
{
|
||||
Log.debug("WebdavListener:Complete:IOException: might not be dealing with dav server, delegate");
|
||||
LOG.debug("WebdavListener:Complete:IOException: might not be dealing with dav server, delegate");
|
||||
super.onResponseComplete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavListener:Not ready, calling super");
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavListener:Not ready, calling super");
|
||||
super.onResponseComplete();
|
||||
}
|
||||
}
|
||||
|
@ -178,14 +181,14 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
}
|
||||
catch ( IOException ioe )
|
||||
{
|
||||
Log.debug("WebdavListener:Complete:IOException: might not be dealing with dav server, delegate");
|
||||
LOG.debug("WebdavListener:Complete:IOException: might not be dealing with dav server, delegate");
|
||||
super.onRequestComplete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavListener:Not ready, calling super");
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavListener:Not ready, calling super");
|
||||
super.onRequestComplete();
|
||||
}
|
||||
}
|
||||
|
@ -265,7 +268,7 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
}
|
||||
catch ( InterruptedException ie )
|
||||
{
|
||||
Log.ignore( ie );
|
||||
LOG.ignore( ie );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +293,7 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
}
|
||||
catch ( InterruptedException ie )
|
||||
{
|
||||
Log.ignore( ie );
|
||||
LOG.ignore( ie );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -315,7 +318,7 @@ public class WebdavListener extends HttpEventListenerWrapper
|
|||
}
|
||||
catch (InterruptedException ie )
|
||||
{
|
||||
Log.ignore( ie );
|
||||
LOG.ignore( ie );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,18 +18,21 @@ import java.io.IOException;
|
|||
import org.eclipse.jetty.client.HttpExchange;
|
||||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
public class WebdavSupportedExchange extends HttpExchange
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebdavSupportedExchange.class);
|
||||
|
||||
private boolean _webdavSupported = false;
|
||||
private boolean _isComplete = false;
|
||||
|
||||
@Override
|
||||
protected void onResponseHeader(Buffer name, Buffer value) throws IOException
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("WebdavSupportedExchange:Header:" + name.toString() + " / " + value.toString() );
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("WebdavSupportedExchange:Header:" + name.toString() + " / " + value.toString() );
|
||||
if ( "DAV".equals( name.toString() ) )
|
||||
{
|
||||
if ( value.toString().indexOf( "1" ) >= 0 || value.toString().indexOf( "2" ) >= 0 )
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.jetty.server.Server;
|
|||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.server.nio.SelectChannelConnector;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.log.StdErrLog;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
|
@ -43,6 +44,8 @@ import org.junit.Test;
|
|||
*/
|
||||
public abstract class AbstractHttpExchangeCancelTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(AbstractHttpExchangeCancelTest.class);
|
||||
|
||||
private Server server;
|
||||
private Connector connector;
|
||||
|
||||
|
@ -319,7 +322,7 @@ public abstract class AbstractHttpExchangeCancelTest
|
|||
{
|
||||
try
|
||||
{
|
||||
((StdErrLog)Log.getLog()).setHideStacks(!Log.isDebugEnabled());
|
||||
((StdErrLog)Log.getLog()).setHideStacks(!LOG.isDebugEnabled());
|
||||
TestHttpExchange exchange = new TestHttpExchange();
|
||||
exchange.setAddress(newAddress());
|
||||
exchange.setURI("/?action=throw");
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.eclipse.jetty.server.nio.SelectChannelConnector;
|
|||
import org.eclipse.jetty.toolchain.test.Stress;
|
||||
import org.eclipse.jetty.util.IO;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -57,6 +58,8 @@ import org.junit.Test;
|
|||
*/
|
||||
public class HttpExchangeTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HttpExchangeTest.class);
|
||||
|
||||
protected int _maxConnectionsPerAddress = 2;
|
||||
protected String _scheme = "http://";
|
||||
protected Server _server;
|
||||
|
@ -615,7 +618,7 @@ public class HttpExchangeTest
|
|||
}
|
||||
catch(InterruptedException e)
|
||||
{
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
|
|
|
@ -34,12 +34,15 @@ import org.eclipse.jetty.server.Server;
|
|||
import org.eclipse.jetty.server.handler.AbstractHandler;
|
||||
import org.eclipse.jetty.server.nio.SelectChannelConnector;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
public class HttpHeadersTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HttpHeadersTest.class);
|
||||
|
||||
private static final String CONTENT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. In quis felis nunc. "
|
||||
+ "Quisque suscipit mauris et ante auctor ornare rhoncus lacus aliquet. Pellentesque "
|
||||
+ "habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. "
|
||||
|
@ -133,7 +136,7 @@ public class HttpHeadersTest
|
|||
protected void onException(Throwable x)
|
||||
{
|
||||
// suppress exception
|
||||
Log.ignore(x);
|
||||
LOG.ignore(x);
|
||||
}
|
||||
};
|
||||
exchange.setURL(requestUrl);
|
||||
|
|
|
@ -50,6 +50,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
|
|||
import org.eclipse.jetty.server.ssl.SslSocketConnector;
|
||||
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@ -60,6 +61,8 @@ import org.junit.Test;
|
|||
*/
|
||||
public class SslSecurityListenerTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(SslSecurityListenerTest.class);
|
||||
|
||||
protected Server _server;
|
||||
protected int _port;
|
||||
protected HttpClient _httpClient;
|
||||
|
@ -120,7 +123,7 @@ public class SslSecurityListenerTest
|
|||
// TODO Resolve problems on IBM JVM https://bugs.eclipse.org/bugs/show_bug.cgi?id=304532
|
||||
if (System.getProperty("java.vendor").toLowerCase().indexOf("ibm")>=0)
|
||||
{
|
||||
Log.warn("Skipped SSL testSslGet on IBM JVM");
|
||||
LOG.warn("Skipped SSL testSslGet on IBM JVM");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Set;
|
|||
import org.eclipse.jetty.deploy.graph.Graph;
|
||||
import org.eclipse.jetty.deploy.graph.Node;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* The lifecycle of an App in the {@link DeploymentManager}.
|
||||
|
@ -36,6 +37,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class AppLifeCycle extends Graph
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(AppLifeCycle.class);
|
||||
|
||||
private static final String ALL_NODES = "*";
|
||||
|
||||
public static interface Binding
|
||||
|
@ -175,8 +178,8 @@ public class AppLifeCycle extends Graph
|
|||
{
|
||||
for (Binding binding : getBindings(node))
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Calling " + binding.getClass().getName()+" for "+app);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Calling " + binding.getClass().getName()+" for "+app);
|
||||
binding.processBinding(node,app);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.jetty.util.AttributesMap;
|
|||
import org.eclipse.jetty.util.Scanner;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
|
||||
|
@ -75,6 +76,8 @@ import org.eclipse.jetty.xml.XmlConfiguration;
|
|||
@Deprecated
|
||||
public class ContextDeployer extends AbstractLifeCycle
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(ContextDeployer.class);
|
||||
|
||||
private int _scanInterval=10;
|
||||
private Scanner _scanner;
|
||||
private ScannerListener _scannerListener;
|
||||
|
@ -130,7 +133,7 @@ public class ContextDeployer extends AbstractLifeCycle
|
|||
*/
|
||||
public ContextDeployer()
|
||||
{
|
||||
Log.warn("ContextDeployer is deprecated. Use ContextProvider");
|
||||
LOG.warn("ContextDeployer is deprecated. Use ContextProvider");
|
||||
_scanner=new Scanner();
|
||||
}
|
||||
|
||||
|
@ -344,7 +347,7 @@ public class ContextDeployer extends AbstractLifeCycle
|
|||
private void deploy(String filename) throws Exception
|
||||
{
|
||||
ContextHandler context=createContext(filename);
|
||||
Log.info("Deploy "+filename+" -> "+ context);
|
||||
LOG.info("Deploy "+filename+" -> "+ context);
|
||||
_contexts.addHandler(context);
|
||||
_currentDeployments.put(filename,context);
|
||||
if (_contexts.isStarted())
|
||||
|
@ -355,7 +358,7 @@ public class ContextDeployer extends AbstractLifeCycle
|
|||
private void undeploy(String filename) throws Exception
|
||||
{
|
||||
ContextHandler context=(ContextHandler)_currentDeployments.get(filename);
|
||||
Log.info("Undeploy "+filename+" -> "+context);
|
||||
LOG.info("Undeploy "+filename+" -> "+context);
|
||||
if (context==null)
|
||||
return;
|
||||
context.stop();
|
||||
|
@ -402,7 +405,7 @@ public class ContextDeployer extends AbstractLifeCycle
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
|||
import org.eclipse.jetty.util.AttributesMap;
|
||||
import org.eclipse.jetty.util.component.AggregateLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* The Deployment Manager.
|
||||
|
@ -54,6 +55,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class DeploymentManager extends AggregateLifeCycle
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DeploymentManager.class);
|
||||
|
||||
/**
|
||||
* Represents a single tracked app within the deployment manager.
|
||||
*/
|
||||
|
@ -123,7 +126,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
*/
|
||||
public void addApp(App app)
|
||||
{
|
||||
Log.info("Deployable added: " + app.getOriginId());
|
||||
LOG.info("Deployable added: " + app.getOriginId());
|
||||
AppEntry entry = new AppEntry();
|
||||
entry.app = app;
|
||||
entry.setLifeCycleNode(_lifecycle.getNodeByName("undeployed"));
|
||||
|
@ -205,7 +208,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
{
|
||||
if (_useStandardBindings)
|
||||
{
|
||||
Log.debug("DeploymentManager using standard bindings");
|
||||
LOG.debug("DeploymentManager using standard bindings");
|
||||
addLifeCycleBinding(new StandardDeployer());
|
||||
addLifeCycleBinding(new StandardStarter());
|
||||
addLifeCycleBinding(new StandardStopper());
|
||||
|
@ -232,7 +235,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Unable to start AppProvider",e);
|
||||
LOG.warn("Unable to start AppProvider",e);
|
||||
}
|
||||
}
|
||||
super.doStop();
|
||||
|
@ -389,7 +392,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
if (! AppLifeCycle.UNDEPLOYED.equals(entry.lifecyleNode.getName()))
|
||||
requestAppGoal(entry.app,AppLifeCycle.UNDEPLOYED);
|
||||
it.remove();
|
||||
Log.info("Deployable removed: " + entry.app);
|
||||
LOG.info("Deployable removed: " + entry.app);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +411,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Unable to stop Provider",e);
|
||||
LOG.warn("Unable to stop Provider",e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,7 +481,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
while (it.hasNext())
|
||||
{
|
||||
Node node = it.next();
|
||||
Log.debug("Executing Node: " + node);
|
||||
LOG.debug("Executing Node: " + node);
|
||||
_lifecycle.runBindings(node,appentry.app,this);
|
||||
appentry.setLifeCycleNode(node);
|
||||
}
|
||||
|
@ -486,7 +489,7 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
Log.warn("Unable to reach node goal: " + nodeName,t);
|
||||
LOG.warn("Unable to reach node goal: " + nodeName,t);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,13 +547,13 @@ public class DeploymentManager extends AggregateLifeCycle
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Unable to start AppProvider",e);
|
||||
LOG.warn("Unable to start AppProvider",e);
|
||||
}
|
||||
}
|
||||
|
||||
public void undeployAll()
|
||||
{
|
||||
Log.info("Undeploy All");
|
||||
LOG.info("Undeploy All");
|
||||
for (AppEntry appentry : _apps)
|
||||
{
|
||||
requestAppGoal(appentry,"undeployed");
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.eclipse.jetty.util.AttributesMap;
|
|||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
|
@ -52,6 +53,8 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
@SuppressWarnings("unchecked")
|
||||
public class WebAppDeployer extends AbstractLifeCycle
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebAppDeployer.class);
|
||||
|
||||
private HandlerCollection _contexts;
|
||||
private String _webAppDir;
|
||||
private String _defaultsDescriptor;
|
||||
|
@ -65,7 +68,7 @@ public class WebAppDeployer extends AbstractLifeCycle
|
|||
|
||||
public WebAppDeployer()
|
||||
{
|
||||
Log.warn("WebAppDeployer is deprecated. Use WebAppProvider");
|
||||
LOG.warn("WebAppDeployer is deprecated. Use WebAppProvider");
|
||||
}
|
||||
|
||||
public String[] getConfigurationClasses()
|
||||
|
@ -254,13 +257,13 @@ public class WebAppDeployer extends AbstractLifeCycle
|
|||
|
||||
if (path != null && path.equals(app.getFile().getCanonicalPath()))
|
||||
{
|
||||
Log.debug("Already deployed:"+path);
|
||||
LOG.debug("Already deployed:"+path);
|
||||
continue files;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,9 +19,12 @@ import org.eclipse.jetty.deploy.App;
|
|||
import org.eclipse.jetty.deploy.AppLifeCycle;
|
||||
import org.eclipse.jetty.deploy.graph.Node;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class DebugBinding implements AppLifeCycle.Binding
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DebugBinding.class);
|
||||
|
||||
final String[] _targets;
|
||||
|
||||
public DebugBinding(String target)
|
||||
|
@ -41,6 +44,6 @@ public class DebugBinding implements AppLifeCycle.Binding
|
|||
|
||||
public void processBinding(Node node, App app) throws Exception
|
||||
{
|
||||
Log.info("processBinding {} {}",node,app.getContextHandler());
|
||||
LOG.info("processBinding {} {}",node,app.getContextHandler());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.jetty.deploy.AppLifeCycle;
|
|||
import org.eclipse.jetty.deploy.graph.Node;
|
||||
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.FileResource;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
@ -43,6 +44,8 @@ import org.eclipse.jetty.xml.XmlConfiguration;
|
|||
*/
|
||||
public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(GlobalWebappConfigBinding.class);
|
||||
|
||||
|
||||
private String _jettyXml;
|
||||
|
||||
|
@ -73,14 +76,14 @@ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
|
|||
{
|
||||
WebAppContext context = (WebAppContext)handler;
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
Log.debug("Binding: Configuring webapp context with global settings from: " + _jettyXml);
|
||||
LOG.debug("Binding: Configuring webapp context with global settings from: " + _jettyXml);
|
||||
}
|
||||
|
||||
if ( _jettyXml == null )
|
||||
{
|
||||
Log.warn("Binding: global context binding is enabled but no jetty-web.xml file has been registered");
|
||||
LOG.warn("Binding: global context binding is enabled but no jetty-web.xml file has been registered");
|
||||
}
|
||||
|
||||
Resource globalContextSettings = Resource.newResource(_jettyXml);
|
||||
|
@ -93,7 +96,7 @@ public class GlobalWebappConfigBinding implements AppLifeCycle.Binding
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.info("Binding: Unable to locate global webapp context settings: " + _jettyXml);
|
||||
LOG.info("Binding: Unable to locate global webapp context settings: " + _jettyXml);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,12 @@ import org.eclipse.jetty.server.handler.ContextHandler;
|
|||
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||
import org.eclipse.jetty.server.handler.HandlerCollection;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class StandardUndeployer implements AppLifeCycle.Binding
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(StandardUndeployer.class);
|
||||
|
||||
public String[] getBindingTargets()
|
||||
{
|
||||
return new String[]
|
||||
|
@ -48,13 +51,13 @@ public class StandardUndeployer implements AppLifeCycle.Binding
|
|||
for (int i = 0, n = children.length; i < n; i++)
|
||||
{
|
||||
Handler child = children[i];
|
||||
Log.debug("Child handler: " + child);
|
||||
LOG.debug("Child handler: " + child);
|
||||
if (child.equals(context))
|
||||
{
|
||||
Log.debug("Removing handler: " + child);
|
||||
LOG.debug("Removing handler: " + child);
|
||||
coll.removeHandler(child);
|
||||
child.destroy();
|
||||
Log.debug(String.format("After removal: %d (originally %d)",coll.getHandlers().length,originalCount));
|
||||
LOG.debug(String.format("After removal: %d (originally %d)",coll.getHandlers().length,originalCount));
|
||||
}
|
||||
else if (child instanceof HandlerCollection)
|
||||
{
|
||||
|
|
|
@ -27,12 +27,15 @@ import org.eclipse.jetty.deploy.DeploymentManager;
|
|||
import org.eclipse.jetty.util.Scanner;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/**
|
||||
*/
|
||||
public abstract class ScanningAppProvider extends AbstractLifeCycle implements AppProvider
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(ScanningAppProvider.class);
|
||||
|
||||
private Map<String, App> _appMap = new HashMap<String, App>();
|
||||
|
||||
private DeploymentManager _deploymentManager;
|
||||
|
@ -96,14 +99,14 @@ public abstract class ScanningAppProvider extends AbstractLifeCycle implements A
|
|||
@Override
|
||||
protected void doStart() throws Exception
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug(this.getClass().getSimpleName() + ".doStart()");
|
||||
if (LOG.isDebugEnabled()) LOG.debug(this.getClass().getSimpleName() + ".doStart()");
|
||||
if (_monitoredDir == null)
|
||||
{
|
||||
throw new IllegalStateException("No configuration dir specified");
|
||||
}
|
||||
|
||||
File scandir = _monitoredDir.getFile();
|
||||
Log.info("Deployment monitor " + scandir + " at interval " + _scanInterval);
|
||||
LOG.info("Deployment monitor " + scandir + " at interval " + _scanInterval);
|
||||
_scanner = new Scanner();
|
||||
_scanner.setScanDirs(Collections.singletonList(scandir));
|
||||
_scanner.setScanInterval(_scanInterval);
|
||||
|
@ -129,7 +132,7 @@ public abstract class ScanningAppProvider extends AbstractLifeCycle implements A
|
|||
/* ------------------------------------------------------------ */
|
||||
protected void fileAdded(String filename) throws Exception
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("added ",filename);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("added ",filename);
|
||||
App app = ScanningAppProvider.this.createApp(filename);
|
||||
if (app != null)
|
||||
{
|
||||
|
@ -141,7 +144,7 @@ public abstract class ScanningAppProvider extends AbstractLifeCycle implements A
|
|||
/* ------------------------------------------------------------ */
|
||||
protected void fileChanged(String filename) throws Exception
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("changed ",filename);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("changed ",filename);
|
||||
App app = _appMap.remove(filename);
|
||||
if (app != null)
|
||||
{
|
||||
|
@ -158,7 +161,7 @@ public abstract class ScanningAppProvider extends AbstractLifeCycle implements A
|
|||
/* ------------------------------------------------------------ */
|
||||
protected void fileRemoved(String filename) throws Exception
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("removed ",filename);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("removed ",filename);
|
||||
App app = _appMap.remove(filename);
|
||||
if (app != null)
|
||||
_deploymentManager.removeApp(app);
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.jetty.toolchain.test.OS;
|
|||
import org.eclipse.jetty.toolchain.test.TestingDir;
|
||||
import org.eclipse.jetty.util.Scanner;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Assume;
|
||||
import org.junit.Before;
|
||||
|
@ -37,6 +38,8 @@ import org.junit.Test;
|
|||
*/
|
||||
public class ScanningAppProviderRuntimeUpdatesTest
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(ScanningAppProviderRuntimeUpdatesTest.class);
|
||||
|
||||
@Rule
|
||||
public TestingDir testdir = new TestingDir();
|
||||
private static XmlConfiguredJetty jetty;
|
||||
|
@ -93,7 +96,7 @@ public class ScanningAppProviderRuntimeUpdatesTest
|
|||
}
|
||||
catch(InterruptedException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
while(_scans.get()<scan);
|
||||
|
|
|
@ -34,9 +34,12 @@ import org.eclipse.jetty.security.LoginService;
|
|||
import org.eclipse.jetty.security.Authenticator.AuthConfiguration;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class JaspiAuthenticatorFactory extends DefaultAuthenticatorFactory
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JaspiAuthenticatorFactory.class);
|
||||
|
||||
private static String MESSAGE_LAYER = "HTTP";
|
||||
|
||||
private Subject _serviceSubject;
|
||||
|
@ -114,7 +117,7 @@ public class JaspiAuthenticatorFactory extends DefaultAuthenticatorFactory
|
|||
}
|
||||
catch (AuthException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
return authenticator;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.eclipse.jetty.http.HttpHeaders;
|
||||
import org.eclipse.jetty.http.security.Constraint;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* @deprecated use *ServerAuthentication
|
||||
|
@ -36,6 +37,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class BasicAuthModule extends BaseAuthModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(BasicAuthModule.class);
|
||||
|
||||
|
||||
private String realmName;
|
||||
|
||||
|
@ -73,7 +76,7 @@ public class BasicAuthModule extends BaseAuthModule
|
|||
{
|
||||
if (credentials != null)
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("Credentials: " + credentials);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Credentials: " + credentials);
|
||||
if (login(clientSubject, credentials, Constraint.__BASIC_AUTH, messageInfo)) { return AuthStatus.SUCCESS; }
|
||||
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ import org.eclipse.jetty.util.QuotedStringTokenizer;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* @deprecated use *ServerAuthentication
|
||||
|
@ -42,6 +43,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class DigestAuthModule extends BaseAuthModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DigestAuthModule.class);
|
||||
|
||||
|
||||
protected long maxNonceAge = 0;
|
||||
|
||||
|
@ -88,7 +91,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
long timestamp = System.currentTimeMillis();
|
||||
if (credentials != null)
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("Credentials: " + credentials);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Credentials: " + credentials);
|
||||
QuotedStringTokenizer tokenizer = new QuotedStringTokenizer(credentials, "=, ", true, false);
|
||||
final Digest digest = new Digest(request.getMethod());
|
||||
String last = null;
|
||||
|
@ -192,7 +195,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
|
||||
for (int i = 0; i < hash.length; i++)
|
||||
|
@ -229,7 +232,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
}
|
||||
|
||||
long age = timestamp - ts;
|
||||
if (Log.isDebugEnabled()) Log.debug("age=" + age);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("age=" + age);
|
||||
|
||||
byte[] hash = null;
|
||||
try
|
||||
|
@ -241,7 +244,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
|
@ -253,7 +256,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -337,7 +340,7 @@ public class DigestAuthModule extends BaseAuthModule
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.eclipse.jetty.security.authentication.LoginCallbackImpl;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* @deprecated use *ServerAuthentication
|
||||
|
@ -47,6 +48,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class FormAuthModule extends BaseAuthModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(FormAuthModule.class);
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public final static String __J_URI = "org.eclipse.jetty.util.URI";
|
||||
|
||||
|
@ -110,7 +113,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
{
|
||||
if (!path.startsWith("/"))
|
||||
{
|
||||
Log.warn("form-login-page must start with /");
|
||||
LOG.warn("form-login-page must start with /");
|
||||
path = "/" + path;
|
||||
}
|
||||
_formLoginPage = path;
|
||||
|
@ -130,7 +133,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
{
|
||||
if (!path.startsWith("/"))
|
||||
{
|
||||
Log.warn("form-error-page must start with /");
|
||||
LOG.warn("form-error-page must start with /");
|
||||
path = "/" + path;
|
||||
}
|
||||
_formErrorPage = path;
|
||||
|
@ -177,7 +180,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
return AuthStatus.SEND_CONTINUE;
|
||||
}
|
||||
// not authenticated
|
||||
if (Log.isDebugEnabled()) Log.debug("Form authentication FAILED for " + StringUtil.printable(username));
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Form authentication FAILED for " + StringUtil.printable(username));
|
||||
if (_formErrorPage == null)
|
||||
{
|
||||
if (response != null) response.sendError(HttpServletResponse.SC_FORBIDDEN);
|
||||
|
@ -250,7 +253,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
// // If this credential is still authenticated
|
||||
// if (form_cred._userPrincipal!=null)
|
||||
// {
|
||||
// if(Log.isDebugEnabled())Log.debug("FORM Authenticated for
|
||||
// if(LOG.isDebugEnabled())LOG.debug("FORM Authenticated for
|
||||
// "+form_cred._userPrincipal.getName());
|
||||
// request.setAuthType(Constraint.__FORM_AUTH);
|
||||
// //jaspi
|
||||
|
@ -273,7 +276,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
// form_cred._jUserName=form_cred._userPrincipal.getName();
|
||||
// if (cred!=null)
|
||||
// form_cred._jPassword=cred.toString();
|
||||
// if(Log.isDebugEnabled())Log.debug("SSO for
|
||||
// if(LOG.isDebugEnabled())LOG.debug("SSO for
|
||||
// "+form_cred._userPrincipal);
|
||||
//
|
||||
// request.setAuthType(Constraint.__FORM_AUTH);
|
||||
|
@ -404,7 +407,7 @@ public class FormAuthModule extends BaseAuthModule
|
|||
|
||||
public void valueUnbound(HttpSessionBindingEvent event)
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("Logout " + _jUserName);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Logout " + _jUserName);
|
||||
|
||||
// TODO jaspi call cleanSubject()
|
||||
// if (_realm instanceof SSORealm)
|
||||
|
|
|
@ -8,6 +8,7 @@ import javax.sql.DataSource;
|
|||
import org.eclipse.jetty.util.component.AggregateLifeCycle;
|
||||
import org.eclipse.jetty.util.component.Destroyable;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* Close a DataSource.
|
||||
|
@ -18,6 +19,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class DataSourceCloser implements Destroyable
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DataSourceCloser.class);
|
||||
|
||||
final DataSource _datasource;
|
||||
final String _shutdown;
|
||||
|
||||
|
@ -43,7 +46,7 @@ public class DataSourceCloser implements Destroyable
|
|||
{
|
||||
if (_shutdown!=null)
|
||||
{
|
||||
Log.info("Shutdown datasource {}",_datasource);
|
||||
LOG.info("Shutdown datasource {}",_datasource);
|
||||
Statement stmt = _datasource.getConnection().createStatement();
|
||||
stmt.executeUpdate(_shutdown);
|
||||
stmt.close();
|
||||
|
@ -51,18 +54,18 @@ public class DataSourceCloser implements Destroyable
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Method close = _datasource.getClass().getMethod("close", new Class[]{});
|
||||
Log.info("Close datasource {}",_datasource);
|
||||
LOG.info("Close datasource {}",_datasource);
|
||||
close.invoke(_datasource, new Object[]{});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import javax.naming.NamingException;
|
|||
import javax.naming.spi.ObjectFactory;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/** javaURLContextFactory
|
||||
|
@ -32,16 +33,9 @@ import org.eclipse.jetty.util.log.Log;
|
|||
* <p><h4>Usage</h4>
|
||||
* <pre>
|
||||
*/
|
||||
/*
|
||||
* </pre>
|
||||
*
|
||||
* @see
|
||||
*
|
||||
*
|
||||
* @version 1.0
|
||||
*/
|
||||
public class javaURLContextFactory implements ObjectFactory
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(javaURLContextFactory.class);
|
||||
|
||||
/**
|
||||
* Either return a new context or the resolution of a url.
|
||||
|
@ -59,14 +53,14 @@ public class javaURLContextFactory implements ObjectFactory
|
|||
// null object means return a root context for doing resolutions
|
||||
if (url == null)
|
||||
{
|
||||
if(Log.isDebugEnabled())Log.debug(">>> new root context requested ");
|
||||
if(LOG.isDebugEnabled())LOG.debug(">>> new root context requested ");
|
||||
return new javaRootURLContext(env);
|
||||
}
|
||||
|
||||
// return the resolution of the url
|
||||
if (url instanceof String)
|
||||
{
|
||||
if(Log.isDebugEnabled())Log.debug(">>> resolution of url "+url+" requested");
|
||||
if(LOG.isDebugEnabled())LOG.debug(">>> resolution of url "+url+" requested");
|
||||
Context rootctx = new javaRootURLContext (env);
|
||||
return rootctx.lookup ((String)url);
|
||||
}
|
||||
|
@ -74,7 +68,7 @@ public class javaURLContextFactory implements ObjectFactory
|
|||
// return the resolution of at least one of the urls
|
||||
if (url instanceof String[])
|
||||
{
|
||||
if(Log.isDebugEnabled())Log.debug(">>> resolution of array of urls requested");
|
||||
if(LOG.isDebugEnabled())LOG.debug(">>> resolution of array of urls requested");
|
||||
String[] urls = (String[])url;
|
||||
Context rootctx = new javaRootURLContext (env);
|
||||
Object object = null;
|
||||
|
@ -97,7 +91,7 @@ public class javaURLContextFactory implements ObjectFactory
|
|||
return object;
|
||||
}
|
||||
|
||||
if(Log.isDebugEnabled())Log.debug(">>> No idea what to do, so return a new root context anyway");
|
||||
if(LOG.isDebugEnabled())LOG.debug(">>> No idea what to do, so return a new root context anyway");
|
||||
return new javaRootURLContext (env);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.eclipse.jetty.jndi.NamingContext;
|
|||
import org.eclipse.jetty.jndi.NamingUtil;
|
||||
import org.eclipse.jetty.jndi.local.localContextRoot;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -47,6 +48,8 @@ import static org.junit.Assert.fail;
|
|||
*/
|
||||
public class TestJNDI
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(TestJNDI.class);
|
||||
|
||||
static
|
||||
{
|
||||
// NamingUtil.__log.setDebugEnabled(true);
|
||||
|
@ -115,48 +118,48 @@ public class TestJNDI
|
|||
InitialContext initCtx = new InitialContext();
|
||||
Context sub0 = (Context)initCtx.lookup("java:");
|
||||
|
||||
if(Log.isDebugEnabled())Log.debug("------ Looked up java: --------------");
|
||||
if(LOG.isDebugEnabled())LOG.debug("------ Looked up java: --------------");
|
||||
|
||||
Name n = sub0.getNameParser("").parse("/red/green/");
|
||||
|
||||
if(Log.isDebugEnabled())Log.debug("get(0)="+n.get(0));
|
||||
if(Log.isDebugEnabled())Log.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
if(LOG.isDebugEnabled())LOG.debug("get(0)="+n.get(0));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
n = n.getSuffix(1);
|
||||
if(Log.isDebugEnabled())Log.debug("getSuffix(1)="+n);
|
||||
if(Log.isDebugEnabled())Log.debug("get(0)="+n.get(0));
|
||||
if(Log.isDebugEnabled())Log.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getSuffix(1)="+n);
|
||||
if(LOG.isDebugEnabled())LOG.debug("get(0)="+n.get(0));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
n = n.getSuffix(1);
|
||||
if(Log.isDebugEnabled())Log.debug("getSuffix(1)="+n);
|
||||
if(Log.isDebugEnabled())Log.debug("get(0)="+n.get(0));
|
||||
if(Log.isDebugEnabled())Log.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getSuffix(1)="+n);
|
||||
if(LOG.isDebugEnabled())LOG.debug("get(0)="+n.get(0));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
n = n.getSuffix(1);
|
||||
if(Log.isDebugEnabled())Log.debug("getSuffix(1)="+n);
|
||||
if(LOG.isDebugEnabled())LOG.debug("getSuffix(1)="+n);
|
||||
|
||||
n = sub0.getNameParser("").parse("pink/purple/");
|
||||
if(Log.isDebugEnabled())Log.debug("get(0)="+n.get(0));
|
||||
if(Log.isDebugEnabled())Log.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
if(LOG.isDebugEnabled())LOG.debug("get(0)="+n.get(0));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
n = n.getSuffix(1);
|
||||
if(Log.isDebugEnabled())Log.debug("getSuffix(1)="+n);
|
||||
if(Log.isDebugEnabled())Log.debug("get(0)="+n.get(0));
|
||||
if(Log.isDebugEnabled())Log.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getSuffix(1)="+n);
|
||||
if(LOG.isDebugEnabled())LOG.debug("get(0)="+n.get(0));
|
||||
if(LOG.isDebugEnabled())LOG.debug("getPrefix(1)="+n.getPrefix(1));
|
||||
|
||||
NamingContext ncontext = (NamingContext)sub0;
|
||||
|
||||
Name nn = ncontext.toCanonicalName(ncontext.getNameParser("").parse("/yellow/blue/"));
|
||||
Log.debug(nn.toString());
|
||||
LOG.debug(nn.toString());
|
||||
assertEquals (2, nn.size());
|
||||
|
||||
nn = ncontext.toCanonicalName(ncontext.getNameParser("").parse("/yellow/blue"));
|
||||
Log.debug(nn.toString());
|
||||
LOG.debug(nn.toString());
|
||||
assertEquals (2, nn.size());
|
||||
|
||||
nn = ncontext.toCanonicalName(ncontext.getNameParser("").parse("/"));
|
||||
if(Log.isDebugEnabled())Log.debug("/ parses as: "+nn+" with size="+nn.size());
|
||||
Log.debug(nn.toString());
|
||||
if(LOG.isDebugEnabled())LOG.debug("/ parses as: "+nn+" with size="+nn.size());
|
||||
LOG.debug(nn.toString());
|
||||
assertEquals (1, nn.size());
|
||||
|
||||
nn = ncontext.toCanonicalName(ncontext.getNameParser("").parse(""));
|
||||
Log.debug(nn.toString());
|
||||
LOG.debug(nn.toString());
|
||||
assertEquals (0, nn.size());
|
||||
|
||||
Context fee = ncontext.createSubcontext("fee");
|
||||
|
|
|
@ -22,6 +22,7 @@ import javax.naming.NamingException;
|
|||
|
||||
import org.eclipse.jetty.util.IntrospectionUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* Injection
|
||||
|
@ -33,6 +34,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class Injection
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(Injection.class);
|
||||
|
||||
private Class<?> _targetClass;
|
||||
private String _jndiName;
|
||||
private String _mappingName;
|
||||
|
@ -136,7 +139,7 @@ public class Injection
|
|||
String setter = "set"+target.substring(0,1).toUpperCase()+target.substring(1);
|
||||
try
|
||||
{
|
||||
Log.debug("Looking for method for setter: "+setter+" with arg "+_resourceClass);
|
||||
LOG.debug("Looking for method for setter: "+setter+" with arg "+_resourceClass);
|
||||
_target = IntrospectionUtil.findMethod(clazz, setter, new Class[] {_resourceClass}, true, false);
|
||||
_targetClass = clazz;
|
||||
_paramClass = _resourceClass;
|
||||
|
@ -205,7 +208,7 @@ public class Injection
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
throw new IllegalStateException("Inject failed for field "+field.getName());
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +229,7 @@ public class Injection
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
throw new IllegalStateException("Inject failed for method "+method.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* InjectionCollection
|
||||
|
@ -28,7 +29,9 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*
|
||||
*/
|
||||
public class InjectionCollection
|
||||
{
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(InjectionCollection.class);
|
||||
|
||||
public static final String INJECTION_COLLECTION = "org.eclipse.jetty.injectionCollection";
|
||||
|
||||
private HashMap<String, List<Injection>> _injectionMap = new HashMap<String, List<Injection>>();//map of classname to injections
|
||||
|
@ -39,8 +42,8 @@ public class InjectionCollection
|
|||
if ((injection==null) || injection.getTargetClass()==null)
|
||||
return;
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Adding injection for class="+(injection.getTargetClass()+ " on a "+(injection.getTarget().getName())));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Adding injection for class="+(injection.getTargetClass()+ " on a "+(injection.getTarget().getName())));
|
||||
|
||||
|
||||
List<Injection> injections = (List<Injection>)_injectionMap.get(injection.getTargetClass().getCanonicalName());
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -28,6 +29,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class LifeCycleCallbackCollection
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(LifeCycleCallbackCollection.class);
|
||||
|
||||
public static final String LIFECYCLE_CALLBACK_COLLECTION = "org.eclipse.jetty.lifecyleCallbackCollection";
|
||||
|
||||
private HashMap<String, List<LifeCycleCallback>> postConstructCallbacksMap = new HashMap<String, List<LifeCycleCallback>>();
|
||||
|
@ -43,8 +46,8 @@ public class LifeCycleCallbackCollection
|
|||
if ((callback==null) || (callback.getTargetClassName()==null))
|
||||
return;
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Adding callback for class="+callback.getTargetClass()+ " on "+callback.getTarget());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Adding callback for class="+callback.getTargetClass()+ " on "+callback.getTarget());
|
||||
Map<String, List<LifeCycleCallback>> map = null;
|
||||
if (callback instanceof PreDestroyCallback)
|
||||
map = preDestroyCallbacksMap;
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.lang.reflect.Method;
|
|||
import java.lang.reflect.Modifier;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* PreDestroyCallback
|
||||
|
@ -25,6 +26,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class PreDestroyCallback extends LifeCycleCallback
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PreDestroyCallback.class);
|
||||
|
||||
|
||||
/**
|
||||
* Commons Annotations Specification section 2.6:
|
||||
|
@ -57,7 +60,7 @@ public class PreDestroyCallback extends LifeCycleCallback
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Ignoring exception thrown on preDestroy call to "+getTargetClass()+"."+getTarget().getName(), e);
|
||||
LOG.warn("Ignoring exception thrown on preDestroy call to "+getTargetClass()+"."+getTarget().getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ import javax.servlet.ServletException;
|
|||
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -28,6 +29,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class RunAsCollection
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(RunAsCollection.class);
|
||||
|
||||
public static final String RUNAS_COLLECTION = "org.eclipse.jetty.runAsCollection";
|
||||
private HashMap<String, RunAs> _runAsMap = new HashMap<String, RunAs>();//map of classname to run-as
|
||||
|
||||
|
@ -38,8 +41,8 @@ public class RunAsCollection
|
|||
if ((runAs==null) || (runAs.getTargetClassName()==null))
|
||||
return;
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Adding run-as for class="+runAs.getTargetClassName());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Adding run-as for class="+runAs.getTargetClassName());
|
||||
_runAsMap.put(runAs.getTargetClassName(), runAs);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.eclipse.jetty.server.UserIdentity;
|
|||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.component.AbstractLifeCycle;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/* ---------------------------------------------------- */
|
||||
/** JAASLoginService
|
||||
|
@ -46,6 +47,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class JAASLoginService extends AbstractLifeCycle implements LoginService
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JAASLoginService.class);
|
||||
|
||||
public static String DEFAULT_ROLE_CLASS_NAME = "org.eclipse.jetty.plus.jaas.JAASRole";
|
||||
public static String[] DEFAULT_ROLE_CLASS_NAMES = {DEFAULT_ROLE_CLASS_NAME};
|
||||
|
||||
|
@ -221,27 +224,27 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService
|
|||
}
|
||||
catch (LoginException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
catch (UnsupportedCallbackException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
catch (InstantiationException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
catch (IllegalAccessException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -272,7 +275,7 @@ public class JAASLoginService extends AbstractLifeCycle implements LoginService
|
|||
}
|
||||
catch (LoginException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.security.auth.callback.CallbackHandler;
|
|||
|
||||
import org.eclipse.jetty.http.security.Credential;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* AbstractDatabaseLoginModule
|
||||
|
@ -37,6 +38,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public abstract class AbstractDatabaseLoginModule extends AbstractLoginModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(AbstractDatabaseLoginModule.class);
|
||||
|
||||
private String userQuery;
|
||||
private String rolesQuery;
|
||||
private String dbUserTable;
|
||||
|
@ -130,7 +133,7 @@ public abstract class AbstractDatabaseLoginModule extends AbstractLoginModule
|
|||
|
||||
rolesQuery = "select "+dbUserRoleTableRoleField+" from "+dbUserRoleTable+" where "+dbUserRoleTableUserField+"=?";
|
||||
|
||||
if(Log.isDebugEnabled())Log.debug("userQuery = "+userQuery);
|
||||
if(Log.isDebugEnabled())Log.debug("rolesQuery = "+rolesQuery);
|
||||
if(LOG.isDebugEnabled())LOG.debug("userQuery = "+userQuery);
|
||||
if(LOG.isDebugEnabled())LOG.debug("rolesQuery = "+rolesQuery);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import javax.security.auth.callback.CallbackHandler;
|
|||
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
|
||||
|
@ -42,6 +43,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class JDBCLoginModule extends AbstractDatabaseLoginModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JDBCLoginModule.class);
|
||||
|
||||
private String dbDriver;
|
||||
private String dbUrl;
|
||||
private String dbUserName;
|
||||
|
@ -62,7 +65,7 @@ public class JDBCLoginModule extends AbstractDatabaseLoginModule
|
|||
(dbUrl != null)))
|
||||
throw new IllegalStateException ("Database connection information not configured");
|
||||
|
||||
if(Log.isDebugEnabled())Log.debug("Connecting using dbDriver="+dbDriver+"+ dbUserName="+dbUserName+", dbPassword="+dbUrl);
|
||||
if(LOG.isDebugEnabled())LOG.debug("Connecting using dbDriver="+dbDriver+"+ dbUserName="+dbUserName+", dbPassword="+dbUrl);
|
||||
|
||||
return DriverManager.getConnection (dbUrl,
|
||||
dbUserName,
|
||||
|
|
|
@ -38,6 +38,7 @@ import javax.security.auth.login.LoginException;
|
|||
import org.eclipse.jetty.http.security.Credential;
|
||||
import org.eclipse.jetty.plus.jaas.callback.ObjectCallback;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* A LdapLoginModule for use with JAAS setups
|
||||
|
@ -80,6 +81,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class LdapLoginModule extends AbstractLoginModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(LdapLoginModule.class);
|
||||
|
||||
/**
|
||||
* hostname of the ldap server
|
||||
*/
|
||||
|
@ -252,14 +255,14 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
|
||||
String filter = "(&(objectClass={0})({1}={2}))";
|
||||
|
||||
Log.debug("Searching for users with filter: \'" + filter + "\'" + " from base dn: " + _userBaseDn);
|
||||
LOG.debug("Searching for users with filter: \'" + filter + "\'" + " from base dn: " + _userBaseDn);
|
||||
|
||||
try
|
||||
{
|
||||
Object[] filterArguments = {_userObjectClass, _userIdAttribute, username};
|
||||
NamingEnumeration<SearchResult> results = _rootContext.search(_userBaseDn, filter, filterArguments, ctls);
|
||||
|
||||
Log.debug("Found user?: " + results.hasMoreElements());
|
||||
LOG.debug("Found user?: " + results.hasMoreElements());
|
||||
|
||||
if (!results.hasMoreElements())
|
||||
{
|
||||
|
@ -281,7 +284,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
}
|
||||
catch (NamingException e)
|
||||
{
|
||||
Log.debug("no password available under attribute: " + _userPasswordAttribute);
|
||||
LOG.debug("no password available under attribute: " + _userPasswordAttribute);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +293,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
throw new LoginException("Root context binding failure.");
|
||||
}
|
||||
|
||||
Log.debug("user cred is: " + ldapCredential);
|
||||
LOG.debug("user cred is: " + ldapCredential);
|
||||
|
||||
return ldapCredential;
|
||||
}
|
||||
|
@ -329,7 +332,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
Object[] filterArguments = {_roleObjectClass, _roleMemberAttribute, userDn};
|
||||
NamingEnumeration<SearchResult> results = dirContext.search(_roleBaseDn, filter, filterArguments, ctls);
|
||||
|
||||
Log.debug("Found user roles?: " + results.hasMoreElements());
|
||||
LOG.debug("Found user roles?: " + results.hasMoreElements());
|
||||
|
||||
while (results.hasMoreElements())
|
||||
{
|
||||
|
@ -466,7 +469,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
|
||||
String userDn = searchResult.getNameInNamespace();
|
||||
|
||||
Log.info("Attempting authentication: " + userDn);
|
||||
LOG.info("Attempting authentication: " + userDn);
|
||||
|
||||
Hashtable<Object,Object> environment = getEnvironment();
|
||||
environment.put(Context.SECURITY_PRINCIPAL, userDn);
|
||||
|
@ -491,7 +494,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
|
||||
String filter = "(&(objectClass={0})({1}={2}))";
|
||||
|
||||
Log.info("Searching for users with filter: \'" + filter + "\'" + " from base dn: " + _userBaseDn);
|
||||
LOG.info("Searching for users with filter: \'" + filter + "\'" + " from base dn: " + _userBaseDn);
|
||||
|
||||
Object[] filterArguments = new Object[]{
|
||||
_userObjectClass,
|
||||
|
@ -500,7 +503,7 @@ public class LdapLoginModule extends AbstractLoginModule
|
|||
};
|
||||
NamingEnumeration<SearchResult> results = _rootContext.search(_userBaseDn, filter, filterArguments, ctls);
|
||||
|
||||
Log.info("Found user?: " + results.hasMoreElements());
|
||||
LOG.info("Found user?: " + results.hasMoreElements());
|
||||
|
||||
if (!results.hasMoreElements())
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.security.auth.callback.CallbackHandler;
|
|||
|
||||
import org.eclipse.jetty.http.security.Credential;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* PropertyFileLoginModule
|
||||
|
@ -35,6 +36,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class PropertyFileLoginModule extends AbstractLoginModule
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PropertyFileLoginModule.class);
|
||||
|
||||
public static final String DEFAULT_FILENAME = "realm.properties";
|
||||
public static final Map<String, Map<String, UserInfo>> fileMap = new HashMap<String, Map<String, UserInfo>>();
|
||||
|
||||
|
@ -80,7 +83,7 @@ public class PropertyFileLoginModule extends AbstractLoginModule
|
|||
//give up, can't find a property file to load
|
||||
if (!propsFile.exists())
|
||||
{
|
||||
Log.warn("No property file found");
|
||||
LOG.warn("No property file found");
|
||||
throw new IllegalStateException ("No property file specified in login module configuration file");
|
||||
}
|
||||
|
||||
|
@ -91,7 +94,7 @@ public class PropertyFileLoginModule extends AbstractLoginModule
|
|||
this.propertyFileName = propsFile.getCanonicalPath();
|
||||
if (fileMap.get(propertyFileName) != null)
|
||||
{
|
||||
if (Log.isDebugEnabled()) {Log.debug("Properties file "+propertyFileName+" already in cache, skipping load");}
|
||||
if (LOG.isDebugEnabled()) {LOG.debug("Properties file "+propertyFileName+" already in cache, skipping load");}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -133,7 +136,7 @@ public class PropertyFileLoginModule extends AbstractLoginModule
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Error loading properties from file", e);
|
||||
LOG.warn("Error loading properties from file", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ import org.eclipse.jetty.security.MappedLoginService;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.UserIdentity;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -46,6 +47,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public class DataSourceLoginService extends MappedLoginService
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DataSourceLoginService.class);
|
||||
|
||||
private String _jndiName = "javax.sql.DataSource/default";
|
||||
private DataSource _datasource;
|
||||
private Server _server;
|
||||
|
@ -309,11 +312,11 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
}
|
||||
catch (NamingException e)
|
||||
{
|
||||
Log.warn("No datasource for "+_jndiName, e);
|
||||
LOG.warn("No datasource for "+_jndiName, e);
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
Log.warn("Problem loading user info for "+userName, e);
|
||||
LOG.warn("Problem loading user info for "+userName, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -325,7 +328,7 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
}
|
||||
catch (SQLException x)
|
||||
{
|
||||
Log.warn("Problem closing connection", x);
|
||||
LOG.warn("Problem closing connection", x);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -418,7 +421,7 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
connection.createStatement().executeUpdate("create table "+_userTableName+ "("+_userTableKey+" integer,"+
|
||||
_userTableUserField+" varchar(100) not null unique,"+
|
||||
_userTablePasswordField+" varchar(20) not null, primary key("+_userTableKey+"))");
|
||||
if (Log.isDebugEnabled()) Log.debug("Created table "+_userTableName);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Created table "+_userTableName);
|
||||
}
|
||||
|
||||
result.close();
|
||||
|
@ -435,7 +438,7 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
String str = "create table "+_roleTableName+" ("+_roleTableKey+" integer, "+
|
||||
_roleTableRoleField+" varchar(100) not null unique, primary key("+_roleTableKey+"))";
|
||||
connection.createStatement().executeUpdate(str);
|
||||
if (Log.isDebugEnabled()) Log.debug("Created table "+_roleTableName);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Created table "+_roleTableName);
|
||||
}
|
||||
|
||||
result.close();
|
||||
|
@ -456,7 +459,7 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
_userRoleTableRoleKey+" integer, "+
|
||||
"primary key ("+_userRoleTableUserKey+", "+_userRoleTableRoleKey+"))");
|
||||
connection.createStatement().executeUpdate("create index indx_user_role on "+_userRoleTableName+"("+_userRoleTableUserKey+")");
|
||||
if (Log.isDebugEnabled()) Log.debug("Created table "+_userRoleTableName +" and index");
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Created table "+_userRoleTableName +" and index");
|
||||
}
|
||||
|
||||
result.close();
|
||||
|
@ -473,7 +476,7 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("Prepare tables", e);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Prepare tables", e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -482,9 +485,9 @@ public class DataSourceLoginService extends MappedLoginService
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Log.isDebugEnabled())
|
||||
else if (LOG.isDebugEnabled())
|
||||
{
|
||||
Log.debug("createTables false");
|
||||
LOG.debug("createTables false");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.jetty.jndi.local.localContextRoot;
|
|||
import org.eclipse.jetty.plus.jndi.EnvEntry;
|
||||
import org.eclipse.jetty.plus.jndi.NamingEntryUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.webapp.AbstractConfiguration;
|
||||
import org.eclipse.jetty.webapp.Configuration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
@ -45,6 +46,8 @@ import org.eclipse.jetty.xml.XmlConfiguration;
|
|||
*/
|
||||
public class EnvConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(EnvConfiguration.class);
|
||||
|
||||
private static final String JETTY_ENV_BINDINGS = "org.eclipse.jetty.jndi.EnvConfiguration";
|
||||
private URL jettyEnvXmlUrl;
|
||||
|
||||
|
@ -70,8 +73,8 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
@Override
|
||||
public void configure (WebAppContext context) throws Exception
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Created java:comp/env for webapp "+context.getContextPath());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Created java:comp/env for webapp "+context.getContextPath());
|
||||
|
||||
//check to see if an explicit file has been set, if not,
|
||||
//look in WEB-INF/jetty-env.xml
|
||||
|
@ -158,7 +161,7 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (NameNotFoundException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -183,8 +186,8 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (NameNotFoundException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
Log.debug("No naming entries configured in environment for webapp "+context);
|
||||
LOG.ignore(e);
|
||||
LOG.debug("No naming entries configured in environment for webapp "+context);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,7 +201,7 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
public void bindEnvEntries (WebAppContext context)
|
||||
throws NamingException
|
||||
{
|
||||
Log.debug("Binding env entries from the jvm scope");
|
||||
LOG.debug("Binding env entries from the jvm scope");
|
||||
InitialContext ic = new InitialContext();
|
||||
Context envCtx = (Context)ic.lookup("java:comp/env");
|
||||
Object scope = null;
|
||||
|
@ -212,7 +215,7 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
NamingUtil.bind(envCtx, namingEntryName.toString(), ee);//also save the EnvEntry in the context so we can check it later
|
||||
}
|
||||
|
||||
Log.debug("Binding env entries from the server scope");
|
||||
LOG.debug("Binding env entries from the server scope");
|
||||
|
||||
scope = context.getServer();
|
||||
list = NamingEntryUtil.lookupNamingEntries(scope, EnvEntry.class);
|
||||
|
@ -225,7 +228,7 @@ public class EnvConfiguration extends AbstractConfiguration
|
|||
NamingUtil.bind(envCtx, namingEntryName.toString(), ee);//also save the EnvEntry in the context so we can check it later
|
||||
}
|
||||
|
||||
Log.debug("Binding env entries from the context scope");
|
||||
LOG.debug("Binding env entries from the context scope");
|
||||
scope = context;
|
||||
list = NamingEntryUtil.lookupNamingEntries(scope, EnvEntry.class);
|
||||
itor = list.iterator();
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.jetty.plus.annotation.InjectionCollection;
|
|||
import org.eclipse.jetty.plus.annotation.LifeCycleCallbackCollection;
|
||||
import org.eclipse.jetty.plus.jndi.Transaction;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.webapp.AbstractConfiguration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
|
@ -34,6 +35,8 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
*/
|
||||
public class PlusConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PlusConfiguration.class);
|
||||
|
||||
private Integer _key;
|
||||
|
||||
@Override
|
||||
|
@ -84,7 +87,7 @@ public class PlusConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (NameNotFoundException e)
|
||||
{
|
||||
Log.info("No Transaction manager found - if your webapp requires one, please configure one.");
|
||||
LOG.info("No Transaction manager found - if your webapp requires one, please configure one.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.jetty.servlet.FilterHolder;
|
|||
import org.eclipse.jetty.servlet.ServletContextHandler.Decorator;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
|
||||
/**
|
||||
|
@ -35,6 +36,8 @@ import org.eclipse.jetty.webapp.WebAppContext;
|
|||
*/
|
||||
public class PlusDecorator implements Decorator
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PlusDecorator.class);
|
||||
|
||||
protected WebAppContext _context;
|
||||
|
||||
public PlusDecorator (WebAppContext context)
|
||||
|
@ -154,7 +157,7 @@ public class PlusDecorator implements Decorator
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Destroying instance of "+o.getClass(), e);
|
||||
LOG.warn("Destroying instance of "+o.getClass(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import org.eclipse.jetty.plus.jndi.NamingEntry;
|
|||
import org.eclipse.jetty.plus.jndi.NamingEntryUtil;
|
||||
import org.eclipse.jetty.util.TypeUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.webapp.Descriptor;
|
||||
import org.eclipse.jetty.webapp.FragmentDescriptor;
|
||||
import org.eclipse.jetty.webapp.IterativeDescriptorProcessor;
|
||||
|
@ -48,6 +49,8 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
|
||||
public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(PlusDescriptorProcessor.class);
|
||||
|
||||
public PlusDescriptorProcessor ()
|
||||
{
|
||||
try
|
||||
|
@ -121,7 +124,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
//nor processing injection entries
|
||||
if (valueStr==null || valueStr.equals(""))
|
||||
{
|
||||
Log.warn("No value for env-entry-name "+name);
|
||||
LOG.warn("No value for env-entry-name "+name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -537,12 +540,12 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
|
||||
if (className==null || className.equals(""))
|
||||
{
|
||||
Log.warn("No lifecycle-callback-class specified");
|
||||
LOG.warn("No lifecycle-callback-class specified");
|
||||
return;
|
||||
}
|
||||
if (methodName==null || methodName.equals(""))
|
||||
{
|
||||
Log.warn("No lifecycle-callback-method specified for class "+className);
|
||||
LOG.warn("No lifecycle-callback-method specified for class "+className);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -565,7 +568,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load post-construct target class "+className);
|
||||
LOG.warn("Couldn't load post-construct target class "+className);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -586,7 +589,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load post-construct target class "+className);
|
||||
LOG.warn("Couldn't load post-construct target class "+className);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -603,7 +606,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load post-construct target class "+className);
|
||||
LOG.warn("Couldn't load post-construct target class "+className);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -624,12 +627,12 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
String methodName = node.getString("lifecycle-callback-method", false, true);
|
||||
if (className==null || className.equals(""))
|
||||
{
|
||||
Log.warn("No lifecycle-callback-class specified for pre-destroy");
|
||||
LOG.warn("No lifecycle-callback-class specified for pre-destroy");
|
||||
return;
|
||||
}
|
||||
if (methodName==null || methodName.equals(""))
|
||||
{
|
||||
Log.warn("No lifecycle-callback-method specified for pre-destroy class "+className);
|
||||
LOG.warn("No lifecycle-callback-method specified for pre-destroy class "+className);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -650,7 +653,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load pre-destory target class "+className);
|
||||
LOG.warn("Couldn't load pre-destory target class "+className);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -671,7 +674,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load pre-destory target class "+className);
|
||||
LOG.warn("Couldn't load pre-destory target class "+className);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -688,7 +691,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load pre-destory target class "+className);
|
||||
LOG.warn("Couldn't load pre-destory target class "+className);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -715,12 +718,12 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
String targetName = injectionNode.getString("injection-target-name", false, true);
|
||||
if ((targetClassName==null) || targetClassName.equals(""))
|
||||
{
|
||||
Log.warn("No classname found in injection-target");
|
||||
LOG.warn("No classname found in injection-target");
|
||||
continue;
|
||||
}
|
||||
if ((targetName==null) || targetName.equals(""))
|
||||
{
|
||||
Log.warn("No field or method name in injection-target");
|
||||
LOG.warn("No field or method name in injection-target");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -746,7 +749,7 @@ public class PlusDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.warn("Couldn't load injection target class "+targetClassName);
|
||||
LOG.warn("Couldn't load injection target class "+targetClassName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ package org.eclipse.jetty.webapp;
|
|||
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
/**
|
||||
* DiscoveredAnnotation
|
||||
|
@ -25,6 +26,8 @@ import org.eclipse.jetty.util.log.Log;
|
|||
*/
|
||||
public abstract class DiscoveredAnnotation
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(DiscoveredAnnotation.class);
|
||||
|
||||
protected WebAppContext _context;
|
||||
protected String _className;
|
||||
protected Class<?> _clazz;
|
||||
|
@ -62,7 +65,7 @@ public abstract class DiscoveredAnnotation
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.jar.JarInputStream;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/**
|
||||
|
@ -39,6 +40,8 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
*/
|
||||
public abstract class JarScanner extends org.eclipse.jetty.util.PatternMatcher
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JarScanner.class);
|
||||
|
||||
|
||||
public abstract void processEntry (URI jarUri, JarEntry entry);
|
||||
|
||||
|
@ -135,7 +138,7 @@ public abstract class JarScanner extends org.eclipse.jetty.util.PatternMatcher
|
|||
public void matched (URI uri)
|
||||
throws Exception
|
||||
{
|
||||
Log.debug("Search of {}",uri);
|
||||
LOG.debug("Search of {}",uri);
|
||||
if (uri.toString().toLowerCase().endsWith(".jar"))
|
||||
{
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ package org.eclipse.jetty.webapp;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
|
||||
|
@ -31,6 +32,8 @@ import org.eclipse.jetty.xml.XmlConfiguration;
|
|||
*/
|
||||
public class JettyWebXmlConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(JettyWebXmlConfiguration.class);
|
||||
|
||||
/** The value of this property points to the WEB-INF directory of
|
||||
* the web-app currently installed.
|
||||
* it is passed as a property to the jetty-web.xml file */
|
||||
|
@ -51,12 +54,12 @@ public class JettyWebXmlConfiguration extends AbstractConfiguration
|
|||
//cannot configure if the _context is already started
|
||||
if (context.isStarted())
|
||||
{
|
||||
if (Log.isDebugEnabled()){Log.debug("Cannot configure webapp after it is started");}
|
||||
if (LOG.isDebugEnabled()){LOG.debug("Cannot configure webapp after it is started");}
|
||||
return;
|
||||
}
|
||||
|
||||
if(Log.isDebugEnabled())
|
||||
Log.debug("Configuring web-jetty.xml");
|
||||
if(LOG.isDebugEnabled())
|
||||
LOG.debug("Configuring web-jetty.xml");
|
||||
|
||||
Resource web_inf = context.getWebInf();
|
||||
// handle any WEB-INF descriptors
|
||||
|
@ -76,8 +79,8 @@ public class JettyWebXmlConfiguration extends AbstractConfiguration
|
|||
try
|
||||
{
|
||||
context.setServerClasses(null);
|
||||
if(Log.isDebugEnabled())
|
||||
Log.debug("Configure: "+jetty);
|
||||
if(LOG.isDebugEnabled())
|
||||
LOG.debug("Configure: "+jetty);
|
||||
XmlConfiguration jetty_config = (XmlConfiguration)context.getAttribute(XML_CONFIGURATION);
|
||||
if (jetty_config==null)
|
||||
jetty_config=new XmlConfiguration(jetty.getURL());
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
|
||||
|
@ -31,7 +32,9 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
* All data associated with the configuration and deployment of a web application.
|
||||
*/
|
||||
public class MetaData
|
||||
{
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(MetaData.class);
|
||||
|
||||
public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs";
|
||||
|
||||
protected Map<String, OriginInfo> _origins =new HashMap<String,OriginInfo>();
|
||||
|
@ -292,7 +295,7 @@ public class MetaData
|
|||
public void resolve (WebAppContext context)
|
||||
throws Exception
|
||||
{
|
||||
Log.debug("metadata resolve {}",context);
|
||||
LOG.debug("metadata resolve {}",context);
|
||||
|
||||
//Ensure origins is fresh
|
||||
_origins.clear();
|
||||
|
@ -318,14 +321,14 @@ public class MetaData
|
|||
p.process(context,getWebXml());
|
||||
for (WebDescriptor wd : getOverrideWebs())
|
||||
{
|
||||
Log.debug("process {} {}",context,wd);
|
||||
LOG.debug("process {} {}",context,wd);
|
||||
p.process(context,wd);
|
||||
}
|
||||
}
|
||||
|
||||
for (DiscoveredAnnotation a:_annotations)
|
||||
{
|
||||
Log.debug("apply {}",a);
|
||||
LOG.debug("apply {}",a);
|
||||
a.apply();
|
||||
}
|
||||
|
||||
|
@ -338,7 +341,7 @@ public class MetaData
|
|||
{
|
||||
for (DescriptorProcessor p:_descriptorProcessors)
|
||||
{
|
||||
Log.debug("process {} {}",context,fd);
|
||||
LOG.debug("process {} {}",context,fd);
|
||||
p.process(context,fd);
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +351,7 @@ public class MetaData
|
|||
{
|
||||
for (DiscoveredAnnotation a:fragAnnotations)
|
||||
{
|
||||
Log.debug("apply {}",a);
|
||||
LOG.debug("apply {}",a);
|
||||
a.apply();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
import java.util.jar.JarEntry;
|
||||
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/**
|
||||
|
@ -34,6 +35,8 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
*/
|
||||
public class MetaInfConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(MetaInfConfiguration.class);
|
||||
|
||||
public static final String METAINF_TLDS = TagLibConfiguration.TLD_RESOURCES;
|
||||
public static final String METAINF_FRAGMENTS = FragmentConfiguration.FRAGMENT_RESOURCES;
|
||||
public static final String METAINF_RESOURCES = WebInfConfiguration.RESOURCE_URLS;
|
||||
|
@ -57,7 +60,7 @@ public class MetaInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Problem processing jar entry " + entry, e);
|
||||
LOG.warn("Problem processing jar entry " + entry, e);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.eclipse.jetty.servlet.ServletMapping;
|
|||
import org.eclipse.jetty.util.LazyList;
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlParser;
|
||||
|
||||
|
@ -50,6 +51,8 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
*/
|
||||
public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(StandardDescriptorProcessor.class);
|
||||
|
||||
public static final String STANDARD_PROCESSOR = "org.eclipse.jetty.standardDescriptorProcessor";
|
||||
|
||||
|
||||
|
@ -144,7 +147,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (Log.isDebugEnabled()) Log.debug("ContextParam: " + name + "=" + value);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("ContextParam: " + name + "=" + value);
|
||||
|
||||
}
|
||||
|
||||
|
@ -249,7 +252,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
Log.info("NO JSP Support for {}, did not find {}", context.getContextPath(), servlet_class);
|
||||
LOG.info("NO JSP Support for {}, did not find {}", context.getContextPath(), servlet_class);
|
||||
jspServletClass = servlet_class = "org.eclipse.jetty.servlet.NoJspServlet";
|
||||
}
|
||||
if (holder.getInitParameter("scratchdir") == null)
|
||||
|
@ -262,7 +265,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
if ("?".equals(holder.getInitParameter("classpath")))
|
||||
{
|
||||
String classpath = context.getClassPath();
|
||||
Log.debug("classpath=" + classpath);
|
||||
LOG.debug("classpath=" + classpath);
|
||||
if (classpath != null)
|
||||
holder.setInitParameter("classpath", classpath);
|
||||
}
|
||||
|
@ -328,7 +331,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
int order = 0;
|
||||
if (s.startsWith("t"))
|
||||
{
|
||||
Log.warn("Deprecated boolean load-on-startup. Please use integer");
|
||||
LOG.warn("Deprecated boolean load-on-startup. Please use integer");
|
||||
order = 1;
|
||||
}
|
||||
else
|
||||
|
@ -339,8 +342,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Cannot parse load-on-startup " + s + ". Please use integer");
|
||||
Log.ignore(e);
|
||||
LOG.warn("Cannot parse load-on-startup " + s + ". Please use integer");
|
||||
LOG.ignore(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -384,7 +387,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
String roleLink = securityRef.getString("role-link", false, true);
|
||||
if (roleName != null && roleName.length() > 0 && roleLink != null && roleLink.length() > 0)
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("link role " + roleName + " to " + roleLink + " for " + this);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("link role " + roleName + " to " + roleLink + " for " + this);
|
||||
Origin o = context.getMetaData().getOrigin(servlet_name+".servlet.role-name."+roleName);
|
||||
switch (o)
|
||||
{
|
||||
|
@ -417,7 +420,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
else
|
||||
{
|
||||
Log.warn("Ignored invalid security-role-ref element: " + "servlet-name=" + holder.getName() + ", " + securityRef);
|
||||
LOG.warn("Ignored invalid security-role-ref element: " + "servlet-name=" + holder.getName() + ", " + securityRef);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -922,7 +925,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
scBase.setDataConstraint(Constraint.DC_CONFIDENTIAL);
|
||||
else
|
||||
{
|
||||
Log.warn("Unknown user-data-constraint:" + guarantee);
|
||||
LOG.warn("Unknown user-data-constraint:" + guarantee);
|
||||
scBase.setDataConstraint(Constraint.DC_CONFIDENTIAL);
|
||||
}
|
||||
}
|
||||
|
@ -966,7 +969,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (CloneNotSupportedException e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1362,7 +1365,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
listener = newListenerInstance(context,listenerClass);
|
||||
if (!(listener instanceof EventListener))
|
||||
{
|
||||
Log.warn("Not an EventListener: " + listener);
|
||||
LOG.warn("Not an EventListener: " + listener);
|
||||
return;
|
||||
}
|
||||
context.addEventListener(listener);
|
||||
|
@ -1372,7 +1375,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Could not instantiate listener " + className, e);
|
||||
LOG.warn("Could not instantiate listener " + className, e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1459,7 +1462,7 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.debug(e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import javax.servlet.ServletContextListener;
|
|||
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlParser;
|
||||
|
||||
|
@ -53,6 +54,8 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
*/
|
||||
public class TagLibConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(TagLibConfiguration.class);
|
||||
|
||||
public static final String TLD_RESOURCES = "org.eclipse.jetty.tlds";
|
||||
|
||||
/**
|
||||
|
@ -115,7 +118,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +214,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
try
|
||||
{
|
||||
tld = iter.next();
|
||||
if (Log.isDebugEnabled()) Log.debug("TLD="+tld);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("TLD="+tld);
|
||||
|
||||
TldDescriptor d = new TldDescriptor(tld);
|
||||
d.parse();
|
||||
|
@ -219,7 +222,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.warn("Unable to parse TLD: " + tld,e);
|
||||
LOG.warn("Unable to parse TLD: " + tld,e);
|
||||
}
|
||||
}
|
||||
return descriptors;
|
||||
|
@ -287,7 +290,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -345,7 +348,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
|
||||
if (_root==null)
|
||||
{
|
||||
Log.warn("No TLD root in {}",_xml);
|
||||
LOG.warn("No TLD root in {}",_xml);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -375,7 +378,7 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
public void visitListener (WebAppContext context, Descriptor descriptor, XmlParser.Node node)
|
||||
{
|
||||
String className=node.getString("listener-class",false,true);
|
||||
if (Log.isDebugEnabled()) Log.debug("listener="+className);
|
||||
if (LOG.isDebugEnabled()) LOG.debug("listener="+className);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -385,13 +388,13 @@ public class TagLibConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.warn("Could not instantiate listener "+className+": "+e);
|
||||
Log.debug(e);
|
||||
LOG.warn("Could not instantiate listener "+className+": "+e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
catch(Error e)
|
||||
{
|
||||
Log.warn("Could not instantiate listener "+className+": "+e);
|
||||
Log.debug(e);
|
||||
LOG.warn("Could not instantiate listener "+className+": "+e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.StringTokenizer;
|
|||
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
|
||||
|
@ -53,6 +54,8 @@ import org.eclipse.jetty.util.resource.ResourceCollection;
|
|||
*/
|
||||
public class WebAppClassLoader extends URLClassLoader
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebAppClassLoader.class);
|
||||
|
||||
private final Context _context;
|
||||
private final ClassLoader _parent;
|
||||
private final Set<String> _extensions=new HashSet<String>();
|
||||
|
@ -215,8 +218,8 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
while (tokenizer.hasMoreTokens())
|
||||
{
|
||||
Resource resource= _context.newResource(tokenizer.nextToken().trim());
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Path resource=" + resource);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Path resource=" + resource);
|
||||
|
||||
// Add the resource
|
||||
if (resource.isDirectory() && resource instanceof ResourceCollection)
|
||||
|
@ -275,7 +278,7 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.warn(Log.EXCEPTION,ex);
|
||||
LOG.warn(Log.EXCEPTION,ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -348,8 +351,8 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
|
||||
if (url == null && name.startsWith("/"))
|
||||
{
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("HACK leading / off " + name);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("HACK leading / off " + name);
|
||||
url= this.findResource(name.substring(1));
|
||||
}
|
||||
}
|
||||
|
@ -361,8 +364,8 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
}
|
||||
|
||||
if (url != null)
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("getResource("+name+")=" + url);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("getResource("+name+")=" + url);
|
||||
|
||||
return url;
|
||||
}
|
||||
|
@ -396,8 +399,8 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
try
|
||||
{
|
||||
c= _parent.loadClass(name);
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("loaded " + c);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("loaded " + c);
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
|
@ -426,8 +429,8 @@ public class WebAppClassLoader extends URLClassLoader
|
|||
if (resolve)
|
||||
resolveClass(c);
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("loaded " + c+ " from "+c.getClassLoader());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("loaded " + c+ " from "+c.getClassLoader());
|
||||
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.eclipse.jetty.util.MultiException;
|
|||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
|
||||
|
@ -65,6 +66,8 @@ import org.eclipse.jetty.util.resource.ResourceCollection;
|
|||
*/
|
||||
public class WebAppContext extends ServletContextHandler implements WebAppClassLoader.Context
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebAppContext.class);
|
||||
|
||||
public static final String TEMPDIR = "javax.servlet.context.tempdir";
|
||||
public static final String BASETEMPDIR = "org.eclipse.jetty.webapp.basetempdir";
|
||||
public final static String WEB_DEFAULTS_XML="org/eclipse/jetty/webapp/webdefault.xml";
|
||||
|
@ -292,7 +295,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
|
||||
// if ( !(classLoader instanceof WebAppClassLoader) )
|
||||
// {
|
||||
// Log.info("NOTE: detected a classloader which is not an instance of WebAppClassLoader being set on WebAppContext, some typical class and resource locations may be missing on: " + toString() );
|
||||
// LOG.info("NOTE: detected a classloader which is not an instance of WebAppClassLoader being set on WebAppContext, some typical class and resource locations may be missing on: " + toString() );
|
||||
// }
|
||||
|
||||
if (classLoader!=null && classLoader instanceof WebAppClassLoader && getDisplayName()!=null)
|
||||
|
@ -321,7 +324,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
if (ioe==null)
|
||||
ioe= e;
|
||||
}
|
||||
|
@ -394,14 +397,14 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
_ownClassLoader=true;
|
||||
}
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
if (LOG.isDebugEnabled())
|
||||
{
|
||||
ClassLoader loader = getClassLoader();
|
||||
Log.debug("Thread Context class loader is: " + loader);
|
||||
LOG.debug("Thread Context class loader is: " + loader);
|
||||
loader=loader.getParent();
|
||||
while(loader!=null)
|
||||
{
|
||||
Log.debug("Parent class loader is: " + loader);
|
||||
LOG.debug("Parent class loader is: " + loader);
|
||||
loader=loader.getParent();
|
||||
}
|
||||
}
|
||||
|
@ -409,7 +412,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
// Prepare for configuration
|
||||
for (int i=0;i<_configurations.length;i++)
|
||||
{
|
||||
Log.debug("preConfigure {} with {}",this,_configurations[i]);
|
||||
LOG.debug("preConfigure {} with {}",this,_configurations[i]);
|
||||
_configurations[i].preConfigure(this);
|
||||
}
|
||||
}
|
||||
|
@ -420,7 +423,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
// Configure webapp
|
||||
for (int i=0;i<_configurations.length;i++)
|
||||
{
|
||||
Log.debug("configure {} with {}",this,_configurations[i]);
|
||||
LOG.debug("configure {} with {}",this,_configurations[i]);
|
||||
_configurations[i].configure(this);
|
||||
}
|
||||
}
|
||||
|
@ -431,7 +434,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
// Clean up after configuration
|
||||
for (int i=0;i<_configurations.length;i++)
|
||||
{
|
||||
Log.debug("postConfigure {} with {}",this,_configurations[i]);
|
||||
LOG.debug("postConfigure {} with {}",this,_configurations[i]);
|
||||
_configurations[i].postConfigure(this);
|
||||
}
|
||||
}
|
||||
|
@ -456,7 +459,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
catch (Exception e)
|
||||
{
|
||||
//start up of the webapp context failed, make sure it is not started
|
||||
Log.warn("Failed startup of context "+this, e);
|
||||
LOG.warn("Failed startup of context "+this, e);
|
||||
_unavailableException=e;
|
||||
setAvailable(false);
|
||||
if (isThrowUnavailableOnStartupException())
|
||||
|
@ -533,7 +536,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
if (displayName == null)
|
||||
displayName = "WebApp@"+connectors.hashCode();
|
||||
|
||||
Log.info(displayName + " at http://" + connectorName + getContextPath());
|
||||
LOG.info(displayName + " at http://" + connectorName + getContextPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1073,7 +1076,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
if (dir!=null)
|
||||
{
|
||||
try{dir=new File(dir.getCanonicalPath());}
|
||||
catch (IOException e){Log.warn(Log.EXCEPTION,e);}
|
||||
catch (IOException e){LOG.warn(Log.EXCEPTION,e);}
|
||||
}
|
||||
|
||||
if (dir!=null && !dir.exists())
|
||||
|
@ -1092,7 +1095,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.warn(e);
|
||||
LOG.warn(e);
|
||||
}
|
||||
_tmpDir=dir;
|
||||
setAttribute(TEMPDIR,_tmpDir);
|
||||
|
|
|
@ -22,6 +22,7 @@ import javax.servlet.Servlet;
|
|||
|
||||
import org.eclipse.jetty.util.Loader;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.xml.XmlParser;
|
||||
|
||||
|
@ -33,7 +34,9 @@ import org.eclipse.jetty.xml.XmlParser;
|
|||
* A web descriptor (web.xml/web-defaults.xml/web-overrides.xml).
|
||||
*/
|
||||
public class WebDescriptor extends Descriptor
|
||||
{
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebDescriptor.class);
|
||||
|
||||
protected static XmlParser _parserSingleton;
|
||||
protected MetaDataComplete _metaDataComplete;
|
||||
protected int _majorVersion = 3; //default to container version
|
||||
|
@ -86,7 +89,7 @@ public class WebDescriptor extends Descriptor
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -195,7 +198,7 @@ public class WebDescriptor extends Descriptor
|
|||
_metaDataComplete = Boolean.valueOf(s).booleanValue()?MetaDataComplete.True:MetaDataComplete.False;
|
||||
}
|
||||
|
||||
Log.debug(_xml.toString()+": Calculated metadatacomplete = " + _metaDataComplete + " with version=" + version);
|
||||
LOG.debug(_xml.toString()+": Calculated metadatacomplete = " + _metaDataComplete + " with version=" + version);
|
||||
}
|
||||
|
||||
public void processOrdering ()
|
||||
|
|
|
@ -16,12 +16,15 @@ import org.eclipse.jetty.util.IO;
|
|||
import org.eclipse.jetty.util.PatternMatcher;
|
||||
import org.eclipse.jetty.util.URIUtil;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.JarResource;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.util.resource.ResourceCollection;
|
||||
|
||||
public class WebInfConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebInfConfiguration.class);
|
||||
|
||||
public static final String TEMPDIR_CONFIGURED = "org.eclipse.jetty.tmpdirConfigured";
|
||||
public static final String CONTAINER_JAR_PATTERN = "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern";
|
||||
public static final String WEBINF_JAR_PATTERN = "org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern";
|
||||
|
@ -122,7 +125,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
//cannot configure if the context is already started
|
||||
if (context.isStarted())
|
||||
{
|
||||
if (Log.isDebugEnabled()){Log.debug("Cannot configure webapp "+context+" after it is started");}
|
||||
if (LOG.isDebugEnabled()){LOG.debug("Cannot configure webapp "+context+" after it is started");}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -282,7 +285,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
catch(Exception e)
|
||||
{
|
||||
tmpDir=null;
|
||||
Log.ignore(e);
|
||||
LOG.ignore(e);
|
||||
}
|
||||
|
||||
//Third ... Something went wrong trying to make the tmp directory, just make
|
||||
|
@ -301,7 +304,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch(IOException e)
|
||||
{
|
||||
Log.warn("tmpdir",e); System.exit(1);
|
||||
LOG.warn("tmpdir",e); System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -343,7 +346,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
{
|
||||
if (!IO.delete(tmpDir))
|
||||
{
|
||||
if(Log.isDebugEnabled())Log.debug("Failed to delete temp dir "+tmpDir);
|
||||
if(LOG.isDebugEnabled())LOG.debug("Failed to delete temp dir "+tmpDir);
|
||||
}
|
||||
|
||||
//If we can't delete the existing tmp dir, create a new one
|
||||
|
@ -353,7 +356,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
tmpDir=File.createTempFile(temp+"_","");
|
||||
if (tmpDir.exists())
|
||||
IO.delete(tmpDir);
|
||||
Log.warn("Can't reuse "+old+", using "+tmpDir);
|
||||
LOG.warn("Can't reuse "+old+", using "+tmpDir);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,8 +373,8 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
sentinel.mkdir();
|
||||
}
|
||||
|
||||
if(Log.isDebugEnabled())
|
||||
Log.debug("Set temp dir "+tmpDir);
|
||||
if(LOG.isDebugEnabled())
|
||||
LOG.debug("Set temp dir "+tmpDir);
|
||||
context.setTempDirectory(tmpDir);
|
||||
}
|
||||
}
|
||||
|
@ -393,12 +396,12 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
// Accept aliases for WAR files
|
||||
if (web_app.getAlias() != null)
|
||||
{
|
||||
Log.debug(web_app + " anti-aliased to " + web_app.getAlias());
|
||||
LOG.debug(web_app + " anti-aliased to " + web_app.getAlias());
|
||||
web_app = context.newResource(web_app.getAlias());
|
||||
}
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("Try webapp=" + web_app + ", exists=" + web_app.exists() + ", directory=" + web_app.isDirectory());
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Try webapp=" + web_app + ", exists=" + web_app.exists() + ", directory=" + web_app.isDirectory());
|
||||
|
||||
// Is the WAR usable directly?
|
||||
if (web_app.exists() && !web_app.isDirectory() && !web_app.toString().startsWith("jar:"))
|
||||
|
@ -439,7 +442,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
if (web_app.getFile()!=null && web_app.getFile().isDirectory())
|
||||
{
|
||||
// Copy directory
|
||||
Log.info("Copy " + web_app + " to " + extractedWebAppDir);
|
||||
LOG.info("Copy " + web_app + " to " + extractedWebAppDir);
|
||||
web_app.copyTo(extractedWebAppDir);
|
||||
}
|
||||
else
|
||||
|
@ -448,7 +451,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
{
|
||||
//it hasn't been extracted before so extract it
|
||||
extractedWebAppDir.mkdir();
|
||||
Log.info("Extract " + web_app + " to " + extractedWebAppDir);
|
||||
LOG.info("Extract " + web_app + " to " + extractedWebAppDir);
|
||||
Resource jar_web_app = JarResource.newJarResource(web_app);
|
||||
jar_web_app.copyTo(extractedWebAppDir);
|
||||
}
|
||||
|
@ -459,7 +462,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
{
|
||||
IO.delete(extractedWebAppDir);
|
||||
extractedWebAppDir.mkdir();
|
||||
Log.info("Extract " + web_app + " to " + extractedWebAppDir);
|
||||
LOG.info("Extract " + web_app + " to " + extractedWebAppDir);
|
||||
Resource jar_web_app = JarResource.newJarResource(web_app);
|
||||
jar_web_app.copyTo(extractedWebAppDir);
|
||||
}
|
||||
|
@ -471,14 +474,14 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
// Now do we have something usable?
|
||||
if (!web_app.exists() || !web_app.isDirectory())
|
||||
{
|
||||
Log.warn("Web application not found " + war);
|
||||
LOG.warn("Web application not found " + war);
|
||||
throw new java.io.FileNotFoundException(war);
|
||||
}
|
||||
|
||||
context.setBaseResource(web_app);
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("webapp=" + web_app);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("webapp=" + web_app);
|
||||
}
|
||||
|
||||
|
||||
|
@ -508,7 +511,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
IO.delete(webInfLibDir);
|
||||
webInfLibDir.mkdir();
|
||||
|
||||
Log.info("Copying WEB-INF/lib " + web_inf_lib + " to " + webInfLibDir);
|
||||
LOG.info("Copying WEB-INF/lib " + web_inf_lib + " to " + webInfLibDir);
|
||||
web_inf_lib.copyTo(webInfLibDir);
|
||||
}
|
||||
|
||||
|
@ -519,7 +522,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
if (webInfClassesDir.exists())
|
||||
IO.delete(webInfClassesDir);
|
||||
webInfClassesDir.mkdir();
|
||||
Log.info("Copying WEB-INF/classes from "+web_inf_classes+" to "+webInfClassesDir.getAbsolutePath());
|
||||
LOG.info("Copying WEB-INF/classes from "+web_inf_classes+" to "+webInfClassesDir.getAbsolutePath());
|
||||
web_inf_classes.copyTo(webInfClassesDir);
|
||||
}
|
||||
|
||||
|
@ -527,8 +530,8 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
|
||||
ResourceCollection rc = new ResourceCollection(web_inf,web_app);
|
||||
|
||||
if (Log.isDebugEnabled())
|
||||
Log.debug("context.resourcebase = "+rc);
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("context.resourcebase = "+rc);
|
||||
|
||||
context.setBaseResource(rc);
|
||||
}
|
||||
|
@ -635,7 +638,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.warn("Can't generate resourceBase as part of webapp tmp dir name", e);
|
||||
LOG.warn("Can't generate resourceBase as part of webapp tmp dir name", e);
|
||||
}
|
||||
|
||||
//Context name
|
||||
|
@ -700,7 +703,7 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.warn(Log.EXCEPTION,ex);
|
||||
LOG.warn(Log.EXCEPTION,ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import java.net.MalformedURLException;
|
|||
import org.eclipse.jetty.servlet.ErrorPageErrorHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHandler;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
|
@ -27,6 +28,8 @@ import org.eclipse.jetty.util.resource.Resource;
|
|||
*/
|
||||
public class WebXmlConfiguration extends AbstractConfiguration
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(WebXmlConfiguration.class);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------------- */
|
||||
/**
|
||||
|
@ -76,7 +79,7 @@ public class WebXmlConfiguration extends AbstractConfiguration
|
|||
// cannot configure if the context is already started
|
||||
if (context.isStarted())
|
||||
{
|
||||
if (Log.isDebugEnabled()) Log.debug("Cannot configure webapp after it is started");
|
||||
if (LOG.isDebugEnabled()) LOG.debug("Cannot configure webapp after it is started");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,7 +102,7 @@ public class WebXmlConfiguration extends AbstractConfiguration
|
|||
// do web.xml file
|
||||
Resource web = web_inf.addPath("web.xml");
|
||||
if (web.exists()) return web;
|
||||
Log.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
|
||||
LOG.debug("No WEB-INF/web.xml in " + context.getWar() + ". Serving files and default/dynamic servlets only");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue