[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [virgo-dev] PDE2Virgo Plugin


I made the change you suggested and also fixed the OSGI-INF issue in the PDE support branch.


On Wed, Jan 13, 2016 at 11:13 PM, Giamma <gm.romanato@xxxxxxxxx> wrote:

I had a quick look at the Server Editor Startup section where -clean, tail and permsize can be configured.

The only changes I applied in the last year to the involed classes are:
1) reformat source code to match the server code-base formatting preferences
2) use NLS to externalize hardcoded strings

When you flag any of the options the selection is passed to the server runtime which stores the information in a property store provided by some WTP base class.

That code works fine. In fact, if I select clean, the next time I start the server the stage and the serviceability folders get deleted.
However, this is not done by really passing the -clean parameter to the server (as the UI claims) but it's rather done by the tooling that checks the user selection and if needed deletes such folders right before starting the server Java process. This is visible here:

Âpublic void preStartup(IServerBehaviour serverBehaviour) {
ÂÂÂÂÂÂÂ File serverHome = ServerUtils.getServer(serverBehaviour).getRuntimeBaseDirectory().toFile();
ÂÂÂÂÂÂÂ File workFolder = new File(serverHome, "work");
ÂÂÂÂÂÂÂ if (ServerUtils.getServer(serverBehaviour).shouldCleanStartup()) {
ÂÂÂÂÂÂÂÂÂÂÂ PublishHelper.deleteDirectory(workFolder, new NullProgressMonitor());
ÂÂÂÂÂÂÂÂÂÂÂ PublishHelper.deleteDirectory(new File(serverHome, "serviceability"), new NullProgressMonitor());

ÂÂÂÂÂÂÂ new File(workFolder, "tmp").mkdirs(); // Fix 464814
ÂÂÂÂÂÂÂ createRepositoryConfiguration(serverBehaviour, getRepositoryConfigurationFileName());

So the setting is indeed honored, even if the "-clean" parameter is not really passed to Virgo. This happens because "-clean" is implemented in the shell scripts, not in the Java code, and because the IDE launches Virgo as a Java program without using the shell scripts, it cannot pass the "-clean" parameter and has to do the cleaning by itself.

Similarly, the tail parameter seem to be properly managed.

Gian Maria Romanato
<gm.romanato (at) gmail (dot) com>

Gian Maria Romanato
<gm.romanato (at) gmail (dot) com>