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/PtServlet.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/PtServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/PtServlet.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/servlet/PtServlet.java b/src/main/java/com/gitblit/servlet/PtServlet.java index e9cbaa5b..65d3de17 100644 --- a/src/main/java/com/gitblit/servlet/PtServlet.java +++ b/src/main/java/com/gitblit/servlet/PtServlet.java @@ -21,7 +21,10 @@ import java.io.IOException; import java.io.InputStream;
import java.io.OutputStream;
+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;
@@ -34,11 +37,8 @@ import org.apache.commons.compress.compressors.CompressorStreamFactory; import org.apache.wicket.util.io.ByteArrayOutputStream;
import org.eclipse.jgit.lib.FileMode;
-import com.gitblit.dagger.DaggerServlet;
import com.gitblit.manager.IRuntimeManager;
-import dagger.ObjectGraph;
-
/**
* Handles requests for the Barnum pt (patchset tool).
*
@@ -47,7 +47,8 @@ import dagger.ObjectGraph; * @author James Moger
*
*/
-public class PtServlet extends DaggerServlet {
+@Singleton
+public class PtServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@@ -55,9 +56,9 @@ public class PtServlet extends DaggerServlet { private IRuntimeManager runtimeManager;
- @Override
- protected void inject(ObjectGraph dagger) {
- this.runtimeManager = dagger.get(IRuntimeManager.class);
+ @Inject
+ public PtServlet(IRuntimeManager runtimeManager) {
+ this.runtimeManager = runtimeManager;
}
@Override
|