diff options
author | James Moger <james.moger@gitblit.com> | 2014-05-16 13:50:59 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-07-03 16:20:37 -0400 |
commit | 1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27 (patch) | |
tree | 99a983c404c4de3c5455bfa7aca89e4eb4e9bfa7 /src/main/java/com/gitblit/servlet/RobotsTxtServlet.java | |
parent | 1fc1bda84e06f36a787ed84d681025e1e921c7f9 (diff) | |
download | gitblit-1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27.tar.gz gitblit-1b34b05f5b8d2d0fd51819b286e22d7ddd27cb27.zip |
Embrace @Inject for Managers, Servlets, and Filters
Diffstat (limited to 'src/main/java/com/gitblit/servlet/RobotsTxtServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/RobotsTxtServlet.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java b/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java index 9bd3b3c3..e08c6bbd 100644 --- a/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java +++ b/src/main/java/com/gitblit/servlet/RobotsTxtServlet.java @@ -18,32 +18,33 @@ package com.gitblit.servlet; import java.io.File;
import java.io.IOException;
+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.Keys;
-import com.gitblit.dagger.DaggerServlet;
import com.gitblit.manager.IRuntimeManager;
import com.gitblit.utils.FileUtils;
-import dagger.ObjectGraph;
-
/**
* Handles requests for robots.txt
*
* @author James Moger
*
*/
-public class RobotsTxtServlet extends DaggerServlet {
+@Singleton
+public class RobotsTxtServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private IRuntimeManager runtimeManager;
- @Override
- protected void inject(ObjectGraph dagger) {
- this.runtimeManager = dagger.get(IRuntimeManager.class);
+ @Inject
+ public RobotsTxtServlet(IRuntimeManager runtimeManager) {
+ this.runtimeManager = runtimeManager;
}
@Override
|