diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2011-02-06 16:38:02 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-02-14 18:28:21 -0800 |
commit | 1b7a5a29600e9711548bed267b61e198a058f50b (patch) | |
tree | c9fa99c9707e2a0737f1794f86078b554bf55702 /org.eclipse.jgit.junit.http/src | |
parent | 8235b88a4bb453b6bf5dbfbb6f12f25d3c23793e (diff) | |
download | jgit-1b7a5a29600e9711548bed267b61e198a058f50b.tar.gz jgit-1b7a5a29600e9711548bed267b61e198a058f50b.zip |
daemon: Use HTTP's resolver and factory pattern
Using a resolver and factory pattern for the anonymous git:// Daemon
class makes transport.Daemon more useful on non-file storage systems,
or in embedded applications where the caller wants more precise
control over the work tasks constructed within the daemon.
Rather than defining new interfaces, move the existing HTTP ones
into transport.resolver and make them generic on the connection
handle type. For HTTP, continue to use HttpServletRequest, and
for transport.Daemon use DaemonClient.
To remain compatible with transport.Daemon, FileResolver needs to
learn how to use multiple base directories, and how to export any
Repository instance at a fixed name.
Change-Id: I1efa6b2bd7c6567e983fbbf346947238ea2e847e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.junit.http/src')
-rw-r--r-- | org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java index 987f2118ea..1221e1c887 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java @@ -52,11 +52,11 @@ import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.http.server.GitServlet; -import org.eclipse.jgit.http.server.resolver.RepositoryResolver; -import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepository; import org.eclipse.jgit.transport.URIish; +import org.eclipse.jgit.transport.resolver.RepositoryResolver; +import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; /** * Simple http server for testing http access to Git repositories. @@ -92,7 +92,7 @@ public class SimpleHttpServer { private ServletContextHandler smart(final String path) { GitServlet gs = new GitServlet(); - gs.setRepositoryResolver(new RepositoryResolver() { + gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() { public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { |