org.tmatesoft.svn.core.wc
public class DefaultSVNRepositoryPool extends Object implements ISVNRepositoryPool, ISVNSession, ISVNConnectionListener
It creates SVNRepository objects that may be stored in a common pool and reused later. The objects common pool may be shared by different threads, but each thread can retrieve only those objects, that have been created within that thread. So, DefaultSVNRepositoryPool is thread-safe. An objects pool may be global during runtime, or it may be private - one separate pool per one DefaultSVNRepositoryPool object. Also there's a possibility to have a DefaultSVNRepositoryPool object with the pool feature disabled (SVNRepository objects instantiated by such a creator are never cached).
DefaultSVNRepositoryPool caches one SVNRepository object per one url protocol (per one thread), that is the number of protocols used equals to the number of objects cached per one thread (if all objects are created as reusable).
Also DefaultSVNRepositoryPool is able to create SVNRepository objects that use a single socket connection (i.e. don't close a connection after every repository access operation but reuse a single one).
Version: 1.1.1
Field Summary | |
---|---|
static int | INSTANCE_POOL
Defines a private pool. |
static int | NO_POOL
Defines a without-pool configuration. |
static int | RUNTIME_POOL
Defines a common shared objects pool. |
Constructor Summary | |
---|---|
DefaultSVNRepositoryPool(ISVNAuthenticationManager authManager, ISVNTunnelProvider tunnelProvider)
Constructs a DefaultSVNRepositoryPool instance
that represents RUNTIME_POOL objects pool.
| |
DefaultSVNRepositoryPool(ISVNAuthenticationManager authManager, ISVNTunnelProvider tunnelProvider, long timeout, boolean keepConnection)
Constructs a DefaultSVNRepositoryPool instance
that represents RUNTIME_POOL objects pool.
| |
DefaultSVNRepositoryPool(ISVNAuthenticationManager authManager, ISVNTunnelProvider tunnelProvider, boolean keepConnections, int poolMode)
Constructs a DefaultSVNRepositoryPool instance.
|
Method Summary | |
---|---|
void | connectionClosed(SVNRepository repository) |
void | connectionOpened(SVNRepository repository) |
SVNRepository | createRepository(SVNURL url, boolean mayReuse)
Creates a new SVNRepository driver object.
if mayReuse is true
and the mode of this DefaultSVNRepositoryPool object is not
NO_POOL then first tries to find the SVNRepository
object in the pool for the given protocol. |
void | dispose() |
String | getCommitMessage(SVNRepository repository, long revision)
Returns null.
|
boolean | hasCommitMessage(SVNRepository repository, long revision)
Returns false.
|
boolean | keepConnection(SVNRepository repository)
Says if the given SVNRepository driver object should
keep a connection opened. |
void | saveCommitMessage(SVNRepository repository, long revision, String message)
Does nothing.
|
void | setAuthenticationManager(ISVNAuthenticationManager authManager) |
void | setCanceller(ISVNCanceller canceller) |
void | setDebugLog(ISVNDebugLog log) |
void | shutdownConnections(boolean shutdownAll)
Closes connections of cached SVNRepository objects.
|
Deprecated:
Defines a private pool. All objects that will be created by different threads will be stored only within this pool object. This allows to have more than one separate pools.Deprecated:
Defines a without-pool configuration. Objects that are created by this DefaultSVNRepositoryPool object are not cached, the pool feature is disabled.Deprecated:
Defines a common shared objects pool. All objects that will be created by different threads will be stored in this common pool.Parameters: authManager an authentication driver tunnelProvider a tunnel provider
Parameters: authManager an authentication driver tunnelProvider a tunnel provider timeout inactivity timeout after which open connections should be closed keepConnection whether to left connection open
Deprecated:
Constructs a DefaultSVNRepositoryPool instance.Parameters: authManager an authentication driver tunnelProvider a tunnel provider keepConnections if true then SVNRepository objects will keep a single connection for accessing a repository, if false - open a new connection per each repository access operation poolMode a mode of this object represented by one of the constant fields of DefaultSVNRepositoryPool
mayReuse
is true
and the mode of this DefaultSVNRepositoryPool object is not
NO_POOL then first tries to find the SVNRepository
object in the pool for the given protocol. If the object is not found,
creates a new one for that protocol, caches it in the pool and returns
back.
NOTE: be careful when simultaneously using several SVNRepository
drivers for the same protocol - since there can be only one driver object in
the pool per a protocol, creating two objects for the same protocol
with mayReuse
set to true,
actually returns the same single object stored in the thread pool.
Parameters: url a repository location for which a driver is to be created mayReuse if true then SVNRepository object is reusable
Returns: a new SVNRepository driver object
Throws: SVNException
Parameters: repository an SVNRepository driver (to distinguish that repository for which a commit message is requested) revision a revision number
Returns: the commit message for revision
Parameters: repository an SVNRepository driver (to distinguish that repository for which a commit message is requested) revision a revision number
Returns: true if the cache has got a message for the given repository and revision, false otherwise
keepConnections
set to true
and if repository
is not created for the
"svn+ssh" protocol (since for this protocol there's
no extra need to keep a connection opened - it remains opened), this
method returns true.
Parameters: repository an SVNRepository driver
Returns: true if the driver should keep a connection
Parameters: repository an SVNRepository driver (to distinguish
that repository for which this message is actual) revision a revision number message the commit message for revision
Parameters: shutdownAll if true - closes connections of all the cached objects, otherwise only connections of those cached objects which owner threads have already disposed
See Also: SVNRepository