public class Daemon extends Object
git://
transport protocol.Constructor and Description |
---|
Daemon(InetSocketAddress addr,
Executor acceptThreadPool,
ExecutorService executorService) |
Daemon(InetSocketAddress addr,
Executor acceptThreadPool,
ExecutorService executorService,
org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
Configures a new daemon for the specified network address.
|
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
getAddress() |
DaemonService |
getService(String name)
Lookup a supported service so it can be reconfigured.
|
int |
getTimeout() |
boolean |
isRunning() |
void |
setRepositoryResolver(org.eclipse.jgit.transport.resolver.RepositoryResolver<DaemonClient> resolver)
Sets the resolver that locates repositories by name.
|
void |
setTimeout(int seconds)
Set the timeout before willing to abort an IO call.
|
void |
setUploadPackFactory(org.eclipse.jgit.transport.resolver.UploadPackFactory<DaemonClient> factory)
Sets the factory that constructs and configures the per-request UploadPack.
|
void |
start()
Starts this daemon listening for connections on a thread supplied by the executor service given to the
constructor.
|
void |
stop()
Stops this daemon.
|
public Daemon(InetSocketAddress addr, Executor acceptThreadPool, ExecutorService executorService)
public Daemon(InetSocketAddress addr, Executor acceptThreadPool, ExecutorService executorService, org.eclipse.jgit.internal.ketch.KetchLeaderCache leaders)
start()
.addr
- address to listen for connections on. If null, any available port will be chosen on all network
interfaces.acceptThreadPool
- source of threads for waiting for inbound socket connections. Every time the daemon is started or
restarted, a new task will be submitted to this pool. When the daemon is stopped, the task completes.public InetSocketAddress getAddress()
public DaemonService getService(String name)
name
- name of the service; e.g. "receive-pack"/"git-receive-pack" or
"upload-pack"/"git-upload-pack".public int getTimeout()
public void setTimeout(int seconds)
seconds
- number of seconds to wait (with no data transfer occurring)
before aborting an IO read or write operation with the
connected client.public void setRepositoryResolver(org.eclipse.jgit.transport.resolver.RepositoryResolver<DaemonClient> resolver)
resolver
- the resolver instance.public void setUploadPackFactory(org.eclipse.jgit.transport.resolver.UploadPackFactory<DaemonClient> factory)
factory
- the factory. If null upload-pack is disabled.public void start() throws IOException
stop()
or by shutting down the ExecutorService.IOException
- the server socket could not be opened.IllegalStateException
- the daemon is already running.public boolean isRunning()
public void stop()
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.