openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Meecrowave and singletons
Date Fri, 23 Mar 2018 13:35:05 GMT
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