dev@glassfish.java.net

Re: osgi.bundle changes

From: Jerome Dochez <jerome.dochez_at_oracle.com>
Date: Wed, 13 Oct 2010 16:18:23 -0700

you can rely on the habitat to give you all the classes annotated with @Configured and you can load those classes too from the inhabitant instance returned, forget scanning or ASM...

Collection<Inhabitant<?>> getAllByContract(Configured.class);

jerome

On Oct 13, 2010, at 4:07 PM, Justin Lee wrote:

> Hrm. That's a good point. The only thing, at this point, that needs it is the schema documenter. It scans the jars in /modules and looks for any @Configured annotations and documents them. Currently, I'm loading the class to get that information but that is looking to be the wrong route now. I'll play with it more tomorrow and perhaps through some more asm magic I can work around that...
>
> On 10/13/10 7:00 PM, Ludovic Champenois wrote:
>> On 10/13/10 3:54 PM, Justin Lee wrote:
>>> If a bundle doesn't export it, the config tool can't load it to document it. So any 3rd party addons would need to export the packages with those beans. This has to happen anyway if you ever want to create those structures in the hk2 DOM anyway. I'm ok with a separate API package if you want. It doesn't really matter to me, personally.
>> But if cli needs to import it (in its osgi.bundle)., how can you react to optional modules (like value adds, or jRuby container) that define new configs under config?
>>
>> HK2 does not import anything and is still capable of reading/writing domain.xml...
>> The Rest module is capable of working with value added extensions as well...
>> Jerome might comment?
>>
>> Ludo
>>>
>>> On 10/13/10 6:35 PM, Ludovic Champenois wrote:
>>>> On 10/13/10 3:00 PM, Justin Lee wrote:
>>>>> To fix https://glassfish.dev.java.net/issues/show_bug.cgi?id=13914 I need to change the admin/cli and admin/rest osgi.bundle files. Can someone confirm this is correct. The command runs as expected now at least.
>>>>>
>>>>>
>>>>> Index: cli/src/main/java/com/sun/enterprise/admin/cli/schemadoc/HtmlFormat.java
>>>>> ===================================================================
>>>>> --- cli/src/main/java/com/sun/enterprise/admin/cli/schemadoc/HtmlFormat.java (revision 41411)
>>>>> +++ cli/src/main/java/com/sun/enterprise/admin/cli/schemadoc/HtmlFormat.java (working copy)
>>>>> @@ -204,7 +204,6 @@
>>>>> InputStreamReader reader = null;
>>>>> PrintWriter writer = null;
>>>>> try {
>>>>> - System.out.println("HtmlFormat.copy: resource = " + resource);
>>>>> InputStream stream = getClass().getResourceAsStream(resource);
>>>>> reader = new InputStreamReader(stream);
>>>>> writer = new PrintWriter(new File(dir, resource));
>>>>> Index: cli/osgi.bundle
>>>>> ===================================================================
>>>>> --- cli/osgi.bundle (revision 41411)
>>>>> +++ cli/osgi.bundle (working copy)
>>>>> @@ -38,8 +38,12 @@
>>>>> # holder.
>>>>> #
>>>>>
>>>>> +DynamicImport-Package: \
>>>>> + org.glassfish.admin.rest
>>>>> +
>>>>> -exportcontents: \
>>>>> com.sun.enterprise.admin.cli; \
>>>>> com.sun.enterprise.admin.cli.remote; \
>>>>> com.sun.enterprise.admin.cli.schemadoc; \
>>>>> version=${project.osgi.version}
>>>>> +
>>>>> Index: rest/osgi.bundle
>>>>> ===================================================================
>>>>> --- rest/osgi.bundle (revision 41411)
>>>>> +++ rest/osgi.bundle (working copy)
>>>>> @@ -38,7 +38,8 @@
>>>>> # holder.
>>>>> #
>>>>>
>>>>> --exportcontents:
>>>>> +-exportcontents: \
>>>>> + org.glassfish.admin.rest
>>>>> DynamicImport-Package: \
>>>>> com.sun.jersey.api.container, \
>>>>> com.sun.jersey.api.core, \
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>> But what about the other possible configs that are defined in the valueadded packages? Are they also exported?
>>>> Any other way to access that via HK2 introspection?
>>>>
>>>> Ludo
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>