]> source.dussan.org Git - gitblit.git/commitdiff
Remove @Inject references because they confuse JEE containers
authorJames Moger <james.moger@gitblit.com>
Tue, 10 Dec 2013 16:04:46 +0000 (11:04 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 10 Dec 2013 16:04:46 +0000 (11:04 -0500)
Change-Id: I2e4a8e7424e7c62d1e89ca62a91423fdf3e36ac8

19 files changed:
src/main/java/com/gitblit/DaggerModule.java
src/main/java/com/gitblit/dagger/DaggerWicketFilter.java [deleted file]
src/main/java/com/gitblit/git/GitServlet.java
src/main/java/com/gitblit/servlet/BranchGraphServlet.java
src/main/java/com/gitblit/servlet/DownloadZipFilter.java
src/main/java/com/gitblit/servlet/DownloadZipServlet.java
src/main/java/com/gitblit/servlet/EnforceAuthenticationFilter.java
src/main/java/com/gitblit/servlet/FederationServlet.java
src/main/java/com/gitblit/servlet/GitFilter.java
src/main/java/com/gitblit/servlet/LogoServlet.java
src/main/java/com/gitblit/servlet/PagesFilter.java
src/main/java/com/gitblit/servlet/PagesServlet.java
src/main/java/com/gitblit/servlet/RobotsTxtServlet.java
src/main/java/com/gitblit/servlet/RpcFilter.java
src/main/java/com/gitblit/servlet/RpcServlet.java
src/main/java/com/gitblit/servlet/SparkleShareInviteServlet.java
src/main/java/com/gitblit/servlet/SyndicationFilter.java
src/main/java/com/gitblit/servlet/SyndicationServlet.java
src/main/java/com/gitblit/wicket/GitblitWicketFilter.java

index 857f36a22792aeee40bbeb1122754db7610c6da8..b12510c956e7312e1bbcb74b2a6b75ff5aff4dd3 100644 (file)
@@ -17,8 +17,6 @@ package com.gitblit;
 
 import javax.inject.Singleton;
 
-import org.apache.wicket.protocol.http.WebApplication;
-
 import com.gitblit.git.GitServlet;
 import com.gitblit.manager.AuthenticationManager;
 import com.gitblit.manager.FederationManager;
@@ -176,7 +174,7 @@ public class DaggerModule {
                                federationManager);
        }
 
-       @Provides @Singleton WebApplication provideWebApplication(
+       @Provides @Singleton GitBlitWebApp provideWebApplication(
                        IRuntimeManager runtimeManager,
                        INotificationManager notificationManager,
                        IUserManager userManager,
@@ -196,4 +194,146 @@ public class DaggerModule {
                                federationManager,
                                gitblit);
        }
+
+       @Provides @Singleton GitblitWicketFilter provideGitblitWicketFilter(GitBlitWebApp webapp) {
+               return new GitblitWicketFilter(webapp);
+       }
+
+       @Provides GitServlet provideGitServlet(IGitblit gitblit) {
+               return new GitServlet(gitblit);
+       }
+
+       @Provides GitFilter provideGitFilter(
+                       IRuntimeManager runtimeManager,
+                       IUserManager userManager,
+                       IAuthenticationManager authenticationManager,
+                       IRepositoryManager repositoryManager,
+                       IFederationManager federationManager) {
+
+               return new GitFilter(
+                               runtimeManager,
+                               userManager,
+                               authenticationManager,
+                               repositoryManager,
+                               federationManager);
+       }
+
+       @Provides @Singleton PagesServlet providePagesServlet(
+                       IRuntimeManager runtimeManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new PagesServlet(runtimeManager, repositoryManager);
+       }
+
+       @Provides @Singleton PagesFilter providePagesFilter(
+                       IRuntimeManager runtimeManager,
+                       IAuthenticationManager authenticationManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new PagesFilter(
+                               runtimeManager,
+                               authenticationManager,
+                               repositoryManager);
+       }
+
+       @Provides @Singleton RpcServlet provideRpcServlet(IGitblit gitblit) {
+               return new RpcServlet(gitblit);
+       }
+
+       @Provides @Singleton RpcFilter provideRpcFilter(
+                       IRuntimeManager runtimeManager,
+                       IAuthenticationManager authenticationManager) {
+
+               return new RpcFilter(runtimeManager, authenticationManager);
+       }
+
+       @Provides @Singleton DownloadZipServlet provideDownloadZipServlet(
+                       IRuntimeManager runtimeManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new DownloadZipServlet(runtimeManager, repositoryManager);
+       }
+
+       @Provides @Singleton DownloadZipFilter provideDownloadZipFilter(
+                       IRuntimeManager runtimeManager,
+                       IAuthenticationManager authenticationManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new DownloadZipFilter(
+                               runtimeManager,
+                               authenticationManager,
+                               repositoryManager);
+       }
+
+       @Provides @Singleton SyndicationServlet provideSyndicationServlet(
+                       IRuntimeManager runtimeManager,
+                       IRepositoryManager repositoryManager,
+                       IProjectManager projectManager) {
+
+               return new SyndicationServlet(
+                               runtimeManager,
+                               repositoryManager,
+                               projectManager);
+       }
+
+       @Provides @Singleton SyndicationFilter provideSyndicationFilter(
+                       IRuntimeManager runtimeManager,
+                       IAuthenticationManager authenticationManager,
+                       IRepositoryManager repositoryManager,
+                       IProjectManager projectManager) {
+
+               return new SyndicationFilter(
+                               runtimeManager,
+                               authenticationManager,
+                               repositoryManager,
+                               projectManager);
+       }
+
+       @Provides @Singleton FederationServlet provideFederationServlet(
+                       IRuntimeManager runtimeManager,
+                       IUserManager userManager,
+                       IRepositoryManager repositoryManager,
+                       IFederationManager federationManager) {
+
+               return new FederationServlet(
+                               runtimeManager,
+                               userManager,
+                               repositoryManager,
+                               federationManager);
+       }
+
+       @Provides @Singleton SparkleShareInviteServlet provideSparkleshareInviteServlet(
+                       IRuntimeManager runtimeManager,
+                       IUserManager userManager,
+                       IAuthenticationManager authenticationManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new SparkleShareInviteServlet(
+                               runtimeManager,
+                               userManager,
+                               authenticationManager,
+                               repositoryManager);
+       }
+
+       @Provides @Singleton BranchGraphServlet provideBranchGraphServlet(
+                       IRuntimeManager runtimeManager,
+                       IRepositoryManager repositoryManager) {
+
+               return new BranchGraphServlet(runtimeManager, repositoryManager);
+       }
+
+       @Provides @Singleton RobotsTxtServlet provideRobotsTxtServlet(IRuntimeManager runtimeManager) {
+               return new RobotsTxtServlet(runtimeManager);
+       }
+
+       @Provides @Singleton LogoServlet provideLogoServlet(IRuntimeManager runtimeManager) {
+               return new LogoServlet(runtimeManager);
+       }
+
+       @Provides @Singleton EnforceAuthenticationFilter provideEnforceAuthenticationFilter(
+                       IRuntimeManager runtimeManager,
+                       IAuthenticationManager authenticationManager) {
+
+               return new EnforceAuthenticationFilter(runtimeManager, authenticationManager);
+       }
 }
\ No newline at end of file
diff --git a/src/main/java/com/gitblit/dagger/DaggerWicketFilter.java b/src/main/java/com/gitblit/dagger/DaggerWicketFilter.java
deleted file mode 100644 (file)
index b778f1f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2013 gitblit.com.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gitblit.dagger;
-
-import groovy.lang.Singleton;
-
-import javax.inject.Inject;
-import javax.inject.Provider;
-
-import org.apache.wicket.protocol.http.IWebApplicationFactory;
-import org.apache.wicket.protocol.http.WebApplication;
-import org.apache.wicket.protocol.http.WicketFilter;
-
-/**
- *
- * A Wicket filter that supports Dagger injection.
- *
- * @author James Moger
- *
- */
-@Singleton
-public class DaggerWicketFilter extends WicketFilter {
-
-       @Inject
-       Provider<WebApplication> webApplicationProvider;
-
-       @Inject
-       public DaggerWicketFilter() {
-               super();
-       }
-
-       @Override
-       protected IWebApplicationFactory getApplicationFactory() {
-               return new IWebApplicationFactory() {
-                       @Override
-                       public WebApplication createApplication(WicketFilter filter) {
-                               return webApplicationProvider.get();
-                       }
-               };
-       }
-}
index db671e4b07ead4531a655650da931f59b6bebe15..cf54e6d34454a7bdbb4c1baf0ef1f9f2d19ed5cb 100644 (file)
@@ -15,7 +15,6 @@
  */\r
 package com.gitblit.git;\r
 \r
-import javax.inject.Inject;\r
 import javax.servlet.ServletConfig;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServletRequest;\r
@@ -35,7 +34,6 @@ public class GitServlet extends org.eclipse.jgit.http.server.GitServlet {
 \r
        private final IGitblit gitblit;\r
 \r
-       @Inject\r
        public GitServlet(IGitblit gitblit) {\r
                super();\r
                this.gitblit = gitblit;\r
index 3efe60de5a2f883b1d5f16dc0be1d1267e2f1c46..1f6d3a87be9ad306e96236c3f15b5a96916efb5c 100644 (file)
@@ -36,8 +36,6 @@ import java.util.Set;
 import java.util.TreeSet;\r
 \r
 import javax.imageio.ImageIO;\r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
 import javax.servlet.http.HttpServletRequest;\r
@@ -55,7 +53,6 @@ import org.eclipse.jgit.revwalk.RevCommit;
 import com.gitblit.Constants;\r
 import com.gitblit.IStoredSettings;\r
 import com.gitblit.Keys;\r
-import com.gitblit.Keys.web;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.utils.JGitUtils;\r
@@ -67,7 +64,6 @@ import com.gitblit.utils.StringUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class BranchGraphServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -85,7 +81,6 @@ public class BranchGraphServlet extends HttpServlet {
 \r
        private final IRepositoryManager repositoryManager;\r
 \r
-       @Inject\r
        public BranchGraphServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IRepositoryManager repositoryManager) {\r
index 398121d3fcabc4801bbd361d5350b1987432a36a..30bb9cb95522a4b15a30a37181c7bbef2eeab00d 100644 (file)
  */\r
 package com.gitblit.servlet;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
-\r
 import com.gitblit.Constants.AccessRestrictionType;\r
+import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
-import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
 \r
@@ -33,10 +30,8 @@ import com.gitblit.models.UserModel;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class DownloadZipFilter extends AccessRestrictionFilter {\r
 \r
-       @Inject\r
        public DownloadZipFilter(\r
                        IRuntimeManager runtimeManager,\r
                        IAuthenticationManager authenticationManager,\r
index d26f73ea15fea99d91d7608204d20184a9a24b1c..437a9c2618e9364f9a69f85b5b5dc8336d9887d0 100644 (file)
@@ -20,8 +20,6 @@ import java.text.MessageFormat;
 import java.text.ParseException;\r
 import java.util.Date;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
 import javax.servlet.http.HttpServletResponse;\r
@@ -34,7 +32,6 @@ import org.slf4j.LoggerFactory;
 import com.gitblit.Constants;\r
 import com.gitblit.IStoredSettings;\r
 import com.gitblit.Keys;\r
-import com.gitblit.Keys.web;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.utils.CompressionUtils;\r
@@ -49,7 +46,6 @@ import com.gitblit.utils.StringUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class DownloadZipServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -79,7 +75,6 @@ public class DownloadZipServlet extends HttpServlet {
                }\r
        }\r
 \r
-       @Inject\r
        public DownloadZipServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IRepositoryManager repositoryManager) {\r
index 6655c6e180d1db97c9b3a55ee8e77286284935e8..b129c0ca2f7ac4c43af5f1381eaad60279589678 100644 (file)
@@ -18,8 +18,6 @@
 import java.io.IOException;
 import java.text.MessageFormat;
 
-import javax.inject.Inject;
-import javax.inject.Singleton;
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
@@ -34,9 +32,8 @@ import org.slf4j.LoggerFactory;
 
 import com.gitblit.IStoredSettings;
 import com.gitblit.Keys;
-import com.gitblit.Keys.web;
-import com.gitblit.manager.IRuntimeManager;
 import com.gitblit.manager.IAuthenticationManager;
+import com.gitblit.manager.IRuntimeManager;
 import com.gitblit.models.UserModel;
 
 /**
@@ -47,7 +44,6 @@ import com.gitblit.models.UserModel;
  * @author Laurens Vrijnsen
  *
  */
-@Singleton
 public class EnforceAuthenticationFilter implements Filter {
 
        protected transient Logger logger = LoggerFactory.getLogger(getClass());
@@ -56,7 +52,6 @@ public class EnforceAuthenticationFilter implements Filter {
 
        private final IAuthenticationManager authenticationManager;
 
-       @Inject
        public EnforceAuthenticationFilter(
                        IRuntimeManager runtimeManager,
                        IAuthenticationManager authenticationManager) {
index 4d3cbbe288b80df427df05417f49eaa2f7206c2c..8d352feb554e0713e1fbf934737d9fbbe335741e 100644 (file)
@@ -25,8 +25,6 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.Set;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.http.HttpServletResponse;\r
 \r
 import com.gitblit.Constants.FederationRequest;\r
@@ -52,7 +50,6 @@ import com.gitblit.utils.TimeUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class FederationServlet extends JsonServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -65,7 +62,6 @@ public class FederationServlet extends JsonServlet {
 \r
        private final IFederationManager federationManager;\r
 \r
-       @Inject\r
        public FederationServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IUserManager userManager,\r
index 15facbe8d1ad16235d6d5fb7617e2b3efae7300d..58a45ca22b5dc1470e59765cf79428fa2f8272c6 100644 (file)
@@ -17,7 +17,6 @@ package com.gitblit.servlet;
 \r
 import java.text.MessageFormat;\r
 \r
-import javax.inject.Inject;\r
 import javax.servlet.http.HttpServletRequest;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
@@ -57,7 +56,6 @@ public class GitFilter extends AccessRestrictionFilter {
 \r
        private final IFederationManager federationManager;\r
 \r
-       @Inject\r
        public GitFilter(\r
                        IRuntimeManager runtimeManager,\r
                        IUserManager userManager,\r
index e91fad056ae5e8449685153c71497fdef1040381..e39cc695bb2f8bd4c27effa0575b19f6b76d020f 100644 (file)
@@ -21,8 +21,6 @@ import java.io.IOException;
 import java.io.InputStream;\r
 import java.io.OutputStream;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletContext;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
@@ -30,7 +28,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;\r
 \r
 import com.gitblit.Keys;\r
-import com.gitblit.Keys.web;\r
 import com.gitblit.manager.IRuntimeManager;\r
 \r
 /**\r
@@ -39,7 +36,6 @@ import com.gitblit.manager.IRuntimeManager;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class LogoServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -48,7 +44,6 @@ public class LogoServlet extends HttpServlet {
 \r
        private final IRuntimeManager runtimeManager;\r
 \r
-       @Inject\r
        public LogoServlet(IRuntimeManager runtimeManager) {\r
                super();\r
                this.runtimeManager = runtimeManager;\r
index 42e7de75038b9cd2cdaa4a166bb3a231eff87008..fd7b10fe0b122843757fb095496ce9bf77c66de9 100644 (file)
  */\r
 package com.gitblit.servlet;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
-\r
 import org.eclipse.jgit.lib.Repository;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
+import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
-import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
 \r
@@ -34,10 +31,8 @@ import com.gitblit.models.UserModel;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class PagesFilter extends AccessRestrictionFilter {\r
 \r
-       @Inject\r
        public PagesFilter(IRuntimeManager runtimeManager,\r
                        IAuthenticationManager authenticationManager,\r
                        IRepositoryManager repositoryManager) {\r
index 6146f1329b27eded7a00dd8aeaf37c2ece3c9a8c..8b91b48699636ed00d38674ce236047e592c8978 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Set;
 import java.util.TreeSet;\r
 \r
 import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletContext;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
@@ -40,7 +39,6 @@ import org.slf4j.LoggerFactory;
 import com.gitblit.Constants;\r
 import com.gitblit.IStoredSettings;\r
 import com.gitblit.Keys;\r
-import com.gitblit.Keys.web;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.models.PathModel;\r
@@ -59,7 +57,6 @@ import com.gitblit.wicket.MarkupProcessor.MarkupDocument;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class PagesServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -70,7 +67,6 @@ public class PagesServlet extends HttpServlet {
 \r
        private final IRepositoryManager repositoryManager;\r
 \r
-       @Inject\r
        public PagesServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IRepositoryManager repositoryManager) {\r
index c93675a02a21e89fd6c7a76abe9bcc092b2edea2..94cc832ad681be663e2fd457ee0c96bd15a75a33 100644 (file)
@@ -18,16 +18,12 @@ package com.gitblit.servlet;
 import java.io.File;\r
 import java.io.IOException;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
 import javax.servlet.http.HttpServletRequest;\r
 import javax.servlet.http.HttpServletResponse;\r
 \r
 import com.gitblit.Keys;\r
-import com.gitblit.Keys.web;\r
-import com.gitblit.Keys.web.robots;\r
 import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.utils.FileUtils;\r
 \r
@@ -37,14 +33,12 @@ import com.gitblit.utils.FileUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class RobotsTxtServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
 \r
        private final IRuntimeManager runtimeManager;\r
 \r
-       @Inject\r
        public RobotsTxtServlet(IRuntimeManager runtimeManager) {\r
                super();\r
                this.runtimeManager = runtimeManager;\r
index f39d37d8acdf543831e9cf11975a9739621ccf62..fc838724224085f10753fb7a5bd8869dacce0e52 100644 (file)
@@ -18,8 +18,6 @@ package com.gitblit.servlet;
 import java.io.IOException;\r
 import java.text.MessageFormat;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.FilterChain;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.ServletRequest;\r
@@ -30,8 +28,8 @@ import javax.servlet.http.HttpServletResponse;
 import com.gitblit.Constants.RpcRequest;\r
 import com.gitblit.IStoredSettings;\r
 import com.gitblit.Keys;\r
-import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.manager.IAuthenticationManager;\r
+import com.gitblit.manager.IRuntimeManager;\r
 import com.gitblit.models.UserModel;\r
 \r
 /**\r
@@ -47,14 +45,12 @@ import com.gitblit.models.UserModel;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class RpcFilter extends AuthenticationFilter {\r
 \r
        private final IStoredSettings settings;\r
 \r
        private final IRuntimeManager runtimeManager;\r
 \r
-       @Inject\r
        public RpcFilter(\r
                        IRuntimeManager runtimeManager,\r
                        IAuthenticationManager authenticationManager) {\r
index 856bd839180570c6b20e116c9938070f4c43dee2..a5d892fe4a4c0c2a43556a2839f2f2c981a4fd6e 100644 (file)
@@ -23,8 +23,6 @@ import java.util.HashMap;
 import java.util.List;\r
 import java.util.Map;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServletRequest;\r
 import javax.servlet.http.HttpServletResponse;\r
@@ -55,7 +53,6 @@ import com.gitblit.utils.StringUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class RpcServlet extends JsonServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -66,7 +63,6 @@ public class RpcServlet extends JsonServlet {
 \r
        private final IGitblit gitblit;\r
 \r
-       @Inject\r
        public RpcServlet(IGitblit gitblit) {\r
 \r
                super();\r
index 5d2532d47972646a12ee231bdd0faa5465c1b871..709e22ef495822009a6d7cc76cf649fad44ba887 100644 (file)
@@ -18,8 +18,6 @@ package com.gitblit.servlet;
 import java.io.IOException;\r
 import java.text.MessageFormat;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.http.HttpServlet;\r
 import javax.servlet.http.HttpServletRequest;\r
@@ -42,7 +40,6 @@ import com.gitblit.utils.StringUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class SparkleShareInviteServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -55,7 +52,6 @@ public class SparkleShareInviteServlet extends HttpServlet {
 \r
        private final IRepositoryManager repositoryManager;\r
 \r
-       @Inject\r
        public SparkleShareInviteServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IUserManager userManager,\r
index 7eb8af96d24b4861a0ce78195429095bfa00d9f2..e4e5e1d6828a8937370a4c9bd60c4e1086f22278 100644 (file)
@@ -18,8 +18,6 @@ package com.gitblit.servlet;
 import java.io.IOException;\r
 import java.text.MessageFormat;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.FilterChain;\r
 import javax.servlet.ServletException;\r
 import javax.servlet.ServletRequest;\r
@@ -28,10 +26,10 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
+import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.manager.IProjectManager;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
-import com.gitblit.manager.IAuthenticationManager;\r
 import com.gitblit.models.ProjectModel;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.UserModel;\r
@@ -44,14 +42,12 @@ import com.gitblit.models.UserModel;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class SyndicationFilter extends AuthenticationFilter {\r
 \r
        private final IRuntimeManager runtimeManager;\r
        private final IRepositoryManager repositoryManager;\r
        private final IProjectManager projectManager;\r
 \r
-       @Inject\r
        public SyndicationFilter(\r
                        IRuntimeManager runtimeManager,\r
                        IAuthenticationManager authenticationManager,\r
index a35efa830cc124c6010bd44c64ccc243fd8a4728..a9555f7d9f5a448738efcadc6a27e8dfcb05e268 100644 (file)
@@ -22,8 +22,6 @@ import java.util.Collections;
 import java.util.List;\r
 import java.util.Map;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.http.HttpServlet;\r
 \r
 import org.eclipse.jgit.lib.ObjectId;\r
@@ -58,7 +56,6 @@ import com.gitblit.utils.SyndicationUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
 public class SyndicationServlet extends HttpServlet {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -71,7 +68,6 @@ public class SyndicationServlet extends HttpServlet {
 \r
        private final IProjectManager projectManager;\r
 \r
-       @Inject\r
        public SyndicationServlet(\r
                        IRuntimeManager runtimeManager,\r
                        IRepositoryManager repositoryManager,\r
index 87b0a08f06142488e0bef105c3964d66ea0bdc0b..9e554708472b7e68cc4060994ded4e0ad78798f0 100644 (file)
@@ -17,17 +17,17 @@ package com.gitblit.wicket;
 \r
 import java.util.Date;\r
 \r
-import javax.inject.Inject;\r
-import javax.inject.Singleton;\r
 import javax.servlet.http.HttpServletRequest;\r
 \r
+import org.apache.wicket.protocol.http.IWebApplicationFactory;\r
+import org.apache.wicket.protocol.http.WebApplication;\r
+import org.apache.wicket.protocol.http.WicketFilter;\r
 import org.apache.wicket.util.string.Strings;\r
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.IStoredSettings;\r
 import com.gitblit.Keys;\r
-import com.gitblit.dagger.DaggerWicketFilter;\r
 import com.gitblit.manager.IProjectManager;\r
 import com.gitblit.manager.IRepositoryManager;\r
 import com.gitblit.manager.IRuntimeManager;\r
@@ -44,8 +44,7 @@ import com.gitblit.utils.StringUtils;
  * @author James Moger\r
  *\r
  */\r
-@Singleton\r
-public class GitblitWicketFilter extends DaggerWicketFilter {\r
+public class GitblitWicketFilter extends WicketFilter {\r
 \r
        private final IStoredSettings settings;\r
 \r
@@ -55,17 +54,26 @@ public class GitblitWicketFilter extends DaggerWicketFilter {
 \r
        private final IProjectManager projectManager;\r
 \r
-       @Inject\r
-       public GitblitWicketFilter(\r
-                       IRuntimeManager runtimeManager,\r
-                       IRepositoryManager repositoryManager,\r
-                       IProjectManager projectManager) {\r
+       private final GitBlitWebApp webapp;\r
+\r
+       public GitblitWicketFilter(GitBlitWebApp webapp) {\r
 \r
                super();\r
-               this.settings = runtimeManager.getSettings();\r
-               this.runtimeManager = runtimeManager;\r
-               this.repositoryManager = repositoryManager;\r
-               this.projectManager = projectManager;\r
+               this.settings = webapp.settings();\r
+               this.runtimeManager = webapp.runtime();\r
+               this.repositoryManager = webapp.repositories();\r
+               this.projectManager = webapp.projects();\r
+               this.webapp = webapp;\r
+       }\r
+\r
+       @Override\r
+       protected IWebApplicationFactory getApplicationFactory() {\r
+               return new IWebApplicationFactory() {\r
+                       @Override\r
+                       public WebApplication createApplication(WicketFilter filter) {\r
+                               return webapp;\r
+                       }\r
+               };\r
        }\r
 \r
        /**\r