Hi

> > >  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.
>
> If you use an external model (and I do not refer to the Spring
configuration file but to the user models used with the no-annotation
feature) then you have to specify a class name for every root resource this
model describes.
If this class a concrete class then CXF will create it and thus you do not
need to declare it in the spring configuration file. But even in this case
you can still explicitly create a service bean in the Spring config and set
some properties on it, etc. If you do it then it will be used instead of the
one created by CXF when the model was being processed.

Now, if the class declared in the model is an interface then at the moment
you need to additionally specify concrete classes in the serviceBeans
section. This is not needed in DOSGI case as OSFI runtime will provide
instances implementing the interfaces described in the external model

Sergey

Reply via email to