You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by pbielicki <pb...@gmail.com> on 2013/12/09 15:05:34 UTC

Spring integration using @Configuration & @ComponentScan annotations

Hi,

in order to integrate CXF with Spring developers need to go through an XML
file, right (i.e.
http://cxf.apache.org/docs/writing-a-service-with-spring.html)?

Is it possible out-of-the box to integrate CXF with Spring using
annotation-driven context configuration? I am talking about
@org.springframework.context.annotation.Configuration and
@org.springframework.context.annotation.ComponentScan annotations
(http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html). 
Are they supported by CXF integration?

The goal is to avoid any XML configuration.

If it's not part of CXF I may help because I just implemented such
integration (few lines of code, really), and I find it pretty useful.

Please let me know what you think? I wanted to open a JIRA issue straight
away but I prefer to ask you before.

Cheers,
Przemyslaw Bielicki



--
View this message in context: http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemysław Bielicki <pb...@gmail.com>.
sure, no problem - I will file a jira issue and attach my changes as the
code is not public


On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
ml-node+s547215n5737562h75@n5.nabble.com> wrote:

> We have some factory classes but they are often not as convenient to use
> as the namespaces.
>
> In any case it would be interesting to see what you did. Can you open a
> jira and attach your code as a patch?
> If it is just a few lines you can also just paste the code or point to a
> github repo or similar.
>
> Christian
>
> On 09.12.2013 15:05, pbielicki wrote:
>
> > Hi,
> >
> > in order to integrate CXF with Spring developers need to go through an
> XML
> > file, right (i.e.
> > http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >
> > Is it possible out-of-the box to integrate CXF with Spring using
> > annotation-driven context configuration? I am talking about
> > @org.springframework.context.annotation.Configuration and
> > @org.springframework.context.annotation.ComponentScan annotations
> > (
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> > Are they supported by CXF integration?
> >
> > The goal is to avoid any XML configuration.
> >
> > If it's not part of CXF I may help because I just implemented such
> > integration (few lines of code, really), and I find it pretty useful.
> >
> > Please let me know what you think? I wanted to open a JIRA issue
> straight
> > away but I prefer to ask you before.
> >
> > Cheers,
> > Przemyslaw Bielicki
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> > Sent from the cxf-dev mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemyslaw Bielicki <pb...@gmail.com>.
I experimented a bit, checked few options and finally made it. That's the
final solution that works nicely and can be done in
BeanFactoryPostProcessor:

import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.jaxws.JAXWSMethodInvoker;
import org.apache.cxf.service.invoker.SpringBeanFactory;

//...

        Bus bus = beanFactory.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
        EndpointImpl endpoint = new EndpointImpl(bus, null);
        endpoint.setImplementorClass(beanClass);
        endpoint.setInvoker(new JAXWSMethodInvoker(new
SpringBeanFactory(beanName)));

This way the service is never instantiated if not called. Every time the
service is called SpringBeanFactory retrieves a service object from Spring
context - which is what we want in Spring integration.

Thanks for you inputs!

Cheers,
Przemyslaw



On Tue, Jan 21, 2014 at 9:09 PM, Daniel Kulp [via CXF] <
ml-node+s547215n5738935h38@n5.nabble.com> wrote:

>
> What happens if you pass “null” in for the implementor bean?   Looking at
> the code, that LOOKS like it should work as there are “if (implementor ==
> null)” type checks all over the place.   Maybe we’re missing one someplace.
>
> That said, normally we would suggest using the JaxWsServerFactoryBean
> instead of creating an EndpointImpl unless you really need the EndpointImpl
> object for some reason.
>
> Dan
>
>
>
> On Jan 21, 2014, at 5:20 AM, Przemysław Bielicki <[hidden email]<http://user/SendEmail.jtp?type=node&node=5738935&i=0>>
> wrote:
>
> > Hi Guys,
> >
> > I need your help. I moved along with my Spring integration and the code
> I
> > showed you works fine but only for Spring beans that are Singletons
> > (because they are eagerly created by Spring during the initialization).
> >
> > The problem starts when we have @WebService classes that are stateful
> (in a
> > sense that they are of "prototype" scope). It means that Spring does not
> > instantiates then automatically - only on demand. That's why  usage of
> > BeanPostProcessor is not possible. I have to use
> BeanFactoryPostProcessor.
> > So far, so good. What do I do? I do almost the same thing as before:
> >
> >  public void postProcessBeanFactory(ConfigurableListableBeanFactory
> > beanFactory) throws BeansException {
> >    for (String beanName : beanFactory.getBeanDefinitionNames()) {
> >      BeanDefinition beanDefinition =
> > beanFactory.getBeanDefinition(beanName);
> >
> >     // ... details
> >
> >      if (isWebService(beanClass)) {
> >        Bus bus = beanFactory.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
> >        EndpointImpl endpoint = new EndpointImpl(bus,
> > *beanFactory.getBean(beanName)*, new SpringServerFactoryBean(beanName));
> >        endpoint.setAddress(blahblah);
> >        endpoint.getInInterceptors().addAll(blahblah);
> >        endpoint.getOutInterceptors().addAll(blahblah);
> >        bus.setExtension(blahblah);
> >        endpoint.publish();
> >    }
> >
> > But now I have to tell CXF how to obtain an instance of the service when
> > there is a client call. I do it passing SpringServerFactoryBean that
> knows
> > how to get the service object from Spring context.
> > SpringServerFactoryBean is my own simple class that instantiates web
> > service object on demand:
> >
> > import org.apache.cxf.jaxws.JAXWSMethodInvoker;
> > import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
> > import org.apache.cxf.service.invoker.Invoker;
> > import org.apache.cxf.service.invoker.SpringBeanFactory;
> >
> > public class SpringServerFactoryBean extends JaxWsServerFactoryBean {
> >
> >  private final String beanName;
> >
> >  public SpringServerFactoryBean(String beanName) {
> >    this.beanName = beanName;
> >  }
> >
> >  @Override
> >  protected Invoker createInvoker() {
> >    return new JAXWSMethodInvoker(new SpringBeanFactory(beanName));
> >  }
> > }
> >
> > It would fly and work nicely but there is one big issue with
> > org.apache.cxf.jaxws.EndpointImpl.
> > Why does it need an implementor object? To publish the service you don't
> > need the implementation instance - you need just a class metadata to
> check
> > what methods are public, what are their parameters, etc. This is big
> issue
> > because in BeanFactoryPostProcessor you are allowed to call
> > *beanFactory.getBean(beanName).
> > *
> >
> > Is it possible to modify or extend EndpointImpl so that it does not need
> > the implementor? It is able to get the implementor later (when it's
> really
> > needed) using JaxWsServerFactoryBean.
> >
> > I'm not sure my problem is clear enough. If not I'm eager to explain in
> > details.
> >
> > Best regards,
> > Przemyslaw
> >
> >
> > On Mon, Dec 9, 2013 at 4:50 PM, Przemysław Bielicki <[hidden email]<http://user/SendEmail.jtp?type=node&node=5738935&i=1>>wrote:
>
> >
> >> I just created a jira issue:
> >> https://issues.apache.org/jira/browse/CXF-5448
> >>
> >> I hope it's clear.
> >>
> >> Cheers,
> >> Przemyslaw
> >>
> >>
> >> On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=5738935&i=2>>
> wrote:
> >>
> >>> We have some factory classes but they are often not as convenient to
> use
> >>> as the namespaces.
> >>>
> >>> In any case it would be interesting to see what you did. Can you open
> a
> >>> jira and attach your code as a patch?
> >>> If it is just a few lines you can also just paste the code or point to
> a
> >>> github repo or similar.
> >>>
> >>> Christian
> >>>
> >>> On 09.12.2013 15:05, pbielicki wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> in order to integrate CXF with Spring developers need to go through
> an
> >>> XML
> >>>> file, right (i.e.
> >>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >>>>
> >>>> Is it possible out-of-the box to integrate CXF with Spring using
> >>>> annotation-driven context configuration? I am talking about
> >>>> @org.springframework.context.annotation.Configuration and
> >>>> @org.springframework.context.annotation.ComponentScan annotations
> >>>> (
> >>>
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> >>>
> >>>> Are they supported by CXF integration?
> >>>>
> >>>> The goal is to avoid any XML configuration.
> >>>>
> >>>> If it's not part of CXF I may help because I just implemented such
> >>>> integration (few lines of code, really), and I find it pretty useful.
> >>>>
> >>>> Please let me know what you think? I wanted to open a JIRA issue
> >>> straight
> >>>> away but I prefer to ask you before.
> >>>>
> >>>> Cheers,
> >>>> Przemyslaw Bielicki
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> >>>> Sent from the cxf-dev mailing list archive at Nabble.com.
> >>>
> >>>
> >>> --
> >>> Christian Schneider
> >>> http://www.liquid-reality.de
> >>>
> >>> Open Source Architect
> >>> http://www.talend.com
> >>>
> >>>
> >>>
> >>> ------------------------------
> >>> If you reply to this email, your message will be added to the
> >>> discussion below:
> >>>
> >>>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
> >>> To unsubscribe from Spring integration using @Configuration &
> >>> @ComponentScan annotations, click here<
>
> >>> .
> >>> NAML<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>>
> >>
> >>
>
> --
> Daniel Kulp
> [hidden email] <http://user/SendEmail.jtp?type=node&node=5738935&i=3> -
> http://dankulp.com/blog
>
> Talend Community Coder - http://coders.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5738935.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5738945.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Daniel Kulp <dk...@apache.org>.
What happens if you pass “null” in for the implementor bean?   Looking at the code, that LOOKS like it should work as there are “if (implementor == null)” type checks all over the place.   Maybe we’re missing one someplace.

That said, normally we would suggest using the JaxWsServerFactoryBean instead of creating an EndpointImpl unless you really need the EndpointImpl object for some reason.

Dan



On Jan 21, 2014, at 5:20 AM, Przemysław Bielicki <pb...@gmail.com> wrote:

> Hi Guys,
> 
> I need your help. I moved along with my Spring integration and the code I
> showed you works fine but only for Spring beans that are Singletons
> (because they are eagerly created by Spring during the initialization).
> 
> The problem starts when we have @WebService classes that are stateful (in a
> sense that they are of "prototype" scope). It means that Spring does not
> instantiates then automatically - only on demand. That's why  usage of
> BeanPostProcessor is not possible. I have to use BeanFactoryPostProcessor.
> So far, so good. What do I do? I do almost the same thing as before:
> 
>  public void postProcessBeanFactory(ConfigurableListableBeanFactory
> beanFactory) throws BeansException {
>    for (String beanName : beanFactory.getBeanDefinitionNames()) {
>      BeanDefinition beanDefinition =
> beanFactory.getBeanDefinition(beanName);
> 
>     // ... details
> 
>      if (isWebService(beanClass)) {
>        Bus bus = beanFactory.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
>        EndpointImpl endpoint = new EndpointImpl(bus,
> *beanFactory.getBean(beanName)*, new SpringServerFactoryBean(beanName));
>        endpoint.setAddress(blahblah);
>        endpoint.getInInterceptors().addAll(blahblah);
>        endpoint.getOutInterceptors().addAll(blahblah);
>        bus.setExtension(blahblah);
>        endpoint.publish();
>    }
> 
> But now I have to tell CXF how to obtain an instance of the service when
> there is a client call. I do it passing SpringServerFactoryBean that knows
> how to get the service object from Spring context.
> SpringServerFactoryBean is my own simple class that instantiates web
> service object on demand:
> 
> import org.apache.cxf.jaxws.JAXWSMethodInvoker;
> import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
> import org.apache.cxf.service.invoker.Invoker;
> import org.apache.cxf.service.invoker.SpringBeanFactory;
> 
> public class SpringServerFactoryBean extends JaxWsServerFactoryBean {
> 
>  private final String beanName;
> 
>  public SpringServerFactoryBean(String beanName) {
>    this.beanName = beanName;
>  }
> 
>  @Override
>  protected Invoker createInvoker() {
>    return new JAXWSMethodInvoker(new SpringBeanFactory(beanName));
>  }
> }
> 
> It would fly and work nicely but there is one big issue with
> org.apache.cxf.jaxws.EndpointImpl.
> Why does it need an implementor object? To publish the service you don't
> need the implementation instance - you need just a class metadata to check
> what methods are public, what are their parameters, etc. This is big issue
> because in BeanFactoryPostProcessor you are allowed to call
> *beanFactory.getBean(beanName).
> *
> 
> Is it possible to modify or extend EndpointImpl so that it does not need
> the implementor? It is able to get the implementor later (when it's really
> needed) using JaxWsServerFactoryBean.
> 
> I'm not sure my problem is clear enough. If not I'm eager to explain in
> details.
> 
> Best regards,
> Przemyslaw
> 
> 
> On Mon, Dec 9, 2013 at 4:50 PM, Przemysław Bielicki <pb...@gmail.com>wrote:
> 
>> I just created a jira issue:
>> https://issues.apache.org/jira/browse/CXF-5448
>> 
>> I hope it's clear.
>> 
>> Cheers,
>> Przemyslaw
>> 
>> 
>> On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
>> ml-node+s547215n5737562h75@n5.nabble.com> wrote:
>> 
>>> We have some factory classes but they are often not as convenient to use
>>> as the namespaces.
>>> 
>>> In any case it would be interesting to see what you did. Can you open a
>>> jira and attach your code as a patch?
>>> If it is just a few lines you can also just paste the code or point to a
>>> github repo or similar.
>>> 
>>> Christian
>>> 
>>> On 09.12.2013 15:05, pbielicki wrote:
>>> 
>>>> Hi,
>>>> 
>>>> in order to integrate CXF with Spring developers need to go through an
>>> XML
>>>> file, right (i.e.
>>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>>> 
>>>> Is it possible out-of-the box to integrate CXF with Spring using
>>>> annotation-driven context configuration? I am talking about
>>>> @org.springframework.context.annotation.Configuration and
>>>> @org.springframework.context.annotation.ComponentScan annotations
>>>> (
>>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>> 
>>>> Are they supported by CXF integration?
>>>> 
>>>> The goal is to avoid any XML configuration.
>>>> 
>>>> If it's not part of CXF I may help because I just implemented such
>>>> integration (few lines of code, really), and I find it pretty useful.
>>>> 
>>>> Please let me know what you think? I wanted to open a JIRA issue
>>> straight
>>>> away but I prefer to ask you before.
>>>> 
>>>> Cheers,
>>>> Przemyslaw Bielicki
>>>> 
>>>> 
>>>> 
>>>> --
>>>> View this message in context:
>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>> 
>>> 
>>> --
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>> 
>>> Open Source Architect
>>> http://www.talend.com
>>> 
>>> 
>>> 
>>> ------------------------------
>>> If you reply to this email, your message will be added to the
>>> discussion below:
>>> 
>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
>>> To unsubscribe from Spring integration using @Configuration &
>>> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>>> .
>>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>> 
>> 
>> 

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemysław Bielicki <pb...@gmail.com>.
Hi Guys,

I need your help. I moved along with my Spring integration and the code I
showed you works fine but only for Spring beans that are Singletons
(because they are eagerly created by Spring during the initialization).

The problem starts when we have @WebService classes that are stateful (in a
sense that they are of "prototype" scope). It means that Spring does not
instantiates then automatically - only on demand. That's why  usage of
BeanPostProcessor is not possible. I have to use BeanFactoryPostProcessor.
So far, so good. What do I do? I do almost the same thing as before:

  public void postProcessBeanFactory(ConfigurableListableBeanFactory
beanFactory) throws BeansException {
    for (String beanName : beanFactory.getBeanDefinitionNames()) {
      BeanDefinition beanDefinition =
beanFactory.getBeanDefinition(beanName);

     // ... details

      if (isWebService(beanClass)) {
        Bus bus = beanFactory.getBean(Bus.DEFAULT_BUS_ID, Bus.class);
        EndpointImpl endpoint = new EndpointImpl(bus,
*beanFactory.getBean(beanName)*, new SpringServerFactoryBean(beanName));
        endpoint.setAddress(blahblah);
        endpoint.getInInterceptors().addAll(blahblah);
        endpoint.getOutInterceptors().addAll(blahblah);
        bus.setExtension(blahblah);
        endpoint.publish();
    }

But now I have to tell CXF how to obtain an instance of the service when
there is a client call. I do it passing SpringServerFactoryBean that knows
how to get the service object from Spring context.
SpringServerFactoryBean is my own simple class that instantiates web
service object on demand:

import org.apache.cxf.jaxws.JAXWSMethodInvoker;
import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.service.invoker.Invoker;
import org.apache.cxf.service.invoker.SpringBeanFactory;

public class SpringServerFactoryBean extends JaxWsServerFactoryBean {

  private final String beanName;

  public SpringServerFactoryBean(String beanName) {
    this.beanName = beanName;
  }

  @Override
  protected Invoker createInvoker() {
    return new JAXWSMethodInvoker(new SpringBeanFactory(beanName));
  }
}

It would fly and work nicely but there is one big issue with
org.apache.cxf.jaxws.EndpointImpl.
Why does it need an implementor object? To publish the service you don't
need the implementation instance - you need just a class metadata to check
what methods are public, what are their parameters, etc. This is big issue
because in BeanFactoryPostProcessor you are allowed to call
*beanFactory.getBean(beanName).
*

Is it possible to modify or extend EndpointImpl so that it does not need
the implementor? It is able to get the implementor later (when it's really
needed) using JaxWsServerFactoryBean.

I'm not sure my problem is clear enough. If not I'm eager to explain in
details.

Best regards,
Przemyslaw


On Mon, Dec 9, 2013 at 4:50 PM, Przemysław Bielicki <pb...@gmail.com>wrote:

> I just created a jira issue:
> https://issues.apache.org/jira/browse/CXF-5448
>
> I hope it's clear.
>
> Cheers,
> Przemyslaw
>
>
> On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
> ml-node+s547215n5737562h75@n5.nabble.com> wrote:
>
>> We have some factory classes but they are often not as convenient to use
>> as the namespaces.
>>
>> In any case it would be interesting to see what you did. Can you open a
>> jira and attach your code as a patch?
>> If it is just a few lines you can also just paste the code or point to a
>> github repo or similar.
>>
>> Christian
>>
>> On 09.12.2013 15:05, pbielicki wrote:
>>
>> > Hi,
>> >
>> > in order to integrate CXF with Spring developers need to go through an
>> XML
>> > file, right (i.e.
>> > http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>> >
>> > Is it possible out-of-the box to integrate CXF with Spring using
>> > annotation-driven context configuration? I am talking about
>> > @org.springframework.context.annotation.Configuration and
>> > @org.springframework.context.annotation.ComponentScan annotations
>> > (
>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>
>> > Are they supported by CXF integration?
>> >
>> > The goal is to avoid any XML configuration.
>> >
>> > If it's not part of CXF I may help because I just implemented such
>> > integration (few lines of code, really), and I find it pretty useful.
>> >
>> > Please let me know what you think? I wanted to open a JIRA issue
>> straight
>> > away but I prefer to ask you before.
>> >
>> > Cheers,
>> > Przemyslaw Bielicki
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>> > Sent from the cxf-dev mailing list archive at Nabble.com.
>>
>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
>>  To unsubscribe from Spring integration using @Configuration &
>> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemysław Bielicki <pb...@gmail.com>.
I just created a jira issue: https://issues.apache.org/jira/browse/CXF-5448

I hope it's clear.

Cheers,
Przemyslaw


On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
ml-node+s547215n5737562h75@n5.nabble.com> wrote:

> We have some factory classes but they are often not as convenient to use
> as the namespaces.
>
> In any case it would be interesting to see what you did. Can you open a
> jira and attach your code as a patch?
> If it is just a few lines you can also just paste the code or point to a
> github repo or similar.
>
> Christian
>
> On 09.12.2013 15:05, pbielicki wrote:
>
> > Hi,
> >
> > in order to integrate CXF with Spring developers need to go through an
> XML
> > file, right (i.e.
> > http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >
> > Is it possible out-of-the box to integrate CXF with Spring using
> > annotation-driven context configuration? I am talking about
> > @org.springframework.context.annotation.Configuration and
> > @org.springframework.context.annotation.ComponentScan annotations
> > (
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> > Are they supported by CXF integration?
> >
> > The goal is to avoid any XML configuration.
> >
> > If it's not part of CXF I may help because I just implemented such
> > integration (few lines of code, really), and I find it pretty useful.
> >
> > Please let me know what you think? I wanted to open a JIRA issue
> straight
> > away but I prefer to ask you before.
> >
> > Cheers,
> > Przemyslaw Bielicki
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> > Sent from the cxf-dev mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemyslaw Bielicki <pb...@gmail.com>.
sure, no problem - I will file a jira issue and attach my changes as the
code is not public


On Mon, Dec 9, 2013 at 3:14 PM, cschneider [via CXF] <
ml-node+s547215n5737562h75@n5.nabble.com> wrote:

> We have some factory classes but they are often not as convenient to use
> as the namespaces.
>
> In any case it would be interesting to see what you did. Can you open a
> jira and attach your code as a patch?
> If it is just a few lines you can also just paste the code or point to a
> github repo or similar.
>
> Christian
>
> On 09.12.2013 15:05, pbielicki wrote:
>
> > Hi,
> >
> > in order to integrate CXF with Spring developers need to go through an
> XML
> > file, right (i.e.
> > http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >
> > Is it possible out-of-the box to integrate CXF with Spring using
> > annotation-driven context configuration? I am talking about
> > @org.springframework.context.annotation.Configuration and
> > @org.springframework.context.annotation.ComponentScan annotations
> > (
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> > Are they supported by CXF integration?
> >
> > The goal is to avoid any XML configuration.
> >
> > If it's not part of CXF I may help because I just implemented such
> > integration (few lines of code, really), and I find it pretty useful.
> >
> > Please let me know what you think? I wanted to open a JIRA issue
> straight
> > away but I prefer to ask you before.
> >
> > Cheers,
> > Przemyslaw Bielicki
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> > Sent from the cxf-dev mailing list archive at Nabble.com.
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737562.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737563.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Christian Schneider <ch...@die-schneider.net>.
I was mainly talking about the javax.inject.Inject annotation. It is 
evaluated by CDI frameworks like openwebbeans (see: 
http://openwebbeans.apache.org/cdi_explained.html ).

So if CXF and openwebbeans evaluate the injection we might easily get 
into trouble.
If a user works with CDI he will have some CXF related beans as well as 
non cxf related beans. Probably he will expect that the injections work 
in both cases.

I know we are currently implementing annotation processing for some 
annotations in cxf itself. I am not sure if this is a good idea. I think 
it would be better to leave this to the users injection framework.

Christian


On 09.12.2013 15:37, Przemysław Bielicki wrote:
> Christian, what is CDI for you?
> You mean javax.inject (fully supported by Spring) or
> javax.enterprise.inject (supported by Java EE containers)
>
>
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Christian Schneider <ch...@die-schneider.net>.
I think the problem here is that CXF allows to run in very many 
environments. For users this is very nice but it creates a lot of 
complexity in CXF. Of course annotation processing is just a few lines 
of code for each case. The problem is though that this code is scattered 
throughout the whole cxf code.

This is of course only my personal opinion. We currently already support 
a lot of annotations. So adding the ones you planned to add does not 
really make things worse. I just think we should perhaps discuss to 
aproach this differently for cxf 3 or cxf 4.

In any case I think it is better to define our own annotations if we 
plan to parse them ourselfves.

Christian

On 09.12.2013 16:00, Sergey Beryozkin wrote:
> Hi Christian
>
> Sure, let the external frameworks do what they can do well.
> What I've found though over the years is that the users which do not 
> want to depend on those external frameworks miss on the features which 
> can easily be done without those external dependencies.
>
> For example, I'd like to have CXF interceptors easily discovered 
> within Blueprint deployments. It is not that important for JAX-RS 
> endpoints for example, CXF interceptors are not part of JAX-RS model, 
> but nice to have for the completeness.
>
> To be honest, it is always good to keep multiple options open. Some 
> CXF users work with Spring, some now with CDI, some with Blueprint and 
> some do not use the injections frameworks, and I'd like to have a code 
> in place that would would work with or without Spring for discovering 
> simple interceptors & features.
>
> For me, addressing CXF-5439 is about few lines of code. I don't mind 
> if it won't be considered a standard approach, because using a 
> standard approach (Named, etc) to create non-portable deployments (CXF 
> interceptors will obviously won't work without CXF) is not exactly a 
> standard approach in the end
>
> Sergey

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Christian

Sure, let the external frameworks do what they can do well.
What I've found though over the years is that the users which do not 
want to depend on those external frameworks miss on the features which 
can easily be done without those external dependencies.

For example, I'd like to have CXF interceptors easily discovered within 
Blueprint deployments. It is not that important for JAX-RS endpoints for 
example, CXF interceptors are not part of JAX-RS model, but nice to have 
for the completeness.

To be honest, it is always good to keep multiple options open. Some CXF 
users work with Spring, some now with CDI, some with Blueprint and some 
do not use the injections frameworks, and I'd like to have a code in 
place that would would work with or without Spring for discovering 
simple interceptors & features.

For me, addressing CXF-5439 is about few lines of code. I don't mind if 
it won't be considered a standard approach, because using a standard 
approach (Named, etc) to create non-portable deployments (CXF 
interceptors will obviously won't work without CXF) is not exactly a 
standard approach in the end

Sergey

On 09/12/13 14:52, Christian Schneider wrote:
> What I could imagine for CDI is to implement a CDI extension for CXF in
> deltaspike (http://deltaspike.apache.org/).
> This way we could make sure it plays nicely with the cdi frameworks. It
> also would have the advantage that we would not have to do the
> annotation processing ourselves and instead can use the cdi framework
> code for that.
>
> Christian
>
>
> On 09.12.2013 15:47, Sergey Beryozkin wrote:
>> It should also work in Spring only, yes.
>>
>> I don't mind much against the Named/etc. As long as using it is as
>> simple as working with the CXF annotations.
>>
>> For example, for JAX-RS, I don;t need Named & friends to get root
>> JAX-RS resources & providers discovered, the idea of the unification
>> of the annotations is good but it may not always be realistic to apply
>> it consistently
>>
>> Sergey
>>
>>
>> On 09/12/13 14:37, Przemysław Bielicki wrote:
>>> Christian, what is CDI for you?
>>> You mean javax.inject (fully supported by Spring) or
>>> javax.enterprise.inject (supported by Java EE containers)
>>>
>>>
>>> On Mon, Dec 9, 2013 at 3:32 PM, cschneider [via CXF] <
>>> ml-node+s547215n5737569h92@n5.nabble.com> wrote:
>>>
>>>> Basically I also like to use standard annotations instead of our custom
>>>> ones. The problem is though that CXF should also be able to run in a
>>>> CDI
>>>> environment.
>>>> In such an environment CXF annotation processing may conflict with CDI
>>>> annotation processing.
>>>>
>>>> So I think using @Inject is great but we should leave the annotation
>>>> processing to the CDI framework the user chooses. I have not tested how
>>>> this works with the current CXF code but I think we should try to make
>>>> it compatible with CDI.
>>>>
>>>> Does anyone have some experience with this?
>>>>
>>>> Christian
>>>>
>>>>
>>>> On 09.12.2013 15:26, Przemysław Bielicki wrote:
>>>>
>>>>> Hi Sergey,
>>>>>
>>>>> I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439>
>>>> is a
>>>>> really great idea. For me all CXF components should be just annotated
>>>> with
>>>>> @javax.inject.Named and then injected using @javax.inject.Inject or
>>>>> @javax.annotation.Resource. I prefer to use a well established
>>>>> standards
>>>>> instead of multiplying annotations - but maybe I am not aware of some
>>>>> limitations, issue you mentioned could solve.
>>>>>
>>>>> Anyway, my solution uses only javax.inject annotations and it works
>>>> pretty
>>>>> well.
>>>>>
>>>>> I will file the jira issue soon (probably not today), and it should be
>>>>> clear then.
>>>>>
>>>>> Cheers,
>>>>> Przemyslaw
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
>>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5737569&i=0>>
>>>> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I added a prototype to the JAX-RS frontend,
>>>>>>
>>>>>>
>>>>>>
>>>> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java
>>>>
>>>>>>
>>>>>> (based on the code fragment from Vladimir Kulev)
>>>>>>
>>>>>> I think the similar thing can be done for all frontends indeed
>>>>>>
>>>>>> We probably should get
>>>>>> https://issues.apache.org/jira/browse/CXF-5439
>>>>>>
>>>>>> fixed first
>>>>>>
>>>>>> Sergey
>>>>>>
>>>>>>
>>>>>> On 09/12/13 14:13, Christian Schneider wrote:
>>>>>>
>>>>>>> We have some factory classes but they are often not as convenient to
>>>> use
>>>>>>> as the namespaces.
>>>>>>>
>>>>>>> In any case it would be interesting to see what you did. Can you
>>>>>>> open
>>>> a
>>>>>>> jira and attach your code as a patch?
>>>>>>> If it is just a few lines you can also just paste the code or
>>>>>>> point to
>>>> a
>>>>>>> github repo or similar.
>>>>>>>
>>>>>>> Christian
>>>>>>>
>>>>>>> On 09.12.2013 15:05, pbielicki wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> in order to integrate CXF with Spring developers need to go through
>>>> an
>>>>>>>> XML
>>>>>>>> file, right (i.e.
>>>>>>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>>>>>>>
>>>>>>>> Is it possible out-of-the box to integrate CXF with Spring using
>>>>>>>> annotation-driven context configuration? I am talking about
>>>>>>>> @org.springframework.context.annotation.Configuration and
>>>>>>>> @org.springframework.context.annotation.ComponentScan annotations
>>>>>>>> (
>>>>>>
>>>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>>>
>>>>
>>>>>>
>>>>>>>> Are they supported by CXF integration?
>>>>>>>>
>>>>>>>> The goal is to avoid any XML configuration.
>>>>>>>>
>>>>>>>> If it's not part of CXF I may help because I just implemented such
>>>>>>>> integration (few lines of code, really), and I find it pretty
>>>>>>>> useful.
>>>>>>>>
>>>>>>>> Please let me know what you think? I wanted to open a JIRA issue
>>>>>> straight
>>>>>>>> away but I prefer to ask you before.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Przemyslaw Bielicki
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>>
>>>>>>
>>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>>>>
>>>>>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> Sergey Beryozkin
>>>>>>
>>>>>> Talend Community Coders
>>>>>> http://coders.talend.com/
>>>>>>
>>>>>> Blog: http://sberyozkin.blogspot.com
>>>>>>
>>>>>>
>>>>>> ------------------------------
>>>>>>    If you reply to this email, your message will be added to the
>>>> discussion
>>>>>> below:
>>>>>>
>>>>>>
>>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html
>>>>
>>>>>>    To unsubscribe from Spring integration using @Configuration &
>>>>>> @ComponentScan annotations, click here<
>>>>
>>>>>> .
>>>>>> NAML<
>>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>
>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Christian Schneider
>>>> http://www.liquid-reality.de
>>>>
>>>> Open Source Architect
>>>> http://www.talend.com
>>>>
>>>>
>>>>
>>>> ------------------------------
>>>>   If you reply to this email, your message will be added to the
>>>> discussion
>>>> below:
>>>>
>>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737569.html
>>>>
>>>>   To unsubscribe from Spring integration using @Configuration &
>>>> @ComponentScan annotations, click
>>>> here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>>>>
>>>> .
>>>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>
>>>>
>>>
>>
>>
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Christian Schneider <ch...@die-schneider.net>.
What I could imagine for CDI is to implement a CDI extension for CXF in 
deltaspike (http://deltaspike.apache.org/).
This way we could make sure it plays nicely with the cdi frameworks. It 
also would have the advantage that we would not have to do the
annotation processing ourselves and instead can use the cdi framework 
code for that.

Christian


On 09.12.2013 15:47, Sergey Beryozkin wrote:
> It should also work in Spring only, yes.
>
> I don't mind much against the Named/etc. As long as using it is as 
> simple as working with the CXF annotations.
>
> For example, for JAX-RS, I don;t need Named & friends to get root 
> JAX-RS resources & providers discovered, the idea of the unification 
> of the annotations is good but it may not always be realistic to apply 
> it consistently
>
> Sergey
>
>
> On 09/12/13 14:37, Przemysław Bielicki wrote:
>> Christian, what is CDI for you?
>> You mean javax.inject (fully supported by Spring) or
>> javax.enterprise.inject (supported by Java EE containers)
>>
>>
>> On Mon, Dec 9, 2013 at 3:32 PM, cschneider [via CXF] <
>> ml-node+s547215n5737569h92@n5.nabble.com> wrote:
>>
>>> Basically I also like to use standard annotations instead of our custom
>>> ones. The problem is though that CXF should also be able to run in a 
>>> CDI
>>> environment.
>>> In such an environment CXF annotation processing may conflict with CDI
>>> annotation processing.
>>>
>>> So I think using @Inject is great but we should leave the annotation
>>> processing to the CDI framework the user chooses. I have not tested how
>>> this works with the current CXF code but I think we should try to make
>>> it compatible with CDI.
>>>
>>> Does anyone have some experience with this?
>>>
>>> Christian
>>>
>>>
>>> On 09.12.2013 15:26, Przemysław Bielicki wrote:
>>>
>>>> Hi Sergey,
>>>>
>>>> I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439>
>>> is a
>>>> really great idea. For me all CXF components should be just annotated
>>> with
>>>> @javax.inject.Named and then injected using @javax.inject.Inject or
>>>> @javax.annotation.Resource. I prefer to use a well established 
>>>> standards
>>>> instead of multiplying annotations - but maybe I am not aware of some
>>>> limitations, issue you mentioned could solve.
>>>>
>>>> Anyway, my solution uses only javax.inject annotations and it works
>>> pretty
>>>> well.
>>>>
>>>> I will file the jira issue soon (probably not today), and it should be
>>>> clear then.
>>>>
>>>> Cheers,
>>>> Przemyslaw
>>>>
>>>>
>>>>
>>>>
>>>> On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
>>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5737569&i=0>>
>>> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I added a prototype to the JAX-RS frontend,
>>>>>
>>>>>
>>>>>
>>> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java 
>>>
>>>>>
>>>>> (based on the code fragment from Vladimir Kulev)
>>>>>
>>>>> I think the similar thing can be done for all frontends indeed
>>>>>
>>>>> We probably should get
>>>>> https://issues.apache.org/jira/browse/CXF-5439
>>>>>
>>>>> fixed first
>>>>>
>>>>> Sergey
>>>>>
>>>>>
>>>>> On 09/12/13 14:13, Christian Schneider wrote:
>>>>>
>>>>>> We have some factory classes but they are often not as convenient to
>>> use
>>>>>> as the namespaces.
>>>>>>
>>>>>> In any case it would be interesting to see what you did. Can you 
>>>>>> open
>>> a
>>>>>> jira and attach your code as a patch?
>>>>>> If it is just a few lines you can also just paste the code or 
>>>>>> point to
>>> a
>>>>>> github repo or similar.
>>>>>>
>>>>>> Christian
>>>>>>
>>>>>> On 09.12.2013 15:05, pbielicki wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> in order to integrate CXF with Spring developers need to go through
>>> an
>>>>>>> XML
>>>>>>> file, right (i.e.
>>>>>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>>>>>>
>>>>>>> Is it possible out-of-the box to integrate CXF with Spring using
>>>>>>> annotation-driven context configuration? I am talking about
>>>>>>> @org.springframework.context.annotation.Configuration and
>>>>>>> @org.springframework.context.annotation.ComponentScan annotations
>>>>>>> (
>>>>>
>>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html). 
>>>
>>>
>>>>>
>>>>>>> Are they supported by CXF integration?
>>>>>>>
>>>>>>> The goal is to avoid any XML configuration.
>>>>>>>
>>>>>>> If it's not part of CXF I may help because I just implemented such
>>>>>>> integration (few lines of code, really), and I find it pretty 
>>>>>>> useful.
>>>>>>>
>>>>>>> Please let me know what you think? I wanted to open a JIRA issue
>>>>> straight
>>>>>>> away but I prefer to ask you before.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Przemyslaw Bielicki
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -- 
>>>>>>> View this message in context:
>>>>>>>
>>>>>
>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html 
>>>
>>>>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>>>>
>>>>>
>>>>> -- 
>>>>> Sergey Beryozkin
>>>>>
>>>>> Talend Community Coders
>>>>> http://coders.talend.com/
>>>>>
>>>>> Blog: http://sberyozkin.blogspot.com
>>>>>
>>>>>
>>>>> ------------------------------
>>>>>    If you reply to this email, your message will be added to the
>>> discussion
>>>>> below:
>>>>>
>>>>>
>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html 
>>>
>>>>>    To unsubscribe from Spring integration using @Configuration &
>>>>> @ComponentScan annotations, click here<
>>>
>>>>> .
>>>>> NAML<
>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>>>
>>>
>>>>>
>>>
>>>
>>> -- 
>>> Christian Schneider
>>> http://www.liquid-reality.de
>>>
>>> Open Source Architect
>>> http://www.talend.com
>>>
>>>
>>>
>>> ------------------------------
>>>   If you reply to this email, your message will be added to the 
>>> discussion
>>> below:
>>>
>>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737569.html 
>>>
>>>   To unsubscribe from Spring integration using @Configuration &
>>> @ComponentScan annotations, click 
>>> here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>>> .
>>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>>>
>>>
>>
>
>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Sergey Beryozkin <sb...@gmail.com>.
It should also work in Spring only, yes.

I don't mind much against the Named/etc. As long as using it is as 
simple as working with the CXF annotations.

For example, for JAX-RS, I don;t need Named & friends to get root JAX-RS 
resources & providers discovered, the idea of the unification of the 
annotations is good but it may not always be realistic to apply it 
consistently

Sergey


On 09/12/13 14:37, Przemysław Bielicki wrote:
> Christian, what is CDI for you?
> You mean javax.inject (fully supported by Spring) or
> javax.enterprise.inject (supported by Java EE containers)
>
>
> On Mon, Dec 9, 2013 at 3:32 PM, cschneider [via CXF] <
> ml-node+s547215n5737569h92@n5.nabble.com> wrote:
>
>> Basically I also like to use standard annotations instead of our custom
>> ones. The problem is though that CXF should also be able to run in a CDI
>> environment.
>> In such an environment CXF annotation processing may conflict with CDI
>> annotation processing.
>>
>> So I think using @Inject is great but we should leave the annotation
>> processing to the CDI framework the user chooses. I have not tested how
>> this works with the current CXF code but I think we should try to make
>> it compatible with CDI.
>>
>> Does anyone have some experience with this?
>>
>> Christian
>>
>>
>> On 09.12.2013 15:26, Przemysław Bielicki wrote:
>>
>>> Hi Sergey,
>>>
>>> I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439>
>> is a
>>> really great idea. For me all CXF components should be just annotated
>> with
>>> @javax.inject.Named and then injected using @javax.inject.Inject or
>>> @javax.annotation.Resource. I prefer to use a well established standards
>>> instead of multiplying annotations - but maybe I am not aware of some
>>> limitations, issue you mentioned could solve.
>>>
>>> Anyway, my solution uses only javax.inject annotations and it works
>> pretty
>>> well.
>>>
>>> I will file the jira issue soon (probably not today), and it should be
>>> clear then.
>>>
>>> Cheers,
>>> Przemyslaw
>>>
>>>
>>>
>>>
>>> On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
>>> [hidden email] <http://user/SendEmail.jtp?type=node&node=5737569&i=0>>
>> wrote:
>>>
>>>> Hi
>>>>
>>>> I added a prototype to the JAX-RS frontend,
>>>>
>>>>
>>>>
>> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java
>>>>
>>>> (based on the code fragment from Vladimir Kulev)
>>>>
>>>> I think the similar thing can be done for all frontends indeed
>>>>
>>>> We probably should get
>>>> https://issues.apache.org/jira/browse/CXF-5439
>>>>
>>>> fixed first
>>>>
>>>> Sergey
>>>>
>>>>
>>>> On 09/12/13 14:13, Christian Schneider wrote:
>>>>
>>>>> We have some factory classes but they are often not as convenient to
>> use
>>>>> as the namespaces.
>>>>>
>>>>> In any case it would be interesting to see what you did. Can you open
>> a
>>>>> jira and attach your code as a patch?
>>>>> If it is just a few lines you can also just paste the code or point to
>> a
>>>>> github repo or similar.
>>>>>
>>>>> Christian
>>>>>
>>>>> On 09.12.2013 15:05, pbielicki wrote:
>>>>>> Hi,
>>>>>>
>>>>>> in order to integrate CXF with Spring developers need to go through
>> an
>>>>>> XML
>>>>>> file, right (i.e.
>>>>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>>>>>
>>>>>> Is it possible out-of-the box to integrate CXF with Spring using
>>>>>> annotation-driven context configuration? I am talking about
>>>>>> @org.springframework.context.annotation.Configuration and
>>>>>> @org.springframework.context.annotation.ComponentScan annotations
>>>>>> (
>>>>
>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>
>>>>
>>>>>> Are they supported by CXF integration?
>>>>>>
>>>>>> The goal is to avoid any XML configuration.
>>>>>>
>>>>>> If it's not part of CXF I may help because I just implemented such
>>>>>> integration (few lines of code, really), and I find it pretty useful.
>>>>>>
>>>>>> Please let me know what you think? I wanted to open a JIRA issue
>>>> straight
>>>>>> away but I prefer to ask you before.
>>>>>>
>>>>>> Cheers,
>>>>>> Przemyslaw Bielicki
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>>>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>>>
>>>>
>>>> --
>>>> Sergey Beryozkin
>>>>
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>>>
>>>> Blog: http://sberyozkin.blogspot.com
>>>>
>>>>
>>>> ------------------------------
>>>>    If you reply to this email, your message will be added to the
>> discussion
>>>> below:
>>>>
>>>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html
>>>>    To unsubscribe from Spring integration using @Configuration &
>>>> @ComponentScan annotations, click here<
>>
>>>> .
>>>> NAML<
>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>>>>
>>
>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> http://www.talend.com
>>
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737569.html
>>   To unsubscribe from Spring integration using @Configuration &
>> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>



Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemysław Bielicki <pb...@gmail.com>.
Christian, what is CDI for you?
You mean javax.inject (fully supported by Spring) or
javax.enterprise.inject (supported by Java EE containers)


On Mon, Dec 9, 2013 at 3:32 PM, cschneider [via CXF] <
ml-node+s547215n5737569h92@n5.nabble.com> wrote:

> Basically I also like to use standard annotations instead of our custom
> ones. The problem is though that CXF should also be able to run in a CDI
> environment.
> In such an environment CXF annotation processing may conflict with CDI
> annotation processing.
>
> So I think using @Inject is great but we should leave the annotation
> processing to the CDI framework the user chooses. I have not tested how
> this works with the current CXF code but I think we should try to make
> it compatible with CDI.
>
> Does anyone have some experience with this?
>
> Christian
>
>
> On 09.12.2013 15:26, Przemysław Bielicki wrote:
>
> > Hi Sergey,
> >
> > I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439>
> is a
> > really great idea. For me all CXF components should be just annotated
> with
> > @javax.inject.Named and then injected using @javax.inject.Inject or
> > @javax.annotation.Resource. I prefer to use a well established standards
> > instead of multiplying annotations - but maybe I am not aware of some
> > limitations, issue you mentioned could solve.
> >
> > Anyway, my solution uses only javax.inject annotations and it works
> pretty
> > well.
> >
> > I will file the jira issue soon (probably not today), and it should be
> > clear then.
> >
> > Cheers,
> > Przemyslaw
> >
> >
> >
> >
> > On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5737569&i=0>>
> wrote:
> >
> >> Hi
> >>
> >> I added a prototype to the JAX-RS frontend,
> >>
> >>
> >>
> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java
> >>
> >> (based on the code fragment from Vladimir Kulev)
> >>
> >> I think the similar thing can be done for all frontends indeed
> >>
> >> We probably should get
> >> https://issues.apache.org/jira/browse/CXF-5439
> >>
> >> fixed first
> >>
> >> Sergey
> >>
> >>
> >> On 09/12/13 14:13, Christian Schneider wrote:
> >>
> >>> We have some factory classes but they are often not as convenient to
> use
> >>> as the namespaces.
> >>>
> >>> In any case it would be interesting to see what you did. Can you open
> a
> >>> jira and attach your code as a patch?
> >>> If it is just a few lines you can also just paste the code or point to
> a
> >>> github repo or similar.
> >>>
> >>> Christian
> >>>
> >>> On 09.12.2013 15:05, pbielicki wrote:
> >>>> Hi,
> >>>>
> >>>> in order to integrate CXF with Spring developers need to go through
> an
> >>>> XML
> >>>> file, right (i.e.
> >>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >>>>
> >>>> Is it possible out-of-the box to integrate CXF with Spring using
> >>>> annotation-driven context configuration? I am talking about
> >>>> @org.springframework.context.annotation.Configuration and
> >>>> @org.springframework.context.annotation.ComponentScan annotations
> >>>> (
> >>
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> >>
> >>>> Are they supported by CXF integration?
> >>>>
> >>>> The goal is to avoid any XML configuration.
> >>>>
> >>>> If it's not part of CXF I may help because I just implemented such
> >>>> integration (few lines of code, really), and I find it pretty useful.
> >>>>
> >>>> Please let me know what you think? I wanted to open a JIRA issue
> >> straight
> >>>> away but I prefer to ask you before.
> >>>>
> >>>> Cheers,
> >>>> Przemyslaw Bielicki
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> >>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> >>>> Sent from the cxf-dev mailing list archive at Nabble.com.
> >>>
> >>
> >> --
> >> Sergey Beryozkin
> >>
> >> Talend Community Coders
> >> http://coders.talend.com/
> >>
> >> Blog: http://sberyozkin.blogspot.com
> >>
> >>
> >> ------------------------------
> >>   If you reply to this email, your message will be added to the
> discussion
> >> below:
> >>
> >>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html
> >>   To unsubscribe from Spring integration using @Configuration &
> >> @ComponentScan annotations, click here<
>
> >> .
> >> NAML<
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737569.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Christian Schneider <ch...@die-schneider.net>.
Basically I also like to use standard annotations instead of our custom 
ones. The problem is though that CXF should also be able to run in a CDI 
environment.
In such an environment CXF annotation processing may conflict with CDI 
annotation processing.

So I think using @Inject is great but we should leave the annotation 
processing to the CDI framework the user chooses. I have not tested how 
this works with the current CXF code but I think we should try to make 
it compatible with CDI.

Does anyone have some experience with this?

Christian


On 09.12.2013 15:26, Przemysław Bielicki wrote:
> Hi Sergey,
>
> I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439> is a
> really great idea. For me all CXF components should be just annotated with
> @javax.inject.Named and then injected using @javax.inject.Inject or
> @javax.annotation.Resource. I prefer to use a well established standards
> instead of multiplying annotations - but maybe I am not aware of some
> limitations, issue you mentioned could solve.
>
> Anyway, my solution uses only javax.inject annotations and it works pretty
> well.
>
> I will file the jira issue soon (probably not today), and it should be
> clear then.
>
> Cheers,
> Przemyslaw
>
>
>
>
> On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
> ml-node+s547215n5737565h68@n5.nabble.com> wrote:
>
>> Hi
>>
>> I added a prototype to the JAX-RS frontend,
>>
>>
>> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java
>>
>> (based on the code fragment from Vladimir Kulev)
>>
>> I think the similar thing can be done for all frontends indeed
>>
>> We probably should get
>> https://issues.apache.org/jira/browse/CXF-5439
>>
>> fixed first
>>
>> Sergey
>>
>>
>> On 09/12/13 14:13, Christian Schneider wrote:
>>
>>> We have some factory classes but they are often not as convenient to use
>>> as the namespaces.
>>>
>>> In any case it would be interesting to see what you did. Can you open a
>>> jira and attach your code as a patch?
>>> If it is just a few lines you can also just paste the code or point to a
>>> github repo or similar.
>>>
>>> Christian
>>>
>>> On 09.12.2013 15:05, pbielicki wrote:
>>>> Hi,
>>>>
>>>> in order to integrate CXF with Spring developers need to go through an
>>>> XML
>>>> file, right (i.e.
>>>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>>>
>>>> Is it possible out-of-the box to integrate CXF with Spring using
>>>> annotation-driven context configuration? I am talking about
>>>> @org.springframework.context.annotation.Configuration and
>>>> @org.springframework.context.annotation.ComponentScan annotations
>>>> (
>> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>
>>>> Are they supported by CXF integration?
>>>>
>>>> The goal is to avoid any XML configuration.
>>>>
>>>> If it's not part of CXF I may help because I just implemented such
>>>> integration (few lines of code, really), and I find it pretty useful.
>>>>
>>>> Please let me know what you think? I wanted to open a JIRA issue
>> straight
>>>> away but I prefer to ask you before.
>>>>
>>>> Cheers,
>>>> Przemyslaw Bielicki
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html
>>   To unsubscribe from Spring integration using @Configuration &
>> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
>> .
>> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Przemysław Bielicki <pb...@gmail.com>.
Hi Sergey,

I'm not sure CXF-5439 <https://issues.apache.org/jira/browse/CXF-5439> is a
really great idea. For me all CXF components should be just annotated with
@javax.inject.Named and then injected using @javax.inject.Inject or
@javax.annotation.Resource. I prefer to use a well established standards
instead of multiplying annotations - but maybe I am not aware of some
limitations, issue you mentioned could solve.

Anyway, my solution uses only javax.inject annotations and it works pretty
well.

I will file the jira issue soon (probably not today), and it should be
clear then.

Cheers,
Przemyslaw




On Mon, Dec 9, 2013 at 3:20 PM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5737565h68@n5.nabble.com> wrote:

> Hi
>
> I added a prototype to the JAX-RS frontend,
>
>
> http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java
>
> (based on the code fragment from Vladimir Kulev)
>
> I think the similar thing can be done for all frontends indeed
>
> We probably should get
> https://issues.apache.org/jira/browse/CXF-5439
>
> fixed first
>
> Sergey
>
>
> On 09/12/13 14:13, Christian Schneider wrote:
>
> > We have some factory classes but they are often not as convenient to use
> > as the namespaces.
> >
> > In any case it would be interesting to see what you did. Can you open a
> > jira and attach your code as a patch?
> > If it is just a few lines you can also just paste the code or point to a
> > github repo or similar.
> >
> > Christian
> >
> > On 09.12.2013 15:05, pbielicki wrote:
> >> Hi,
> >>
> >> in order to integrate CXF with Spring developers need to go through an
> >> XML
> >> file, right (i.e.
> >> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
> >>
> >> Is it possible out-of-the box to integrate CXF with Spring using
> >> annotation-driven context configuration? I am talking about
> >> @org.springframework.context.annotation.Configuration and
> >> @org.springframework.context.annotation.ComponentScan annotations
> >> (
> http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>
> >>
> >> Are they supported by CXF integration?
> >>
> >> The goal is to avoid any XML configuration.
> >>
> >> If it's not part of CXF I may help because I just implemented such
> >> integration (few lines of code, really), and I find it pretty useful.
> >>
> >> Please let me know what you think? I wanted to open a JIRA issue
> straight
> >> away but I prefer to ask you before.
> >>
> >> Cheers,
> >> Przemyslaw Bielicki
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> >>
> >> Sent from the cxf-dev mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561p5737565.html
>  To unsubscribe from Spring integration using @Configuration &
> @ComponentScan annotations, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5737561&code=cGJpZWxpY2tpQGdtYWlsLmNvbXw1NzM3NTYxfC0xODU3NDYzNDAz>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

I added a prototype to the JAX-RS frontend,

http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringResourceServer.java

(based on the code fragment from Vladimir Kulev)

I think the similar thing can be done for all frontends indeed

We probably should get
https://issues.apache.org/jira/browse/CXF-5439

fixed first

Sergey


On 09/12/13 14:13, Christian Schneider wrote:
> We have some factory classes but they are often not as convenient to use
> as the namespaces.
>
> In any case it would be interesting to see what you did. Can you open a
> jira and attach your code as a patch?
> If it is just a few lines you can also just paste the code or point to a
> github repo or similar.
>
> Christian
>
> On 09.12.2013 15:05, pbielicki wrote:
>> Hi,
>>
>> in order to integrate CXF with Spring developers need to go through an
>> XML
>> file, right (i.e.
>> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>>
>> Is it possible out-of-the box to integrate CXF with Spring using
>> annotation-driven context configuration? I am talking about
>> @org.springframework.context.annotation.Configuration and
>> @org.springframework.context.annotation.ComponentScan annotations
>> (http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
>>
>> Are they supported by CXF integration?
>>
>> The goal is to avoid any XML configuration.
>>
>> If it's not part of CXF I may help because I just implemented such
>> integration (few lines of code, really), and I find it pretty useful.
>>
>> Please let me know what you think? I wanted to open a JIRA issue straight
>> away but I prefer to ask you before.
>>
>> Cheers,
>> Przemyslaw Bielicki
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
>>
>> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Spring integration using @Configuration & @ComponentScan annotations

Posted by Christian Schneider <ch...@die-schneider.net>.
We have some factory classes but they are often not as convenient to use 
as the namespaces.

In any case it would be interesting to see what you did. Can you open a 
jira and attach your code as a patch?
If it is just a few lines you can also just paste the code or point to a 
github repo or similar.

Christian

On 09.12.2013 15:05, pbielicki wrote:
> Hi,
>
> in order to integrate CXF with Spring developers need to go through an XML
> file, right (i.e.
> http://cxf.apache.org/docs/writing-a-service-with-spring.html)?
>
> Is it possible out-of-the box to integrate CXF with Spring using
> annotation-driven context configuration? I am talking about
> @org.springframework.context.annotation.Configuration and
> @org.springframework.context.annotation.ComponentScan annotations
> (http://docs.spring.io/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/Configuration.html).
> Are they supported by CXF integration?
>
> The goal is to avoid any XML configuration.
>
> If it's not part of CXF I may help because I just implemented such
> integration (few lines of code, really), and I find it pretty useful.
>
> Please let me know what you think? I wanted to open a JIRA issue straight
> away but I prefer to ask you before.
>
> Cheers,
> Przemyslaw Bielicki
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Spring-integration-using-Configuration-ComponentScan-annotations-tp5737561.html
> Sent from the cxf-dev mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com