return;
}
hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
boolean changed = new TimestampCheckForwardingDeploymentStrategy()
{
@Override
protected DeploymentStrategy delegate()
{
return hotDeploymentStrategy;
}
}.changedSince(init.getTimestamp());
if (hotDeploymentStrategy.available() && changed)
{
ServletLifecycle.beginReinitialization(request);
Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
hotDeploymentStrategy.scan();
if (hotDeploymentStrategy.getTimestamp() > init.getTimestamp())
{
log.debug("redeploying components");
Seam.clearComponentNameCache();
for (String name : init.getHotDeployableComponents())
{
Component component = Component.forName(name);
if (component != null)
{
ScopeType scope = component.getScope();
if (scope != ScopeType.STATELESS && scope.isContextActive())
{
scope.getContext().remove(name);
}
init.removeObserverMethods(component);
}
Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
}
init.getHotDeployableComponents().clear();
installHotDeployableComponents();
installComponents(init);
log.debug("done redeploying components");
}
// update the timestamp outside of the second timestamp check to be
// sure we don't cause an unnecessary scan
// 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, servletContext, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
changed = new TimestampCheckForwardingDeploymentStrategy()
{
@Override
protected DeploymentStrategy delegate()
{
return warRootDeploymentStrategy;