Description of problem: When writing command line programs it is typically required that WAF be initialized. This is achieved by invoking the c.a.runtime.Startup class' startup() method. At the same time, however, ther are a number of things that do not need to be initialized for a command line tool, or indeed could cause race/error conditions if the tool were run on the same host that had a servlet active. Thus there needs to be some way to inform the impl's of c.a.runtime.INitializer what context they are being run in, enabling them to bypass any servlet specific startup processes when being run from the command line. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
To start a list of things that don't need to be run when Startup is called from a command-line tool/program: 1. Most TimerTask background threads do not need to be started. 2. ... Anything else? On a related note, there used to be a way to run a subset of initializers when invoking unit tests. Currently, all initializers are run, which makes unit testing noticeably slower. Even if I only want to run a single suite in Core, I have to wait for a bunch of other initializers to finish (CMS, formsectionitem, formitem, forum, portalserver - you name it). This may merit a separate ticket though.
WRT to unit tests, I'm of the opinion that you should only have the application you're running tests in (and its dependents) loaded in the system. Having other unrelated applications present can break assumptions made by the authors of the unit tests, causing false failures. Not running the initializers of these unrelated apps is likely to make the situation worse, for example if the test gets an object for which there is no instantiator present.
Regarding the problem described in the ticket I believe we've discussed addressing the issue by moving web specific startup activities to servlet init methods and reserving the initializer system for truly environment agnostic stuff. Are you suggesting another approach or simply observing that we still need to do this?
Just observing the need for a solution, no particular opinion on the approach we decide to take at this time.
slate