Author: pete.muir(a)jboss.org
Date: 2008-10-20 06:47:32 -0400 (Mon, 20 Oct 2008)
New Revision: 9362
Modified:
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/init/Initialization.java
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/navigation/Pages.java
Log:
merge in r9360 to the 2.1.0.GA tag
Modified:
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java
===================================================================
---
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-10-19
11:58:59 UTC (rev 9361)
+++
tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/deployment/WarRootDeploymentStrategy.java 2008-10-20
10:47:32 UTC (rev 9362)
@@ -1,6 +1,7 @@
package org.jboss.seam.deployment;
import java.io.File;
+import java.util.Set;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -25,6 +26,8 @@
public static final String NAME = "warRootDeploymentStrategy";
+ private DotPageDotXmlDeploymentHandler dotPageDotXmlDeploymentHandler;
+
public WarRootDeploymentStrategy(ClassLoader classLoader, File warRoot)
{
this.classLoader = classLoader;
@@ -38,7 +41,8 @@
log.warn("Unable to discover war root, .page.xml files won't be
found");
this.warRoot = new File[0];
}
- getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME, new
DotPageDotXmlDeploymentHandler());
+ dotPageDotXmlDeploymentHandler = new DotPageDotXmlDeploymentHandler();
+ getDeploymentHandlers().put(DotPageDotXmlDeploymentHandler.NAME,
dotPageDotXmlDeploymentHandler);
}
@Override
@@ -67,5 +71,10 @@
{
getScanner().scanDirectories(warRoot);
}
+
+ public Set<String> getDotPageDotXmlFileNames()
+ {
+ return dotPageDotXmlDeploymentHandler.getFiles();
+ }
}
Modified: tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/init/Initialization.java
===================================================================
--- tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/init/Initialization.java 2008-10-19
11:58:59 UTC (rev 9361)
+++ tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/init/Initialization.java 2008-10-20
10:47:32 UTC (rev 9362)
@@ -736,16 +736,16 @@
{
try
{
- ServletLifecycle.beginReinitialization(request);
hotDeploymentStrategy =
createHotDeployment(Thread.currentThread().getContextClassLoader());
if (hotDeploymentStrategy.isEnabled())
{
hotDeploymentStrategy.scan();
- Init init = Init.instance();
+ Init init = (Init) ServletLifecycle.getServletContext().getAttribute(
Seam.getComponentName(Init.class) );
if (init.getTimestamp() < hotDeploymentStrategy.getTimestamp())
{
log.info("redeploying");
+ ServletLifecycle.beginReinitialization(request);
Seam.clearComponentNameCache();
for ( String name: init.getHotDeployableComponents() )
{
@@ -769,20 +769,19 @@
Contexts.getEventContext().set(HotDeploymentStrategy.NAME,
hotDeploymentStrategy);
init.setTimestamp( System.currentTimeMillis() );
installComponents(init);
+ ServletLifecycle.endReinitialization();
log.info("done redeploying");
}
WarRootDeploymentStrategy warRootDeploymentStrategy = new
WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot);
warRootDeploymentStrategy.scan();
- Contexts.getEventContext().set(WarRootDeploymentStrategy.NAME,
warRootDeploymentStrategy);
- Pages pages = Pages.instance();
+ Pages pages = (Pages)
ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
if (pages!= null) {
- pages.initialize();
+
pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
}
-
Contexts.getApplicationContext().remove(Seam.getComponentName(Exceptions.class));
+ ServletLifecycle.getServletContext().removeAttribute(
Seam.getComponentName(Exceptions.class) );
}
- ServletLifecycle.endReinitialization();
}
finally
{
Modified: tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/navigation/Pages.java 2008-10-19
11:58:59 UTC (rev 9361)
+++ tags/JBoss_Seam_2_1_0_GA/src/main/org/jboss/seam/navigation/Pages.java 2008-10-20
10:47:32 UTC (rev 9362)
@@ -104,11 +104,25 @@
@Create
public void create()
{
- initialize();
+ if (DotPageDotXmlDeploymentHandler.instance() != null)
+ {
+ initialize(DotPageDotXmlDeploymentHandler.instance().getFiles());
+ }
+ else
+ {
+ initialize();
+ }
}
+
+
public void initialize()
{
+ initialize(null);
+ }
+
+ public void initialize(Set<String> fileNames)
+ {
pagesByViewId = Collections.synchronizedMap(new HashMap<String, Page>());
pageStacksByViewId = Collections.synchronizedMap(new HashMap<String,
List<Page>>());
conversations = Collections.synchronizedMap(new HashMap<String,
ConversationIdParameter>());
@@ -129,9 +143,9 @@
}
}
- if (DotPageDotXmlDeploymentHandler.instance() != null)
+ if (fileNames != null)
{
- parsePages(DotPageDotXmlDeploymentHandler.instance().getFiles());
+ parsePages(fileNames);
}
}
Show replies by date