Hi,

Backstory: We migrated our whole application/custom Karaf distribution from 
Blueprint to Declarative Services, which went fine except some serious problems 
with getting our REST API to run.

The snippet below shows how we had wired the REST components using blueprint. 
This worked fine.

Now I want to do essentially the same using annotation based Declarative 
Services.

- How would I translate the below config to annotations on 
myResource/myOtherResource?
- Do I need DOSGI for that? If yes, then I have a problem 
https://issues.apache.org/jira/browse/DOSGI-253

Best regards,

Oliver

—————————

<blueprint <<<<snip>>>>>
   <bean id="exceptionMapper" class="mypackage.ServiceExceptionMapper" />

   <bean id="jsonProvider"
class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
   <bean id="multipartProvider"
class="org.apache.cxf.jaxrs.provider.MultipartProvider" />
   <bean id="originFilter" class="mypackage.ApiOriginFilter" />

   <bean id="swagger2Feature"
class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
       <<<snip>>>
   </bean>

   <cxf:bus>
       <cxf:inInterceptors>
           <bean
class="org.apache.cxf.transport.http.HttpAuthenticationFaultHandler">
               <property name="realm" value="karaf"/>
           </bean>
       </cxf:inInterceptors>
       <cxf:features>
           <cxf:logging />
           <bean
class="org.apache.cxf.interceptor.security.JAASAuthenticationFeature">
               <property name="contextName" value="karaf" />
               <property name="reportFault" value="true" />
           </bean>
       </cxf:features>
   </cxf:bus>

   <jaxrs:server id="MyService" address="/rest">
       <jaxrs:serviceBeans>
           <ref component-id="myResource" />
           <ref component-id="myOtherResource" />
       </jaxrs:serviceBeans>
       <jaxrs:providers>
           <ref component-id="jsonProvider" />
           <ref component-id="multipartProvider" />
           <ref component-id="originFilter" />
           <ref component-id="exceptionMapper" />
       </jaxrs:providers>
       <jaxrs:features>
           <ref component-id="swagger2Feature" />
       </jaxrs:features>
   </jaxrs:server>

</blueprint>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to