> -----Original Message-----
> From: Sergey Beryozkin [mailto:[email protected]]
> Sent: Thursday, October 14, 2010 10:00 AM
> To: [email protected]
> Subject: Re: Annotation to self-register service bean?
> 
> Hi David
> 
> On Thu, Oct 14, 2010 at 5:30 PM, KARR, DAVID (ATTSI) <[email protected]>
> wrote:
> 
> > I'm considering the balance of annotations vs. XML config.  There's
> not
> > much in a CXF controller that requires XML configuration (not for
> what
> > I've used CXF for so far).
> 
> 
> If I were to choose, I'd consider how likely it is that my PATH
> annotation
> values or various other JAXRS properties expressed via annotations
will
> change often enough ? Would it be cheap enough to update the resource
> classes should such changes occur ? Can I even update the code which
> will
> serve as a RESTful server ? How many dynamic root resources will I
have
> ? Is
> it DOSGI ? If things are relatively static then may be I'd not go for
a
> non-annotations feature...

Acknowledged.  In the REST services I've built so far, the REST
interface itself is defined pretty early, and hasn't changed much. 

> >  About the only reason I'm still defining the
> > bean in the XML config is that I have to put the bean into the
> > "jaxrs:serviceBeans" list, and I don't like to specify bean names in
> > annotations.  It might be reasonable if I could have an annotation
> like
> > the following on my Controller:
> >
> > @JAXRSRegister("MyJAXRSServerName")
> >
> > On the other hand, perhaps I'm mistaken about what I need to
> configure
> > here.  In the documentation, I found the following statement:
> >
> >    "Note that when registering a model from Spring you do not need
to
> > declare a jaxrs server serviceBeans section - the runtime will
> > instantiate the beans itself."
> >
> 
> The external model can refer to a service bean class. One only needs
to
> add
> a serviceBeans section if the external
> model refers to an interface (which one or more concrete service beans
> will
> implement).

I don't understand what you mean here.  Are you saying that I could
leave out the "serviceBeans" section in my "jaxrs:server" element, and
component scanning will automatically find my service bean components?

> If you do not want to use an xml configuration (Spring beans) at all
> then
> may be you may want to try CXFNonSpringJAXRSServlet ?

I don't want to go that far.  I like specifying the root server address
in XML, and I have some providers that I want to specify here.

Reply via email to