Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2011-08-24 16:01:00 -0400
committerJoakim Erdfelt2011-08-24 16:01:00 -0400
commit3399242d831ca3730bec8877bf4599e65ccec3aa (patch)
treed463aa73342a8ff4a655edff6a802ce9b0d609ee /jetty-deploy
parentf7f7e0af7545e060f6508c7fe07b858fd58ebc3b (diff)
downloadorg.eclipse.jetty.project-3399242d831ca3730bec8877bf4599e65ccec3aa.tar.gz
org.eclipse.jetty.project-3399242d831ca3730bec8877bf4599e65ccec3aa.tar.xz
org.eclipse.jetty.project-3399242d831ca3730bec8877bf4599e65ccec3aa.zip
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
Diffstat (limited to 'jetty-deploy')
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java7
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java11
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java21
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java9
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java5
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java11
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/StandardUndeployer.java9
-rw-r--r--jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java13
-rw-r--r--jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java5
9 files changed, 59 insertions, 32 deletions
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java
index 7738cecb32..51f66e1cff 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/AppLifeCycle.java
@@ -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);
}
}
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java
index a4520fabfe..4e0305142a 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/ContextDeployer.java
@@ -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;
}
}
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
index 5e83a08364..0cb29ccc7c 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
@@ -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");
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java
index 9b597115cb..81e641cbfd 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/WebAppDeployer.java
@@ -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);
}
}
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java
index 0cafed8074..c70ec78e8c 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/DebugBinding.java
@@ -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());
}
}
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
index 9e9a9cf41f..ceeeb027d0 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/GlobalWebappConfigBinding.java
@@ -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);
}
}
}
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/StandardUndeployer.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/StandardUndeployer.java
index 3b093440e8..0a5c08c6bd 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/StandardUndeployer.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/bindings/StandardUndeployer.java
@@ -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)
{
diff --git a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
index dc1dab6f23..629f13f92e 100644
--- a/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
+++ b/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
@@ -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);
diff --git a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
index 427f494249..d0611fa692 100644
--- a/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
+++ b/jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/ScanningAppProviderRuntimeUpdatesTest.java
@@ -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);

Back to the top