Author: jliu
Date: Tue Oct 23 06:36:13 2007
New Revision: 587503
URL: http://svn.apache.org/viewvc?rev=587503&view=rev
Log:
Use jsr311-api.jar from public maven repo.
Removed:
incubator/cxf/branches/jliu/maven_repo/
Modified:
incubator/cxf/branches/jliu/distribution/manifest/pom.xml
incubator/cxf/branches/jliu/distribution/pom.xml
incubator/cxf/branches/jliu/rt/frontend/jaxrs/pom.xml
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Modified: incubator/cxf/branches/jliu/distribution/manifest/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/manifest/pom.xml?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/manifest/pom.xml (original)
+++ incubator/cxf/branches/jliu/distribution/manifest/pom.xml Tue Oct 23
06:36:13 2007
@@ -227,11 +227,11 @@
<artifactId>commons-httpclient</artifactId>
<version>3.1-rc1</version>
</dependency>
- <dependency>
- <groupId>javax.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>0.9</version>
- </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>0.3</version>
+ </dependency>
</dependencies>
<build>
Modified: incubator/cxf/branches/jliu/distribution/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/distribution/pom.xml?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/distribution/pom.xml (original)
+++ incubator/cxf/branches/jliu/distribution/pom.xml Tue Oct 23 06:36:13 2007
@@ -231,11 +231,11 @@
<artifactId>commons-httpclient</artifactId>
<version>3.1-rc1</version>
</dependency>
- <dependency>
- <groupId>javax.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>0.9</version>
- </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>0.3</version>
+ </dependency>
</dependencies>
<build>
Modified: incubator/cxf/branches/jliu/rt/frontend/jaxrs/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/pom.xml?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
--- incubator/cxf/branches/jliu/rt/frontend/jaxrs/pom.xml (original)
+++ incubator/cxf/branches/jliu/rt/frontend/jaxrs/pom.xml Tue Oct 23 06:36:13
2007
@@ -58,20 +58,15 @@
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
- <groupId>javax.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>0.9</version>
- </dependency>
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>javax.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>0.9</version>
- </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>0.3</version>
+ </dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
Modified:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Tue Oct 23 06:36:13 2007
@@ -90,7 +90,7 @@
message.put(Message.CONTENT_TYPE, methodMimeTypes[0]);
}
- provider.writeTo(responseObj, null, out);
+ provider.writeTo(responseObj, null, null, out);
} catch (IOException e) {
e.printStackTrace();
Modified:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
Tue Oct 23 06:36:13 2007
@@ -24,6 +24,8 @@
import java.io.OutputStream;
import java.util.Map;
import java.util.WeakHashMap;
+
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.EntityProvider;
import javax.xml.bind.JAXBContext;
@@ -40,7 +42,7 @@
return type.getAnnotation(XmlRootElement.class) != null;
}
- public Object readFrom(Class<Object> type, String mediaType,
MultivaluedMap<String, String> headers,
+ public Object readFrom(Class<Object> type, MediaType m,
MultivaluedMap<String, String> headers,
InputStream is) {
try {
JAXBContext context = getJAXBContext(type);
@@ -53,7 +55,7 @@
return null;
}
- public void writeTo(Object obj, MultivaluedMap<String, Object> headers,
OutputStream os) {
+ public void writeTo(Object obj, MediaType m, MultivaluedMap<String,
Object> headers, OutputStream os) {
try {
//Looks like we do not need to deal with Array and List as
multiple root elements
//is not allowed in a plain-old-xml binding anyway.
Modified:
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++
incubator/cxf/branches/jliu/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Tue Oct 23 06:36:13 2007
@@ -28,6 +28,7 @@
import javax.ws.rs.ConsumeMime;
import javax.ws.rs.ProduceMime;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.EntityProvider;
import javax.xml.bind.JAXBContext;
@@ -51,7 +52,7 @@
return type.getAnnotation(XmlRootElement.class) != null;
}
- public Object readFrom(Class<Object> type, String mediaType,
MultivaluedMap<String, String> headers,
+ public Object readFrom(Class<Object> type, MediaType m,
MultivaluedMap<String, String> headers,
InputStream is) {
try {
JAXBContext context = getJAXBContext(type);
@@ -64,7 +65,7 @@
return null;
}
- public void writeTo(Object obj, MultivaluedMap<String, Object> headers,
OutputStream os) {
+ public void writeTo(Object obj, MediaType m, MultivaluedMap<String,
Object> headers, OutputStream os) {
try {
JAXBContext context = getJAXBContext(obj.getClass());
Marshaller marshaller = context.createMarshaller();
Modified:
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=587503&r1=587502&r2=587503&view=diff
==============================================================================
---
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++
incubator/cxf/branches/jliu/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Tue Oct 23 06:36:13 2007
@@ -32,12 +32,12 @@
@UriTemplate("/bookstore/")
public class BookStore {
-
+
private Map<Long, Book> books = new HashMap<Long, Book>();
private Map<Long, CD> cds = new HashMap<Long, CD>();
private long bookId = 123;
private long cdId = 123;
-
+
public BookStore() {
init();
System.out.println("----books: " + books.size());
@@ -47,34 +47,33 @@
@HttpMethod("GET")
public List<Book> getAllItems() {
System.out.println("----invoking getBooks");
-
+
return books;
} */
-
+
@HttpMethod("GET")
@UriTemplate("/books/{bookId}/")
public Book getBook(@UriParam("bookId") String id) {
System.out.println("----invoking getBook with id: " + id);
- Book b = books.get(Long.parseLong(id));
- return b;
+ return books.get(Long.parseLong(id));
}
-
+
@HttpMethod("POST")
@UriTemplate("/books")
public Response addBook(Book book) {
System.out.println("----invoking addBook, book name is: " +
book.getName());
- book.setId(++bookId);
+ book.setId(++bookId);
books.put(book.getId(), book);
return Response.Builder.ok(book).build();
}
-
+
@HttpMethod("PUT")
@UriTemplate("/books/")
public Response updateBook(Book book) {
System.out.println("----invoking updateBook, book name is: " +
book.getName());
Book b = books.get(book.getId());
-
+
Response r;
if (b != null) {
books.put(book.getId(), book);
@@ -82,27 +81,27 @@
} else {
r = Response.Builder.notModified().build();
}
-
- return r;
+
+ return r;
}
-
-
+
+
@HttpMethod("DELETE")
@UriTemplate("/books/{bookId}/")
public Response deleteBook(@UriParam("bookId") String id) {
System.out.println("----invoking deleteBook with bookId: " + id);
Book b = books.get(Long.parseLong(id));
-
+
Response r;
if (b != null) {
r = Response.Builder.ok().build();
} else {
r = Response.Builder.notModified().build();
}
-
- return r;
+
+ return r;
}
-
+
@HttpMethod("GET")
@UriTemplate("/cd/{CDId}/")
@ProduceMime("application/json")
@@ -113,12 +112,12 @@
public CD getCDJSON(@UriParam("CDId") String id) {
System.out.println("----invoking getCDJSON with cdId: " + id);
CD cd = cds.get(Long.parseLong(id));
-
+
return cd;
}
-
+
@HttpMethod("GET")
- @UriTemplate("/cds/")
+ @UriTemplate("/cds/")
public CDs getCDs() {
System.out.println("----invoking getCDs");
CDs c = new CDs();
@@ -130,14 +129,14 @@
@UriTemplate("/cds")
public Response addCD(CD cd) {
return null;
- }
+ }
final void init() {
Book book = new Book();
book.setId(bookId);
book.setName("CXF in Action");
books.put(book.getId(), book);
-
+
CD cd = new CD();
cd.setId(cdId);
cd.setName("BOHEMIAN RHAPSODY");