Hi,so I read the "Custom Configuration" in cxf/cdi1.1 and rather
inject UserService (dependent) into getSingletons, I guess is what's
needed.
/hw
fr., 23.03.2018 kl. 14.35 +0100, skrev Romain Manni-Bucau:
> 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 |  Blog | Old Blog | Github | LinkedIn | Book
> 
> 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
-- 
Helge Waastad
- The Undelstad Cup Champion 2017

Reply via email to