Hello,

I have question regarding annotation inheritance.

Imagine we have an API with a model and an interface with exposed methods
like:

=====================================================
@Path("/customerrestservice/")
@ProduceMime("application/xml")
public interface RestService {

    @GET
    @Path("customer")
    Customer getCustomer(@QueryParam("name") String name);

    @GET
    @Path("vendor")
    Vendor getVendor(@QueryParam("profession") String profession);

    @GET
    @Path("/customerrestservice/vendors/{profession}/{name}")
    @ProduceMime("application/xml")
    Vendor getVendor(@PathParam("profession") String profession,
@PathParam("name") String name);

    @GET
    @Path("vendors")
    Set<Person> getPersons();
}
=====================================================

And a CXF implementation of this interface
=====================================================
@Path("/customerrestservice/")
@ProduceMime("application/xml")
public class RestServer implements RestService {
     [snipped]
}
=====================================================


The wiki on the JSR 311 says that annotations are inherited, ok. But
apparently the annotations on the interface itself aren't inherited!

Actually with CXF 2.1.1, it is the annotations on the implementation that
the factory uses.

Then if for some reason the path changes in either the API or in the
implementation, any client is doomed, because again it is the annotations on
the implementing class that are taking into account.
Or for example if an implementer forgot to add the @ProduceMime annotation,
then the server will not add in the HTTP headers the MIME type.



On another topic, is it possible to use properties in a http:conduit bean
definition.
With Spring there is a propertyplaceholder who can propagate properties,
however the XSD doesn't accept strings it is then impossible to write a
property value like "${rest.service.password}".
I think it could be really nice to relax a bit the XSD in order to benefit
the Spring property placeholder!


And last question, do you plan to create JAXRSClient factory bean, right
know using the JaxWsPRoxyFactoryBean is a bit intricate when declaring it in
a Spring application context and setting properties like setWrapped.


Thx in advance for your answers.

Btw CXF is really a Great work :)

-- 
Brice Dutheil

Reply via email to