openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John D. Ament" <johndam...@apache.org>
Subject Re: Meecrowave and singletons
Date Fri, 23 Mar 2018 13:42:53 GMT
So the idea here would be to not look up a CDI bean for a resource if its
declared in the singletons?  That would be a pretty straight forward change
in CXF.

John

On Fri, Mar 23, 2018 at 9:35 AM Romain Manni-Bucau <rmannibucau@gmail.com>
wrote:

> Hi,
>
> yes in org.apache.cxf.cdi.JAXRSCdiResourceExtension#load
> and org.apache.cxf.jaxrs.utils.ResourceUtils#createApplication. You should
> probably always return the same instance of singletons since
> getSingletons/getClasses *can* be called N times.
>
>
> 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>
>
> 2018-03-23 12:31 GMT+01:00 Helge Waastad <helge@waastad.org>:
>
>> Hi,
>> Just trying to figure out a couple of things with meecrowave.
>>
>> ex:
>> rootresource has:
>> @Override
>>    public Set<Object> getSingletons() {
>>       return Stream.of(new UserService()).collect(Collectors.toSet());
>>    }
>>
>> @Path("users")
>> public class UserService {
>>  @GET
>>    public Response get() {
>> ....return somthing..
>> }
>> }
>>
>> in tomee 7 it will contruct the UserService once.
>> In meecrowave twice...
>>
>> /hw
>>
>> --
>>
>> Helge Waastad
>> - The Undelstad Cup Champion 2017
>>
>
>

Mime
View raw message