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/LogoServlet.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/LogoServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/LogoServlet.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/com/gitblit/servlet/LogoServlet.java b/src/main/java/com/gitblit/servlet/LogoServlet.java index 96f34afd..489e98b2 100644 --- a/src/main/java/com/gitblit/servlet/LogoServlet.java +++ b/src/main/java/com/gitblit/servlet/LogoServlet.java @@ -21,24 +21,25 @@ import java.io.IOException; import java.io.InputStream;
import java.io.OutputStream;
+import javax.inject.Inject;
+import javax.inject.Singleton;
import javax.servlet.ServletContext;
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 dagger.ObjectGraph;
-
/**
* Handles requests for logo.png
*
* @author James Moger
*
*/
-public class LogoServlet extends DaggerServlet {
+@Singleton
+public class LogoServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
@@ -46,9 +47,9 @@ public class LogoServlet extends DaggerServlet { private IRuntimeManager runtimeManager;
- @Override
- protected void inject(ObjectGraph dagger) {
- this.runtimeManager = dagger.get(IRuntimeManager.class);
+ @Inject
+ public LogoServlet(IRuntimeManager runtimeManager) {
+ this.runtimeManager = runtimeManager;
}
@Override
|