diff --git a/core/pom.xml b/core/pom.xml index 3dfaed4e53..17d8cbab15 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -71,7 +71,7 @@ com.google.collections google-collections - 1.0-rc5 + 1.0 javax.annotation diff --git a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java b/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java index ad743eb967..2bb2348b9f 100755 --- a/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java +++ b/demos/gae-tweetstore/src/main/java/org/jclouds/demo/tweetstore/controller/AddTweetsController.java @@ -1,4 +1,4 @@ -/** +i/** * * Copyright (C) 2009 Cloud Conscious, LLC. * @@ -18,6 +18,8 @@ */ package org.jclouds.demo.tweetstore.controller; +import static com.google.common.base.Preconditions.checkNotNull; + import java.io.IOException; import java.util.List; import java.util.Map; @@ -29,6 +31,7 @@ import javax.annotation.Resource; import javax.inject.Inject; import javax.inject.Singleton; import javax.servlet.RequestDispatcher; +import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -38,6 +41,7 @@ import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.demo.tweetstore.domain.StoredTweetStatus; import org.jclouds.demo.tweetstore.functions.ServiceToStoredTweetStatuses; import org.jclouds.logging.Logger; +import org.springframework.web.context.ServletContextAware; import com.google.appengine.repackaged.com.google.common.collect.Lists; import com.google.common.base.Function; @@ -50,7 +54,7 @@ import com.google.common.collect.Iterables; */ @Singleton public class AddTweetsController extends HttpServlet implements - Function, List> { + Function, List>, ServletContextAware { /** The serialVersionUID */ private static final long serialVersionUID = 3888348023150822683L; @@ -60,8 +64,10 @@ public class AddTweetsController extends HttpServlet implements @Resource protected Logger logger = Logger.NULL; + private ServletContext servletContext; + @Inject - AddTweetsController(Map> contexts, + public AddTweetsController(Map> contexts, ServiceToStoredTweetStatuses blobStoreContextToContainerResult) { this.contexts = contexts; this.blobStoreContextToContainerResult = blobStoreContextToContainerResult; @@ -93,4 +99,14 @@ public class AddTweetsController extends HttpServlet implements } return statuses; } -} \ No newline at end of file + + @Override + public void setServletContext(ServletContext context) { + this.servletContext = context; + } + + @Override + public ServletContext getServletContext() { + return checkNotNull(servletContext, "servletContext"); + } +}