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 11:02:27 -0700

Sahoo wrote:
> Vivek Pandey wrote:
>> Sahoo wrote:
>>> Vivek,
>>>
>>> You are right that in OSGi mode, args passed using ASMain.main(args)
>>> is not passed to the startupModule. That's because there is no way
>>> to pass any object to an activated bundle. A bundle should have
>>> its own way of configuring itself either by reading from a file or
>>> by use of properties.
>>
>> What do you mean by the bundle? jruby module (Sniffer/Deployer etc.)
>> is an OSGi bundle but it expects certain values to be provided to it
>> at the runtime.
>>
>> The StartupContext which has these values is passed on to Deployer
>> thru DeployerContext. In my case RailsDeployer expects StartupContext
>> to have these values and it does not
>>> Can your code use anything like that?
>>>
>> I am not sure how my code can get to it. Reading from a file or
>> property does not apply to this case. The usecase is that the
>> properties are passed thru CLI or glassfish gem. These values are
>> given to ASMain and finally reaches to the Deployer as StartupContext.
>
> 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.

Hope this makes it clear.

-vivek.
> why is that expected to be passed via ASMain, which is called during
> bootstrap process.
>
> 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
>