[cdi-dev] Clarification - how does addPackages work?
Martin Kouba
mkouba at redhat.com
Tue May 30 06:04:25 EDT 2017
Yes, except for the "default" keyword - it's an abstract class. So just
"public SeContainerInitializer addPackages(Class<?>... packageClasses)
{...}".
Dne 30.5.2017 v 11:57 John Ament napsal(a):
> If I had to guess, by default method you're thinking something like this:
>
>
> public default SeContainerInitializer addPackages(Class<?>...
> classes) {
> return addPackages(false, classes);
> }
>
>
>
>
> ------------------------------------------------------------------------
> *From:* Martin Kouba <mkouba at redhat.com>
> *Sent:* Tuesday, May 30, 2017 2:27 AM
> *To:* Matej Novotny
> *Cc:* John Ament; cdi-dev
> *Subject:* Re: [cdi-dev] Clarification - how does addPackages work?
> Dne 30.5.2017 v 08:25 Matej Novotny napsal(a):
>>> In fact, this method should probably have a default impl
>>
>> +1 for such default impl, that would make perfect sense.
>>
>>> Otherwise the wording seems accurate
>>
>> What wording? I glanced at spec/javadoc and it doesn't seem to mention whether it is by default recursive.
>
> Exactly. It's very clear that only classes from the packages of the
> specified classes will be added. Note that Java does not define anything
> like a "subpackage".
>
>>
>> Matej
>>
>> ----- Original Message -----
>>> From: "Martin Kouba" <mkouba at redhat.com>
>>> To: "Matej Novotny" <manovotn at redhat.com>, "John Ament" <john.ament at spartasystems.com>
>>> Cc: "cdi-dev" <cdi-dev at lists.jboss.org>
>>> Sent: Tuesday, May 30, 2017 7:33:50 AM
>>> Subject: Re: [cdi-dev] Clarification - how does addPackages work?
>>>
>>> In fact, this method should probably have a default impl calling
>>> addPackages(false, packageClasses). Otherwise the wording seems accurate
>>> to me.
>>>
>>> Martin
>>>
>>> Dne 29.5.2017 v 18:40 Matej Novotny napsal(a):
>>>> Hi John,
>>>>
>>>> I can confirm that Weld implements it exactly as you expect it.
>>>> E.g. Weld does NOT scan recursively by default.
>>>>
>>>> Matej
>>>>
>>>> ----- Original Message -----
>>>>> From: "John Ament" <john.ament at spartasystems.com>
>>>>> To: "cdi-dev" <cdi-dev at lists.jboss.org>
>>>>> Sent: Monday, May 29, 2017 5:17:16 PM
>>>>> Subject: [cdi-dev] Clarification - how does addPackages work?
>>>>>
>>>>>
>>>>>
>>>>> While porting the CDI spec to the geronimo project, I noticed that
>>>>> SeContainerInitializer#addPackages (without the boolean) doesn't specify
>>>>> whether its recursive or not. I believe its not recursive but wanted to
>>>>> confirm this. E.g. the behavior is the same as calling addPackages(false,
>>>>> Package....)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> John
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> NOTICE: This e-mail message and any attachments may contain confidential,
>>>>> proprietary, and/or privileged information which should be treated
>>>>> accordingly. If you are not the intended recipient, please notify the
>>>>> sender
>>>>> immediately by return e-mail, delete this message, and destroy all
>>>>> physical
>>>>> and electronic copies. Thank you.
>>>>>
>>>>> _______________________________________________
>>>>> cdi-dev mailing list
>>>>> cdi-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>>>>
>>>>> Note that for all code provided on this list, the provider licenses the
>>>>> code
>>>>> under the Apache License, Version 2
>>>>> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
>>>>> provided on this list, the provider waives all patent and other
>>>>> intellectual
>>>>> property rights inherent in such information.
>>>> _______________________________________________
>>>> cdi-dev mailing list
>>>> cdi-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/cdi-dev
>>>>
>>>> Note that for all code provided on this list, the provider licenses the
>>>> code under the Apache License, Version 2
>>>> (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
>>>> provided on this list, the provider waives all patent and other
>>>> intellectual property rights inherent in such information.
>>>>
>>>
>>> --
>>> Martin Kouba
>>> Senior Software Engineer
>>> Red Hat, Czech Republic
>>>
>
> --
> Martin Kouba
> Senior Software Engineer
> Red Hat, Czech Republic
> ------------------------------------------------------------------------
> NOTICE: This e-mail message and any attachments may contain
> confidential, proprietary, and/or privileged information which should be
> treated accordingly. If you are not the intended recipient, please
> notify the sender immediately by return e-mail, delete this message, and
> destroy all physical and electronic copies. Thank you.
--
Martin Kouba
Senior Software Engineer
Red Hat, Czech Republic
More information about the cdi-dev
mailing list