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 <[email protected]> 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 <[email protected]>: > >> 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 >> > >
