From ecc9b9b417b44a23ef8e6db7716364a7f07a5272 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Thu, 6 Aug 2009 03:41:56 +0000 Subject: [PATCH] Remove context attributes in postConfigure() phase of configuration that are not needed during deconfigure(). git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@649 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../jetty/annotations/AnnotationConfiguration.java | 3 ++- .../jetty/plus/webapp/AbstractConfiguration.java | 7 +++++++ .../eclipse/jetty/webapp/FragmentConfiguration.java | 4 ++-- .../org/eclipse/jetty/webapp/MetaInfConfiguration.java | 8 ++++---- .../org/eclipse/jetty/webapp/TagLibConfiguration.java | 5 ++--- .../org/eclipse/jetty/webapp/WebInfConfiguration.java | 7 +++---- .../org/eclipse/jetty/webapp/WebXmlConfiguration.java | 10 ++++------ 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java index 87350506c41..4edb6f5e082 100644 --- a/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java +++ b/jetty-annotations/src/main/java/org/eclipse/jetty/annotations/AnnotationConfiguration.java @@ -83,7 +83,7 @@ public class AnnotationConfiguration extends AbstractConfiguration public void deconfigure(WebAppContext context) throws Exception { - context.setAttribute(CLASS_INHERITANCE_MAP, null); + } @@ -91,6 +91,7 @@ public class AnnotationConfiguration extends AbstractConfiguration public void postConfigure(WebAppContext context) throws Exception { + context.setAttribute(CLASS_INHERITANCE_MAP, null); } } diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/AbstractConfiguration.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/AbstractConfiguration.java index c0fb65ee3f2..1b859f672b4 100644 --- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/AbstractConfiguration.java +++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/AbstractConfiguration.java @@ -411,6 +411,13 @@ public abstract class AbstractConfiguration implements Configuration context.setAttribute(RunAsCollection.RUNAS_COLLECTION, runAsCollection); } + public void postConfigure(WebAppContext context) throws Exception + { + context.setAttribute(LifeCycleCallbackCollection.LIFECYCLE_CALLBACK_COLLECTION, null); + context.setAttribute(InjectionCollection.INJECTION_COLLECTION, null); + context.setAttribute(RunAsCollection.RUNAS_COLLECTION, null); + } + public void configure (WebAppContext context) throws Exception { diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java index 76fede564c4..8f67cc30725 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/FragmentConfiguration.java @@ -69,12 +69,12 @@ public class FragmentConfiguration implements Configuration public void deconfigure(WebAppContext context) throws Exception { - context.setAttribute(FRAGMENT_RESOURCES, null); - + } public void postConfigure(WebAppContext context) throws Exception { + context.setAttribute(FRAGMENT_RESOURCES, null); } /* ------------------------------------------------------------------------------- */ diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java index 4e60870db45..e053781ed25 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java @@ -85,14 +85,14 @@ public class MetaInfConfiguration implements Configuration public void deconfigure(WebAppContext context) throws Exception { - context.setAttribute(METAINF_FRAGMENTS, null); - context.setAttribute(METAINF_RESOURCES, null); - context.setAttribute(METAINF_TLDS, null); + } public void postConfigure(WebAppContext context) throws Exception { - + context.setAttribute(METAINF_FRAGMENTS, null); + context.setAttribute(METAINF_RESOURCES, null); + context.setAttribute(METAINF_TLDS, null); } public void addResource (WebAppContext context, String attribute, Resource jar) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java index 297ada3ef48..cee9b115989 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/TagLibConfiguration.java @@ -282,13 +282,12 @@ public class TagLibConfiguration implements Configuration public void postConfigure(WebAppContext context) throws Exception { - // TODO Auto-generated method stub - + context.setAttribute(TldProcessor.TAGLIB_PROCESSOR, null); } public void deconfigure(WebAppContext context) throws Exception { - context.setAttribute(TldProcessor.TAGLIB_PROCESSOR, null); + } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java index 3f921f293c5..2148b5c9d67 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java @@ -112,8 +112,8 @@ public class WebInfConfiguration implements Configuration public void postConfigure(WebAppContext context) throws Exception { - // TODO Auto-generated method stub - + context.setAttribute(CONTAINER_JAR_RESOURCES, null); + context.setAttribute(WEB_INF_JAR_RESOURCES, null); } @@ -166,8 +166,7 @@ public class WebInfConfiguration implements Configuration setTempDirectory(null, context); } - context.setAttribute(CONTAINER_JAR_RESOURCES, null); - context.setAttribute(WEB_INF_JAR_RESOURCES, null); + context.setAttribute(TEMPDIR_CREATED, null); context.setAttribute(context.TEMPDIR, null); } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java index 150d07038fb..da33f6f05f3 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java @@ -123,8 +123,10 @@ public class WebXmlConfiguration implements Configuration public void postConfigure(WebAppContext context) throws Exception { - // TODO Auto-generated method stub - + context.setAttribute(WebXmlProcessor.WEB_PROCESSOR, null); + context.setAttribute(WebXmlProcessor.METADATA_COMPLETE, null); + context.setAttribute(WebXmlProcessor.WEBXML_VERSION, null); + context.setAttribute(WebXmlProcessor.WEBXML_CLASSNAMES, null); } @@ -176,9 +178,5 @@ public class WebXmlConfiguration implements Configuration // TODO remove classpaths from classloader - context.setAttribute(WebXmlProcessor.WEB_PROCESSOR, null); - context.setAttribute(WebXmlProcessor.METADATA_COMPLETE, null); - context.setAttribute(WebXmlProcessor.WEBXML_VERSION, null); - context.setAttribute(WebXmlProcessor.WEBXML_CLASSNAMES, null); } }