// the second scan checks annotations (the slow part) which might happen to exclude the most recent file
init.setTimestamp(System.currentTimeMillis());
ServletLifecycle.endReinitialization();
}
final WarRootDeploymentStrategy warRootDeploymentStrategy = new WarRootDeploymentStrategy(Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
changed = new TimestampCheckForwardingDeploymentStrategy()
{
@Override
protected DeploymentStrategy delegate()
{
return warRootDeploymentStrategy;
}
}.changedSince(init.getWarTimestamp());
if (changed)
{
warRootDeploymentStrategy.scan();
if (warRootDeploymentStrategy.getTimestamp() > init.getWarTimestamp())
{
log.debug("redeploying page descriptors...");
Pages pages = (Pages) ServletLifecycle.getServletContext().getAttribute(Seam.getComponentName(Pages.class));
if (pages != null) {
// application context is needed for creating expressions
Lifecycle.setupApplication();
pages.initialize(warRootDeploymentStrategy.getDotPageDotXmlFileNames());
Lifecycle.cleanupApplication();
}
ServletLifecycle.getServletContext().removeAttribute(Seam.getComponentName(Exceptions.class));
init.setWarTimestamp(warRootDeploymentStrategy.getTimestamp());
log.debug ("done redeploying page descriptors");
}
}
}
finally