Well, it turned out that the obvious worked -- I just called up a JAXRSServiceFactory inside a DS activator method, and it did the right thing.
Meanwhile, David Jencks encouraged me to think about a cleaner solution in CXF, but i need to realistically have enough time to before I bother you with it. On Tue, Sep 8, 2015 at 5:16 AM, Sergey Beryozkin <[email protected]> wrote: > Sure, Dan, Christian, they can help, > > Just one point is that the code below is unlikely to bind to OSGI HTTP > Service, in CXF Blueprint we have a default NonSpring CXFServlet registered > with HttpService and then individual endpoints loaded from Blueprint > contexts registering the destinations with DestinationRegistry created at a > time the default CXFServlet is loaded. > > I know it is not DOSGI but this code might also help: > > https://github.com/apache/cxf-dosgi/blob/master/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java#L73 > > I think you might need to go that route too (create a servlet - > CXFNonSpringJaxrsServlet may be - that can be initilized with JAX-RS > Application instances which can hold resource class and provider instances, > then get HTTPService - via a tracker or directly from the bundle context, > and set that servlet on the service). > > Lets see what others say too > > Cheers, Sergey > > > > On 07/09/15 18:19, Benson Margulies wrote: >> >> On Mon, Sep 7, 2015 at 8:54 AM, Sergey Beryozkin <[email protected]> >> wrote: >>> >>> Have a look at HttpTransportActivator in rt/transports/http >> >> >> I think I'm going to need more help here from people celebrating the >> holiday :-) >> >> I wrote: >> >> JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); >> sf.setServiceBean(this); >> sf.setAddress("/worker"); >> server = sf.create(); >> >> in the activation method of a DS component. >> >> but this does not succeed in getting the the same result as a JAX-RS >> blueprint bean. >> >> I will continue to try to figure it out after I go be somewhat >> holidaisical myself for a bit. >> >> >> >>> >>> Sergey >>> On 07/09/15 13:43, Benson Margulies wrote: >>>> >>>> >>>> No, not dosgi. >>>> >>>> I think this is a simple question, actually. >>>> >>>> Here's what is going on: When in OSGi, CXF publishes its servlet to >>>> the whiteboard. Then, the CXF blueprint beans register services as >>>> usual. >>>> >>>> I'm guessing that CXF plugs into the whiteboard in the OSGi >>>> environment whether or not anyone ever uses a CXF blueprint bean, but >>>> I was hoping for confirmation. >>>> >>>> >>>> >>>> On Mon, Sep 7, 2015 at 5:39 AM, Sergey Beryozkin <[email protected]> >>>> wrote: >>>>> >>>>> >>>>> Hi Benson >>>>> >>>>> I honestly do not know. >>>>> Is DS similar to Distributed OSGI ? >>>>> Actually, I see: >>>>> >>>>> https://github.com/apache/cxf-dosgi/tree/master/samples/ds >>>>> >>>>> >>>>> https://github.com/apache/cxf-dosgi/blob/master/samples/ds/impl/src/main/resources/OSGI-INF/component.xml >>>>> >>>>> I wonder if DOSGI is needed for a CXF endpoint be set up from a DS >>>>> context ? >>>>> I'm not sure if other alternatives are available, i.e, can that be >>>>> easily >>>>> supported if needed with some Activator, etc. Perhaps a plan to use a >>>>> factory directly will work best without having to use DOSGI unless one >>>>> prefers use DOSGI. >>>>> >>>>> Does DS has some annotations ? If some we'd probably be able to have >>>>> some >>>>> support similar to Spring @Bean, etc support we have... >>>>> >>>>> Cheers, Sergey >>>>> >>>>> >>>>> On 07/09/15 00:35, Benson Margulies wrote: >>>>>> >>>>>> >>>>>> >>>>>> I'm thinking of trying an experiment with declarative services. >>>>>> >>>>>> If I just call the plain old factory API to create a JAX-RS service, >>>>>> will it plug into the whiteboard without a fuss, or is there something >>>>>> that the blueprint stuff does that I need to attend to? >>>>>> >>>>> >>>>> >>> >>> >>> -- >>> Sergey Beryozkin >>> >>> Talend Community Coders >>> http://coders.talend.com/ > > > > -- > Sergey Beryozkin > > Talend Community Coders > http://coders.talend.com/
