summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-05-16 13:50:59 -0400
committerJames Moger <james.moger@gitblit.com>2014-07-03 16:20:37 -0400
commit1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27 (patch)
tree99a983c404c4de3c5455bfa7aca89e4eb4e9bfa7 /src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
parent1fc1bda84e06f36a787ed84d681025e1e921c7f9 (diff)
downloadgitblit-1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27.tar.gz
gitblit-1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27.zip
Embrace @Inject for Managers, Servlets, and Filters
Diffstat (limited to 'src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java')
-rw-r--r--src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java b/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
index 150dd68a..e596cfd3 100644
--- a/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
+++ b/src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
@@ -19,13 +19,15 @@ import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
+import javax.inject.Inject;
+import javax.inject.Singleton;
import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.gitblit.IStoredSettings;
import com.gitblit.Keys;
-import com.gitblit.dagger.DaggerServlet;
import com.gitblit.manager.IAuthenticationManager;
import com.gitblit.manager.IRepositoryManager;
import com.gitblit.manager.IUserManager;
@@ -33,15 +35,14 @@ import com.gitblit.models.RepositoryModel;
import com.gitblit.models.UserModel;
import com.gitblit.utils.StringUtils;
-import dagger.ObjectGraph;
-
/**
* Handles requests for Sparkleshare Invites
*
* @author James Moger
*
*/
-public class SparkleShareInviteServlet extends DaggerServlet {
+@Singleton
+public class SparkleShareInviteServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@@ -53,12 +54,17 @@ public class SparkleShareInviteServlet extends DaggerServlet {
private IRepositoryManager repositoryManager;
- @Override
- protected void inject(ObjectGraph dagger) {
- this.settings = dagger.get(IStoredSettings.class);
- this.userManager = dagger.get(IUserManager.class);
- this.authenticationManager = dagger.get(IAuthenticationManager.class);
- this.repositoryManager = dagger.get(IRepositoryManager.class);
+ @Inject
+ public SparkleShareInviteServlet(
+ IStoredSettings settings,
+ IUserManager userManager,
+ IAuthenticationManager authenticationManager,
+ IRepositoryManager repositoryManager) {
+
+ this.settings = settings;
+ this.userManager = userManager;
+ this.authenticationManager = authenticationManager;
+ this.repositoryManager = repositoryManager;
}
@Override