final version of google collections

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2607 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2010-01-06 02:57:55 +00:00
parent cdac09e973
commit 83ff721365
2 changed files with 21 additions and 5 deletions

View File

@ -71,7 +71,7 @@
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>1.0-rc5</version>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>

View File

@ -1,4 +1,4 @@
/**
i/**
*
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
*
@ -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<Set<String>, List<StoredTweetStatus>> {
Function<Set<String>, List<StoredTweetStatus>>, 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<String, BlobStoreContext<?, ?>> contexts,
public AddTweetsController(Map<String, BlobStoreContext<?, ?>> contexts,
ServiceToStoredTweetStatuses blobStoreContextToContainerResult) {
this.contexts = contexts;
this.blobStoreContextToContainerResult = blobStoreContextToContainerResult;
@ -93,4 +99,14 @@ public class AddTweetsController extends HttpServlet implements
}
return statuses;
}
}
@Override
public void setServletContext(ServletContext context) {
this.servletContext = context;
}
@Override
public ServletContext getServletContext() {
return checkNotNull(servletContext, "servletContext");
}
}