001: /*
002: * ====================================================================
003: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
004: *
005: * This software is licensed as described in the file COPYING, which
006: * you should have received as part of this distribution. The terms
007: * are also available at http://svnkit.com/license.html
008: * If newer versions of this license are posted there, you may use a
009: * newer version instead, at your option.
010: * ====================================================================
011: */
012: package org.tmatesoft.svn.core.wc;
013:
014: import org.tmatesoft.svn.core.ISVNCanceller;
015: import org.tmatesoft.svn.core.SVNException;
016: import org.tmatesoft.svn.core.SVNURL;
017: import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
018: import org.tmatesoft.svn.core.io.SVNRepository;
019: import org.tmatesoft.svn.util.ISVNDebugLog;
020:
021: /**
022: * The <b>ISVNRepositoryPool</b> interface is used by
023: * <b>SVN</b>*<b>Client</b> objects to create a low-level SVN protocol
024: * driver that allows them to directly work with a repository.
025: *
026: * <p>
027: * A default implementation of the <b>ISVNRepositoryPool</b> interface -
028: * <b>DefaultSVNRepositoryPool</b> class - may cache the created
029: * <b>SVNRepository</b> objects in a common pool. Several threads may
030: * share that pool, but each thread is able only to retrieve those objects,
031: * that belong to it (were created in that thread).
032: *
033: * @version 1.1.1
034: * @author TMate Software Ltd.
035: * @see DefaultSVNRepositoryPool
036: */
037: public interface ISVNRepositoryPool {
038:
039: /**
040: * Updates authentication manager instance referenced by SVNRepository objects
041: * currently in the pool.
042: */
043: public void setAuthenticationManager(
044: ISVNAuthenticationManager authManager);
045:
046: /**
047: * Updates canceller instance referenced by SVNRepository objects
048: * currently in the pool.
049: */
050: public void setCanceller(ISVNCanceller canceller);
051:
052: /**
053: * Updates debug log instance referenced by SVNRepository objects
054: * currently in the pool.
055: */
056: public void setDebugLog(ISVNDebugLog log);
057:
058: /**
059: * Creates a low-level SVN protocol driver to access a repository.
060: *
061: * <p>
062: * If <code>mayReuse</code> is <span class="javakeyword">true</span>
063: * and the pool feature for caching <b>SVNRepository</b> objects is supported
064: * by the concrete implementation of this interface, then this method first
065: * tries to find an existing <b>SVNRepository</b> object
066: * in the pool of the current thread. If such an object is found that was
067: * created for the same protocol as <code>url</code> has, then resets this
068: * object to a new <code>url</code> and returns it back. Otherwise creates
069: * a new one, stores it in the thread's pool and returns back.
070: *
071: * <p>
072: * If <code>mayReuse</code> is <span class="javakeyword">false</span>, then
073: * creates a new object, that won't be reusable.
074: *
075: * @param url a repository location to establish a
076: * connection with (will be the root directory
077: * for the working session)
078: * @param mayReuse If <span class="javakeyword">true</span> then
079: * retrieves/creates a reusable object, otherwise
080: * creates a new unreusable one
081: * @return a low-level API driver for direct interacting
082: * with a repository
083: * @throws SVNException if <code>url</code> is malformed or there's
084: * no appropriate implementation for a protocol
085: * @see DefaultSVNRepositoryPool#createRepository(SVNURL, boolean)
086: */
087: public SVNRepository createRepository(SVNURL url, boolean mayReuse)
088: throws SVNException;
089:
090: /**
091: * Forces cached <b>SVNRepository</b> driver objects to close their socket
092: * connections.
093: *
094: * <p>
095: * A default implementation <b>DefaultSVNRepositoryPool</b>
096: * is able to cache <b>SVNRepository</b> objects in a common pool
097: * shared between multiple threads. This method allows to close
098: * connections of all the cached objects.
099: *
100: * @param shutdownAll if <span class="javakeyword">true</span> - closes
101: * connections of all the <b>SVNRepository</b> objects,
102: * if <span class="javakeyword">false</span> - connections
103: * of only some part of <b>SVNRepository</b> objects (for example,
104: * those, that are not needed anymore)
105: * @see DefaultSVNRepositoryPool
106: *
107: * @deprecated use {@link #dispose()} method instead.
108: */
109: public void shutdownConnections(boolean shutdownAll);
110:
111: public void dispose();
112: }
|