Rickard Oberg wrote:
> 
> > > What if AutoDeployer can ask J2EEDeployer if it is already deployed?
> > >
> > > I think this should be in the AutoDeployer somehow, but it's ok if it
> has to
> > > ask the J2EEDeployer for info about deployments.
> >
> > No. what happens then on regular redeploy... Or wait, do you mean:
> >
> > on AutoDeployer.startup he askes the J2eeDeployer.isDeployed () and only
> > if not... and during his regular service the AutoDeployer dont asks
> > anymore...
> > This would need a flag in the AutoDeployers run method (boolean firstRun
> > or startup) and a lot of work for the J2eeDeployer to not delete _all_
> > in tmp/deploy
> 
> You need to separate which in /tmp/deploy is ok, and what should be removed.
> Don't you have some persistent metainfo about the deployments? Maybe you
> should keep a list of {URL,timestamp}. That way deploy() in J2EEDeployer
> could easily check whether the URL being deployed is already deployed (i.e.
> don't change AutoDeployer at all).

Yes, I do have some metainfo and I can more or less easy divide in good
and bad, thats OK.

The timestamp thing I definitely dont want to reimplement in the
J2eeDeployer. Also a move of that timestamp stuff from AutoDeployer to
J2eeDeployer doesnt make sense to me.
So the J2eeDeployer deploys everything he gets without questions .
<-period

I think this should work:

J2eeDeployer:
-----------------
on startService(): find all deployments that are installed (and so:
where running before), try to start them (startApplication()), if unable
to start, remove them.), remove all files that dont belong to one of the
deployments.

during live time: only do something (and without question) on
deploy,undeploy,isDeployed

on stopService(): stop all applications but dont remove them

AutoDeployer
-----------------
on startService(): try to deploy all watched urls, but only if
J2eeDeployer.isDeployed() returns false for this url

during live time: when timestamp of watched url changes call
J2eeDeployer, regardless if already deployed or not

on stopService(): nothing

before I start with that I would appreciate to get _any_ comments :-)


> 
> Yeah, this needs some thinking, testing, and tinkering. Go ahead ;-) This is
> the fun part.
> 
> /Rickard

Reply via email to