cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1036842 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
Date Fri, 19 Nov 2010 14:00:48 GMT
Author: sergeyb
Date: Fri Nov 19 14:00:47 2010
New Revision: 1036842

URL: http://svn.apache.org/viewvc?rev=1036842&view=rev
Log:
Merged revisions 1036840 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1036840 | sergeyb | 2010-11-19 13:58:18 +0000 (Fri, 19 Nov 2010) | 1 line
  
  [JAX-RS] Minor fix for field-based injection of Contexts to work in cases when service classes
are interfaces
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1036840

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java?rev=1036842&r1=1036841&r2=1036842&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
Fri Nov 19 14:00:47 2010
@@ -64,6 +64,9 @@ public abstract class AbstractResourceIn
     
     public void setResourceClass(Class<?> rClass) {
         resourceClass = rClass;
+        if (serviceClass.isInterface() && resourceClass != null && !resourceClass.isInterface())
{
+            findContextFields(resourceClass);
+        }
     }
     
     public Class<?> getServiceClass() {

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java?rev=1036842&r1=1036841&r2=1036842&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
Fri Nov 19 14:00:47 2010
@@ -22,9 +22,16 @@ package org.apache.cxf.systest.jaxrs;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
 public class BookStoreNoAnnotationsImpl implements BookStoreNoAnnotationsInterface {
 
     private Map<Long, Book> books = new HashMap<Long, Book>();
+    @Context 
+    private UriInfo ui;
     
     public BookStoreNoAnnotationsImpl() {
         Book b = new Book();
@@ -34,6 +41,9 @@ public class BookStoreNoAnnotationsImpl 
     }
     
     public Book getBook(Long id) throws BookNotFoundFault {
+        if (ui == null) {
+            throw new WebApplicationException(Response.serverError().build());
+        }
         return books.get(id);
     }
     



Mime
View raw message