You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Konstantin Kolinko <kn...@gmail.com> on 2009/06/13 16:45:39 UTC

HostConfig.checkResources()

In o.a.c.startup.HostConfig.checkResources() method of tc6.0.x and of trunk,
there are two code paths that perform undeploy of an application --
look for the comment
"// Undeploy application".

The first one is called when a redeployResources resource is updated.
The second one
- when it is deleted (unless its lastModified time was 0L).

There is a difference: the second one has
"// Delete reload resources as well (to remove any remaining .xml descriptor)"
loop over app.reloadResources deleting them as well.

May someone explain the difference?

It would be nice to refactor those blocks of code in some common method.

I am reviewing the proposed patch for
https://issues.apache.org/bugzilla/show_bug.cgi?id=47343
The issue was caused by the wrong ordering of resources that were added to
 HostConfig$DeployedApplication#redeployResources
Thus I am trying to understand the code.


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: HostConfig.checkResources()

Posted by Mark Thomas <ma...@apache.org>.
Konstantin Kolinko wrote:
> In o.a.c.startup.HostConfig.checkResources() method of tc6.0.x and of trunk,
> there are two code paths that perform undeploy of an application --
> look for the comment
> "// Undeploy application".
> 
> The first one is called when a redeployResources resource is updated.
> The second one
> - when it is deleted (unless its lastModified time was 0L).
> 
> There is a difference: the second one has
> "// Delete reload resources as well (to remove any remaining .xml descriptor)"
> loop over app.reloadResources deleting them as well.
> 
> May someone explain the difference?
The first is removing the expanded directory if the WAR has been
updated. (ie an update)

The second is removing all apps resources if one of them has been
deleted. (ie a 'real' undeploy)

> It would be nice to refactor those blocks of code in some common method.

Anything that makes the code easier to follow would be good. I
completely missed some aspects of this the first time I patched this
issue and I still missed things after Remy explained my first set of
oversights.

Obviously, any changes made here need to be done carefully.

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org