You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jason Dillon <ja...@gmail.com> on 2007/03/20 08:12:30 UTC

Re: org.apache.geronimo.system.main.Daemon and commons-cli

I briefly looked into adding this... but looks like a lot of the  
bootstrap plumbing has changed.  I'm a bit bewildered as to why we  
are booting up a temporary kernel before we get to command-line  
option parsing.  I'm also a bit mystified as to why option parsing is  
now spread over several classes.  IMO the bootstrap has become overly  
complicated... and probably needs some love to get it sorted.  The  
task of adding commons-cli to the single Daemon class has become a  
wee bit more difficult due to all of this, so I'm gonna put this off  
for a little bit more while I soak up all of the recent changes and  
let it congeal in my head.

In the meantime... can anyone tell me why we are booting up a kernel  
before cli parsing?  From what has congealed in my head so far...  
this is for access to the repository for classloading of bootstrap  
classes.  Is there any other reason why we boot a kernel here before  
cli parsing?

--jason


On Feb 27, 2007, at 4:20 PM, Matt Hogstrom wrote:

> Sounds good.
>
> On Feb 26, 2007, at 9:02 PM, Jason Dillon wrote:
>
>> Anyone mind if I re-write org.apache.geronimo.system.main.Daemon  
>> to use commons-cli to handle option processing?
>>
>> Use of commons-cli 1.0 add ~30k to the bootstrap classpath (uses  
>> commons-lang, which is already there), and will greatly simplify  
>> this code, and make it a little easier/nicer to add more command- 
>> line options in the future as well as providing.
>>
>> --jason
>>
>


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Gianny Damour <gi...@optusnet.com.au>.
Not at all. I am now back from holiday and I am simply waiting for  
this week-end to check-in these changes.

Thanks,
Gianny


On 03/05/2007, at 1:58 PM, Jason Dillon wrote:

> Sorry man, I've not had any time to look into this... its still on  
> my list though ;-)
>
> --jason
>
>
> On Apr 3, 2007, at 6:45 AM, Gianny Damour wrote:
>
>> Hi,
>>
>> As discussed with Jason, I worked on a fix to this problem:  
>> GERONIMO-3059.
>>
>> I will be on holiday, with sporadic internet access, for a couple  
>> of weeks starting tomorrow night; So, I will not check in these  
>> changes now as I will not be able to support related problems, if  
>> any. Having said that, Jason, if you are happy to check them in  
>> and fix related issues, if any, then I am fine with it :)
>>
>> Thanks,
>> Gianny
>>
>> On 21/03/2007, at 11:05 AM, Sachin Patel wrote:
>>
>>> I agree, this is a usability regression.
>>>
>>> -sachin
>>>
>>>
>>> On Mar 20, 2007, at 5:08 PM, Jason Dillon wrote:
>>>
>>>> You have to wait several seconds for the bootstrap kernel to  
>>>> load... just to display the cli usage... that seems wrong IMO.
>>>
>>
>


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Jason Dillon <ja...@planet57.com>.
Sorry man, I've not had any time to look into this... its still on my  
list though ;-)

--jason


On Apr 3, 2007, at 6:45 AM, Gianny Damour wrote:

> Hi,
>
> As discussed with Jason, I worked on a fix to this problem:  
> GERONIMO-3059.
>
> I will be on holiday, with sporadic internet access, for a couple  
> of weeks starting tomorrow night; So, I will not check in these  
> changes now as I will not be able to support related problems, if  
> any. Having said that, Jason, if you are happy to check them in and  
> fix related issues, if any, then I am fine with it :)
>
> Thanks,
> Gianny
>
> On 21/03/2007, at 11:05 AM, Sachin Patel wrote:
>
>> I agree, this is a usability regression.
>>
>> -sachin
>>
>>
>> On Mar 20, 2007, at 5:08 PM, Jason Dillon wrote:
>>
>>> You have to wait several seconds for the bootstrap kernel to  
>>> load... just to display the cli usage... that seems wrong IMO.
>>
>


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Jason Dillon <ja...@planet57.com>.
I will take a peek at GERONIMO-3059 and provide some feedback.

Thanks :-)

--jason


On Apr 3, 2007, at 6:45 AM, Gianny Damour wrote:

> Hi,
>
> As discussed with Jason, I worked on a fix to this problem:  
> GERONIMO-3059.
>
> I will be on holiday, with sporadic internet access, for a couple  
> of weeks starting tomorrow night; So, I will not check in these  
> changes now as I will not be able to support related problems, if  
> any. Having said that, Jason, if you are happy to check them in and  
> fix related issues, if any, then I am fine with it :)
>
> Thanks,
> Gianny
>
> On 21/03/2007, at 11:05 AM, Sachin Patel wrote:
>
>> I agree, this is a usability regression.
>>
>> -sachin
>>
>>
>> On Mar 20, 2007, at 5:08 PM, Jason Dillon wrote:
>>
>>> You have to wait several seconds for the bootstrap kernel to  
>>> load... just to display the cli usage... that seems wrong IMO.
>>
>


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Gianny Damour <gi...@optusnet.com.au>.
Hi,

As discussed with Jason, I worked on a fix to this problem:  
GERONIMO-3059.

I will be on holiday, with sporadic internet access, for a couple of  
weeks starting tomorrow night; So, I will not check in these changes  
now as I will not be able to support related problems, if any. Having  
said that, Jason, if you are happy to check them in and fix related  
issues, if any, then I am fine with it :)

Thanks,
Gianny

On 21/03/2007, at 11:05 AM, Sachin Patel wrote:

> I agree, this is a usability regression.
>
> -sachin
>
>
> On Mar 20, 2007, at 5:08 PM, Jason Dillon wrote:
>
>> You have to wait several seconds for the bootstrap kernel to  
>> load... just to display the cli usage... that seems wrong IMO.
>


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Sachin Patel <sp...@gmail.com>.
I agree, this is a usability regression.

-sachin


On Mar 20, 2007, at 5:08 PM, Jason Dillon wrote:

> You have to wait several seconds for the bootstrap kernel to  
> load... just to display the cli usage... that seems wrong IMO.


Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Jason Dillon <ja...@planet57.com>.
On Mar 20, 2007, at 4:42 AM, Gianny Damour wrote:
>> In the meantime... can anyone tell me why we are booting up a  
>> kernel before cli parsing?  From what has congealed in my head so  
>> far... this is for access to the repository for classloading of  
>> bootstrap classes.  Is there any other reason why we boot a kernel  
>> here before cli parsing?
>
> A kernel is booted before cli parsing so that classes parsing cli  
> arguments do not need to be defined by the system classloader.  
> Verbose level switches must be done prior to boot a Geronimo kernel  
> as they control the default log level and this initialization must  
> occur prior to acquire the first log instance.
>
> The bootstrap is simple as: load a boot configuration; get a Main  
> implementation from it (or configurations restored when the boot  
> configuration is loaded); and invoke execute(String args[]) on it.  
> AFAIK, all the clis use this unified approach.

So do we end up with 2 kernels after everything is booted?  One for  
bootstrap and one for the real deal?


> Why is it "a wee bit more difficult" to add commons-cli now?

Its just that cli processing is now scattered between a few classes  
over 2 modules at least for Daemon.  There are also a bunch more  
classes, some with main() others w/o main()... which has me  
scratching my head to what this is actually doing.

I'm also wondering what's the difference between Daemon and  
EmbeddedDaemon?

What happens when users want to use a different repository location?

I basically understand what is going on... but I think the order of  
how its being done is a odd.  Like if you run:

     java -jar bin/server.jar --help

You have to wait several seconds for the bootstrap kernel to load...  
just to display the cli usage... that seems wrong IMO.  I would  
rather have commons-cli.jar and a tiny geronimo-cli.jar on the system  
classpath (along with the kernels requirements), process command-line  
options, then boot up the kernel and delegate to a bootstrapping Main  
to finish the job.

--jason



Re: org.apache.geronimo.system.main.Daemon and commons-cli

Posted by Gianny Damour <gi...@optusnet.com.au>.
On 20/03/2007, at 6:12 PM, Jason Dillon wrote:

> I briefly looked into adding this... but looks like a lot of the  
> bootstrap plumbing has changed.  I'm a bit bewildered as to why we  
> are booting up a temporary kernel before we get to command-line  
> option parsing.  I'm also a bit mystified as to why option parsing  
> is now spread over several classes.  IMO the bootstrap has become  
> overly complicated... and probably needs some love to get it  
> sorted.  The task of adding commons-cli to the single Daemon class  
> has become a wee bit more difficult due to all of this, so I'm  
> gonna put this off for a little bit more while I soak up all of the  
> recent changes and let it congeal in my head.
>
> In the meantime... can anyone tell me why we are booting up a  
> kernel before cli parsing?  From what has congealed in my head so  
> far... this is for access to the repository for classloading of  
> bootstrap classes.  Is there any other reason why we boot a kernel  
> here before cli parsing?

A kernel is booted before cli parsing so that classes parsing cli  
arguments do not need to be defined by the system classloader.  
Verbose level switches must be done prior to boot a Geronimo kernel  
as they control the default log level and this initialization must  
occur prior to acquire the first log instance.

The bootstrap is simple as: load a boot configuration; get a Main  
implementation from it (or configurations restored when the boot  
configuration is loaded); and invoke execute(String args[]) on it.  
AFAIK, all the clis use this unified approach.

Why is it "a wee bit more difficult" to add commons-cli now?

Thanks,
Gianny


>
> --jason
>
>
> On Feb 27, 2007, at 4:20 PM, Matt Hogstrom wrote:
>
>> Sounds good.
>>
>> On Feb 26, 2007, at 9:02 PM, Jason Dillon wrote:
>>
>>> Anyone mind if I re-write org.apache.geronimo.system.main.Daemon  
>>> to use commons-cli to handle option processing?
>>>
>>> Use of commons-cli 1.0 add ~30k to the bootstrap classpath (uses  
>>> commons-lang, which is already there), and will greatly simplify  
>>> this code, and make it a little easier/nicer to add more command- 
>>> line options in the future as well as providing.
>>>
>>> --jason
>>>
>>
>