dev@glassfish.java.net

Re: ASMain() does not work in OSGi mode

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Wed, 25 Jun 2008 12:04:26 -0700

Sahoo wrote:
> Vivek Pandey wrote:
>>>
>>> I am confused. If something is used during deployment,
>> Let me explain:
>>
>> glassfish gem is basically glassfish nucleus + some ruby code. There
>> is not separate bootstrap and deployment phase. The way users run it
>> (think like Jetty):
>>
>> glassfish_rails [OPTIONS] <railsappdirectory>
>>
>> Here glassfish_rails is the ruby script that calls ASMain(String
>> args). Here args would be anything that is specified on the CLI of
>> glassfish_rails. The way it worked with HK2 is that ASMainHK2 would
>> call bootstrap.Main which will create StartupContext from the passed
>> args and configure the runtime accordingly.
>>
> HK2 works differently from OSGi. As I said, there is no standard way
> to pass any initialization parameters to a bundle.
This happens thru injection of ServerEnvironment. How would this
contract be preserved? I would think whoever injects it configures it
thru some means so that when Deployers get ServerEnvironment it is setup
correctly.

> You can always set the necessary String[] in a system property and
> read it in your module.
>
Yes I can do that but that would be ugly. The Deployer is pretty generic
- it does not keep knowledge of how it is invoked. As I mentioned above
from the GF API perspective, this has to be something handled much
before the modules get in the picture.

-vivek.
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>