有可能实现更多的带注释的rest接口吗?

有可能实现更多的带注释的rest接口吗?,rest,java-ee-7,Rest,Java Ee 7,有可能实现更多带注释的REST接口吗。服务器决定使用哪种实现,例如关于其@Priority 例如: @Path("endpoint") public interface Endpoint { @GET("{id}") RetVal get(Integer id); } @Priority(100) public class EndpointImpl implements Endpoint { RetVal get(Integer id) { return

有可能实现更多带注释的REST接口吗。服务器决定使用哪种实现,例如关于其@Priority

例如:

@Path("endpoint")
public interface Endpoint {
    @GET("{id}")
    RetVal get(Integer id);
}

@Priority(100)
public class EndpointImpl implements Endpoint {
    RetVal get(Integer id) {
        return new RetVal();
    }
}

@Priority(200)
public class ExtendedEndpointImpl implements Endpoint {
    ExtendedRetVal get(Integer id) {
        return new ExtendedRetVal(); // class ExtendedRetVal extends RetVal
    }
}