Permalink
Browse files

distribution and examples

git-svn-id: file:///Users/billburke/jboss/resteasy/resteasy-git/svn-server-sync/resteasy/trunk/jaxrs@746 2b1ed4c4-5db3-0410-90e4-80a7a6204c25
  • Loading branch information...
1 parent 91b34de commit 778df21a302a2748f65845ebf92769d18e16f8c9 patriot1burke committed Jun 17, 2009
Showing with 497 additions and 174 deletions.
  1. +12 −12 distribution/assembly.xml
  2. +18 −0 distribution/pom.xml
  3. +27 −28 ...-clients/src/main/java/org/jboss/resteasy/examples/resteasy/ForceCachingExecutionInterceptor.java
  4. +41 −41 ...s/api-clients/src/main/java/org/jboss/resteasy/examples/resteasy/LoggingExecutionInterceptor.java
  5. +2 −0 examples/pom.xml
  6. +93 −81 examples/resteasy-springMVC/pom.xml
  7. +1 −1 examples/spring-hibernate-contacts/client/src/main/sql/hsqldb/contact.properties
  8. +1 −1 examples/spring-hibernate-contacts/persistence/src/main/sql/hsqldb/contact.properties
  9. +5 −5 providers/jackson/resteasy-jackson-provider.iml
  10. +5 −5 providers/test-jackson-jaxb-coexistence/test-jackson-jaxb-coexistence.iml
  11. +18 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/ClientInterceptor.java
  12. +20 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/DecoderPrecedence.java
  13. +20 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/EncoderPrecedence.java
  14. +21 −0 ...sy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/HeaderDecoratorPrecedence.java
  15. +17 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/Precedence.java
  16. +22 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/RedirectPrecedence.java
  17. +23 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/SecurityPrecedence.java
  18. +18 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/interception/ServerInterceptor.java
  19. +14 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/AcceptedByMethod.java
  20. +15 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/ClientExecutionContext.java
  21. +12 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/ClientExecutionInterceptor.java
  22. +25 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/DecoratorProcessor.java
  23. +40 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/MessageBodyReaderContext.java
  24. +27 −0 resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/interception/PreProcessInterceptor.java
View
@@ -36,6 +36,14 @@
<outputDirectory>examples/async-job-service</outputDirectory>
</fileSet>
<fileSet>
+ <directory>../examples/resteasy-springMVC</directory>
+ <outputDirectory>examples/resteasy-springMVC</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>../examples/api-clients</directory>
+ <outputDirectory>examples/api-clients</outputDirectory>
+ </fileSet>
+ <fileSet>
<directory>../docbook/target/docbook/publish/en-US</directory>
<outputDirectory>docs/userguide</outputDirectory>
</fileSet>
@@ -67,25 +75,17 @@
</includes>
<excludes>
<exclude>org.jboss.resteasy:resteasy-jaxrs-war</exclude>
+ <exclude>tjws:webserver</exclude>
+ <exclude>javax.servlet:servlet-api</exclude>
</excludes>
<outputDirectory>lib</outputDirectory>
</dependencySet>
<dependencySet>
<unpack>false</unpack>
<useTransitiveFiltering>true</useTransitiveFiltering>
<includes>
- <include>org.jboss.resteasy:resteasy-jaxrs</include>
- <include>org.jboss.resteasy:resteasy-jaxb-provider</include>
- <include>org.jboss.resteasy:resteasy-atom-provider</include>
- <include>org.jboss.resteasy:resteasy-multipart-provider</include>
- <include>org.jboss.resteasy:resteasy-jackson-provider</include>
- <include>org.jboss.resteasy:resteasy-yaml-provider</include>
- <include>org.jboss.resteasy:resteasy-spring</include>
- <include>org.jboss.resteasy:resteasy-guice</include>
- <include>org.jboss.resteasy:async-http-jbossweb</include>
- <include>org.jboss.resteasy:async-http-servlet-3.0</include>
- <include>org.jboss.resteasy:async-http-tomcat6</include>
- <include>org.jboss.resteasy:resteasy-cache-core</include>
+ <include>tjws:webserver</include>
+ <include>javax.servlet:servlet-api</include>
</includes>
<outputDirectory>embedded-lib</outputDirectory>
</dependencySet>
View
@@ -66,14 +66,32 @@
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jackson-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-spring</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-guice</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-cache-core</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>tjws</groupId>
+ <artifactId>webserver</artifactId>
+ </dependency>
</dependencies>
@@ -1,40 +1,39 @@
package org.jboss.resteasy.examples.resteasy;
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.ws.rs.core.MultivaluedMap;
-
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.core.interception.ClientExecutionContext;
-import org.jboss.resteasy.core.interception.ClientExecutionInterceptor;
+import org.jboss.resteasy.spi.interception.ClientExecutionContext;
+import org.jboss.resteasy.spi.interception.ClientExecutionInterceptor;
import org.jboss.resteasy.util.DateUtil;
import org.jboss.resteasy.util.HttpHeaderNames;
+import javax.ws.rs.core.MultivaluedMap;
+import java.util.Calendar;
+import java.util.Date;
+
public class ForceCachingExecutionInterceptor implements
ClientExecutionInterceptor
{
- private int minutes;
+ private int minutes;
- public ForceCachingExecutionInterceptor(int minutes)
- {
- this.minutes = minutes;
- }
+ public ForceCachingExecutionInterceptor(int minutes)
+ {
+ this.minutes = minutes;
+ }
- @SuppressWarnings("unchecked")
- public ClientResponse execute(ClientExecutionContext ctx) throws Exception
- {
- ClientResponse resp = ctx.proceed();
- MultivaluedMap<String, String> headers = resp.getHeaders();
- String date = headers.getFirst(HttpHeaderNames.DATE);
- if (date != null && headers.getFirst(HttpHeaderNames.EXPIRES) == null)
- {
- Calendar cal = Calendar.getInstance();
- cal.setTime(DateUtil.parseDate(date));
- cal.add(Calendar.MINUTE, minutes);
- Date future = cal.getTime();
- headers.add(HttpHeaderNames.EXPIRES, DateUtil.formatDate(future));
- }
- return resp;
- }
+ @SuppressWarnings("unchecked")
+ public ClientResponse execute(ClientExecutionContext ctx) throws Exception
+ {
+ ClientResponse resp = ctx.proceed();
+ MultivaluedMap<String, String> headers = resp.getHeaders();
+ String date = headers.getFirst(HttpHeaderNames.DATE);
+ if (date != null && headers.getFirst(HttpHeaderNames.EXPIRES) == null)
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(DateUtil.parseDate(date));
+ cal.add(Calendar.MINUTE, minutes);
+ Date future = cal.getTime();
+ headers.add(HttpHeaderNames.EXPIRES, DateUtil.formatDate(future));
+ }
+ return resp;
+ }
}
@@ -1,55 +1,55 @@
package org.jboss.resteasy.examples.resteasy;
-import java.io.IOException;
-
-import javax.ws.rs.WebApplicationException;
-
import org.apache.commons.lang.time.StopWatch;
import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.core.interception.ClientExecutionContext;
-import org.jboss.resteasy.core.interception.ClientExecutionInterceptor;
-import org.jboss.resteasy.core.interception.MessageBodyReaderContext;
-import org.jboss.resteasy.core.interception.MessageBodyReaderInterceptor;
+import org.jboss.resteasy.spi.interception.ClientExecutionContext;
+import org.jboss.resteasy.spi.interception.ClientExecutionInterceptor;
+import org.jboss.resteasy.spi.interception.MessageBodyReaderContext;
+import org.jboss.resteasy.spi.interception.MessageBodyReaderInterceptor;
import org.jboss.resteasy.util.HttpHeaderNames;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.ws.rs.WebApplicationException;
+import java.io.IOException;
+
public class LoggingExecutionInterceptor implements ClientExecutionInterceptor,
MessageBodyReaderInterceptor
{
- private final static Logger logger = LoggerFactory
- .getLogger(LoggingExecutionInterceptor.class);
+ private final static Logger logger = LoggerFactory
+ .getLogger(LoggingExecutionInterceptor.class);
- @SuppressWarnings("unchecked")
- public ClientResponse execute(ClientExecutionContext ctx) throws Exception
- {
- String uri = ctx.getRequest().getUri();
- logger.info(String.format("Reading url %s", uri));
- StopWatch stopWatch = new StopWatch();
- stopWatch.start();
- ClientResponse response = ctx.proceed();
- stopWatch.stop();
- String contentLength = (String) response.getMetadata().getFirst(
- HttpHeaderNames.CONTENT_LENGTH);
- logger.info(String.format("Read url %s in %d ms size %s.", uri,
- stopWatch.getTime(), contentLength));
- return response;
- }
+ @SuppressWarnings("unchecked")
+ public ClientResponse execute(ClientExecutionContext ctx) throws Exception
+ {
+ String uri = ctx.getRequest().getUri();
+ logger.info(String.format("Reading url %s", uri));
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ ClientResponse response = ctx.proceed();
+ stopWatch.stop();
+ String contentLength = (String) response.getMetadata().getFirst(
+ HttpHeaderNames.CONTENT_LENGTH);
+ logger.info(String.format("Read url %s in %d ms size %s.", uri,
+ stopWatch.getTime(), contentLength));
+ return response;
+ }
- public Object read(MessageBodyReaderContext ctx) throws IOException,
- WebApplicationException
- {
- StopWatch stopWatch = new StopWatch();
- stopWatch.start();
- try
- {
- return ctx.proceed();
- } finally
- {
- stopWatch.stop();
- logger.info(String.format("Read mediaType %s as %s in %d ms.", ctx
- .getMediaType().toString(), ctx.getType().getName(),
- stopWatch.getTime()));
- }
- }
+ public Object read(MessageBodyReaderContext ctx) throws IOException,
+ WebApplicationException
+ {
+ StopWatch stopWatch = new StopWatch();
+ stopWatch.start();
+ try
+ {
+ return ctx.proceed();
+ }
+ finally
+ {
+ stopWatch.stop();
+ logger.info(String.format("Read mediaType %s as %s in %d ms.", ctx
+ .getMediaType().toString(), ctx.getType().getName(),
+ stopWatch.getTime()));
+ }
+ }
}
View
@@ -18,5 +18,7 @@
<module>spring-hibernate-contacts</module>
<module>simple</module>
<module>async-job-service</module>
+ <module>api-clients</module>
+ <module>resteasy-springMVC</module>
</modules>
</project>
Oops, something went wrong.

0 comments on commit 778df21

Please sign in to comment.