Class SimpleWorkingCopyFactory<R,W,C extends RepositoryProvider>

java.lang.Object
sonia.scm.repository.work.SimpleWorkingCopyFactory<R,W,C>
Type Parameters:
R - Type of central repository location
W - Type of working copy for repository
C - Type of repository context
All Implemented Interfaces:
jakarta.servlet.ServletContextListener, EventListener, WorkingCopyFactory<R,W,C>

public abstract class SimpleWorkingCopyFactory<R,W,C extends RepositoryProvider> extends Object implements WorkingCopyFactory<R,W,C>, jakarta.servlet.ServletContextListener
This class is responsible to govern the creation, the reuse and the destruction of working copies. For every repository type there has to be an implementation of this class to provide the repository specific logic to create, initialize, reclaim and clean up working copies. To do this, the following methods have to be implemented:
initialize(C, File, String)
Creates a new clone of the repository for the given context in the given directory with the given branch checked out (if branches are supported).
reclaim(C, File, String)
Reclaim the working directory with a already checked out clone of the repository given in the context, so that the directory is not modified in respect to the repository and the given branch is checked out (if branches are supported).
closeWorkingCopy(W)
Closes resources allocated for the working copy, so that the directory can be put to the cache. Will be called at the end of the operation.
closeRepository(R)
Closes resources allocated for the central repository.

The general process looks like this: