Inject repository from service provider

This commit is contained in:
René Pfeuffer
2018-09-10 14:00:13 +02:00
parent 8c675f5dd8
commit ce518ad784
13 changed files with 66 additions and 69 deletions

View File

@@ -58,13 +58,13 @@ public class SvnRepositoryServiceResolver implements RepositoryServiceResolver
*
*
* @param handler
* @param httpScmProtocol
* @param protocolWrapper
*/
@Inject
public SvnRepositoryServiceResolver(SvnRepositoryHandler handler, SvnScmProtocolProviderWrapper httpScmProtocol)
public SvnRepositoryServiceResolver(SvnRepositoryHandler handler, SvnScmProtocolProviderWrapper protocolWrapper)
{
this.handler = handler;
this.httpScmProtocol = httpScmProtocol;
this.protocolWrapper = protocolWrapper;
}
//~--- methods --------------------------------------------------------------
@@ -84,7 +84,7 @@ public class SvnRepositoryServiceResolver implements RepositoryServiceResolver
if (TYPE.equalsIgnoreCase(repository.getType()))
{
provider = new SvnRepositoryServiceProvider(handler, repository, httpScmProtocol);
provider = new SvnRepositoryServiceProvider(handler, repository, protocolWrapper.get(repository));
}
return provider;
@@ -95,5 +95,5 @@ public class SvnRepositoryServiceResolver implements RepositoryServiceResolver
/** Field description */
private SvnRepositoryHandler handler;
private final HttpScmProtocol httpScmProtocol;
private final InitializingHttpScmProtocolWrapper protocolWrapper;
}

View File

@@ -45,7 +45,6 @@ import sonia.scm.repository.Repository;
import sonia.scm.repository.RepositoryProvider;
import sonia.scm.repository.RepositoryRequestListenerUtil;
import sonia.scm.repository.SvnRepositoryHandler;
import sonia.scm.repository.spi.HttpScmProtocol;
import sonia.scm.util.AssertUtil;
import sonia.scm.util.HttpUtil;
@@ -63,7 +62,7 @@ import java.io.IOException;
* @author Sebastian Sdorra
*/
@Singleton
public class SvnDAVServlet extends DAVServlet implements HttpScmProtocol
public class SvnDAVServlet extends DAVServlet
{
/** Field description */
@@ -285,7 +284,7 @@ public class SvnDAVServlet extends DAVServlet implements HttpScmProtocol
private final RepositoryProvider repositoryProvider;
}
@Override
// @Override
public void serve(HttpServletRequest request, HttpServletResponse response, ServletConfig config) throws ServletException, IOException {
service(request, response);
}