You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by Vicente Rossello <co...@gmail.com> on 2019/10/18 12:55:01 UTC

Excluding kotlin extensions from CDI

Hi,

I have noticed that Kotlin utility classes (MyClass$Companion,
MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
error but it makes startup slower.

What would be the easier way to exclude them? I think the only alternative
is to write an extension to Veto them? Exclude in beans.xml seems is not
enough

Thank you,
Vicente.

Re: Excluding kotlin extensions from CDI

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Oh yes, for tomee the config is different since owb is integratedas a lib
not inherited. Try to use scan.xml maybe to explicit list what classes you
want to scan.

Also user@tomee list will likely be more relevant for this.

Le ven. 18 oct. 2019 à 23:01, Vicente Rossello <co...@gmail.com> a
écrit :

> This seems valid for a CDI standalone application, but not in tomee. I
> guess this scan comes from tomee itself, I'm not sure if it's even possible
> to do that.
>
> On Fri, Oct 18, 2019 at 4:06 PM Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> Implement org.apache.xbean.finder.filter.Filter in a class, let's say
>> org.company.MyFilter and just add org.apache.xbean.finder.filter.Filter=com.company.MyFilter
>> in openwebbeans.properties file
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> <https://rmannibucau.metawerx.net/> | Old Blog
>> <http://rmannibucau.wordpress.com> | Github
>> <https://github.com/rmannibucau> | LinkedIn
>> <https://www.linkedin.com/in/rmannibucau> | Book
>> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>>
>>
>> Le ven. 18 oct. 2019 à 15:51, Vicente Rossello <co...@gmail.com>
>> a écrit :
>>
>>> That looks good, but I have no idea on how to start. I understand that I
>>> have to implement a org.apache.xbean.finder.filter.ClassFilter, but I
>>> have no clue on how to setup that in openwebbeans.properties , where can I
>>> look for documentation?
>>>
>>> Thanks.
>>>
>>> On Fri, Oct 18, 2019 at 3:07 PM Romain Manni-Bucau <
>>> rmannibucau@gmail.com> wrote:
>>>
>>>> Hi Vicente,
>>>>
>>>> An XBean-finder Filter can be configured in openwebbeans.properties and
>>>> can filter them based on the resource name.
>>>> I guess it will be likely the least portable but also the most
>>>> efficient solution.
>>>>
>>>> Romain Manni-Bucau
>>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>>>> <https://rmannibucau.metawerx.net/> | Old Blog
>>>> <http://rmannibucau.wordpress.com> | Github
>>>> <https://github.com/rmannibucau> | LinkedIn
>>>> <https://www.linkedin.com/in/rmannibucau> | Book
>>>> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>>>>
>>>>
>>>> Le ven. 18 oct. 2019 à 14:55, Vicente Rossello <co...@gmail.com>
>>>> a écrit :
>>>>
>>>>> Hi,
>>>>>
>>>>> I have noticed that Kotlin utility classes (MyClass$Companion,
>>>>> MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
>>>>> error but it makes startup slower.
>>>>>
>>>>> What would be the easier way to exclude them? I think the only
>>>>> alternative is to write an extension to Veto them? Exclude in beans.xml
>>>>> seems is not enough
>>>>>
>>>>> Thank you,
>>>>> Vicente.
>>>>>
>>>>

Re: Excluding kotlin extensions from CDI

Posted by Vicente Rossello <co...@gmail.com>.
This seems valid for a CDI standalone application, but not in tomee. I
guess this scan comes from tomee itself, I'm not sure if it's even possible
to do that.

On Fri, Oct 18, 2019 at 4:06 PM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Implement org.apache.xbean.finder.filter.Filter in a class, let's say
> org.company.MyFilter and just add org.apache.xbean.finder.filter.Filter=com.company.MyFilter
> in openwebbeans.properties file
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>
>
> Le ven. 18 oct. 2019 à 15:51, Vicente Rossello <co...@gmail.com> a
> écrit :
>
>> That looks good, but I have no idea on how to start. I understand that I
>> have to implement a org.apache.xbean.finder.filter.ClassFilter, but I
>> have no clue on how to setup that in openwebbeans.properties , where can I
>> look for documentation?
>>
>> Thanks.
>>
>> On Fri, Oct 18, 2019 at 3:07 PM Romain Manni-Bucau <rm...@gmail.com>
>> wrote:
>>
>>> Hi Vicente,
>>>
>>> An XBean-finder Filter can be configured in openwebbeans.properties and
>>> can filter them based on the resource name.
>>> I guess it will be likely the least portable but also the most efficient
>>> solution.
>>>
>>> Romain Manni-Bucau
>>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>>> <https://rmannibucau.metawerx.net/> | Old Blog
>>> <http://rmannibucau.wordpress.com> | Github
>>> <https://github.com/rmannibucau> | LinkedIn
>>> <https://www.linkedin.com/in/rmannibucau> | Book
>>> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>>>
>>>
>>> Le ven. 18 oct. 2019 à 14:55, Vicente Rossello <co...@gmail.com>
>>> a écrit :
>>>
>>>> Hi,
>>>>
>>>> I have noticed that Kotlin utility classes (MyClass$Companion,
>>>> MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
>>>> error but it makes startup slower.
>>>>
>>>> What would be the easier way to exclude them? I think the only
>>>> alternative is to write an extension to Veto them? Exclude in beans.xml
>>>> seems is not enough
>>>>
>>>> Thank you,
>>>> Vicente.
>>>>
>>>

Re: Excluding kotlin extensions from CDI

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Implement org.apache.xbean.finder.filter.Filter in a class, let's say
org.company.MyFilter and just add
org.apache.xbean.finder.filter.Filter=com.company.MyFilter
in openwebbeans.properties file

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 18 oct. 2019 à 15:51, Vicente Rossello <co...@gmail.com> a
écrit :

> That looks good, but I have no idea on how to start. I understand that I
> have to implement a org.apache.xbean.finder.filter.ClassFilter, but I
> have no clue on how to setup that in openwebbeans.properties , where can I
> look for documentation?
>
> Thanks.
>
> On Fri, Oct 18, 2019 at 3:07 PM Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
>> Hi Vicente,
>>
>> An XBean-finder Filter can be configured in openwebbeans.properties and
>> can filter them based on the resource name.
>> I guess it will be likely the least portable but also the most efficient
>> solution.
>>
>> Romain Manni-Bucau
>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
>> <https://rmannibucau.metawerx.net/> | Old Blog
>> <http://rmannibucau.wordpress.com> | Github
>> <https://github.com/rmannibucau> | LinkedIn
>> <https://www.linkedin.com/in/rmannibucau> | Book
>> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>>
>>
>> Le ven. 18 oct. 2019 à 14:55, Vicente Rossello <co...@gmail.com>
>> a écrit :
>>
>>> Hi,
>>>
>>> I have noticed that Kotlin utility classes (MyClass$Companion,
>>> MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
>>> error but it makes startup slower.
>>>
>>> What would be the easier way to exclude them? I think the only
>>> alternative is to write an extension to Veto them? Exclude in beans.xml
>>> seems is not enough
>>>
>>> Thank you,
>>> Vicente.
>>>
>>

Re: Excluding kotlin extensions from CDI

Posted by Vicente Rossello <co...@gmail.com>.
That looks good, but I have no idea on how to start. I understand that I
have to implement a org.apache.xbean.finder.filter.ClassFilter, but I have
no clue on how to setup that in openwebbeans.properties , where can I look
for documentation?

Thanks.

On Fri, Oct 18, 2019 at 3:07 PM Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi Vicente,
>
> An XBean-finder Filter can be configured in openwebbeans.properties and
> can filter them based on the resource name.
> I guess it will be likely the least portable but also the most efficient
> solution.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github
> <https://github.com/rmannibucau> | LinkedIn
> <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
>
>
> Le ven. 18 oct. 2019 à 14:55, Vicente Rossello <co...@gmail.com> a
> écrit :
>
>> Hi,
>>
>> I have noticed that Kotlin utility classes (MyClass$Companion,
>> MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
>> error but it makes startup slower.
>>
>> What would be the easier way to exclude them? I think the only
>> alternative is to write an extension to Veto them? Exclude in beans.xml
>> seems is not enough
>>
>> Thank you,
>> Vicente.
>>
>

Re: Excluding kotlin extensions from CDI

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Vicente,

An XBean-finder Filter can be configured in openwebbeans.properties and can
filter them based on the resource name.
I guess it will be likely the least portable but also the most efficient
solution.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 18 oct. 2019 à 14:55, Vicente Rossello <co...@gmail.com> a
écrit :

> Hi,
>
> I have noticed that Kotlin utility classes (MyClass$Companion,
> MyClass$WhenMappings, etc.) are being scanned by openwebbeans, there is no
> error but it makes startup slower.
>
> What would be the easier way to exclude them? I think the only alternative
> is to write an extension to Veto them? Exclude in beans.xml seems is not
> enough
>
> Thank you,
> Vicente.
>