dev@glassfish.java.net

Re: ASMain() does not work in OSGi mode

From: Byron Nevins <Byron.Nevins_at_Sun.COM>
Date: Thu, 26 Jun 2008 11:34:31 -0700

Factoid: The ServerEnvironment that gets injected mostly comes from
parsing asenv.[bat|conf] in the installation's config directory.

Vivek Pandey wrote:

> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>

-- 
Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.