protected SVNAdminBasicClient(final ISVNAuthenticationManager authManager, ISVNOptions options) { this(new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil .createDefaultAuthenticationManager() : authManager, options, 0, false), options); }
/** * Sets the given authentication instance to this pool and to all {@link SVNRepository} objects * stored in this pool. * * @param authManager authentication manager instance */ public void setAuthenticationManager(ISVNAuthenticationManager authManager) { myAuthManager = authManager; Map<String, SVNRepository> pool = getPool(); for (Iterator<String> protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = protocols.next(); SVNRepository repository = (SVNRepository) pool.get(key); repository.setAuthenticationManager(myAuthManager); } }
/** * Closes connections of cached <b>SVNRepository</b> objects. * * <p> * Actually, calls the {@link #dispose()} routine. * * @param shutdownAll if <span class="javakeyword">true</span> - closes * connections of all the cached objects, otherwise only * connections of those cached objects which owner threads * have already disposed * @see SVNRepository */ public synchronized void shutdownConnections(boolean shutdownAll) { dispose(); }
public void dispose() { SVNGanymedSession.shutdown(); new DefaultSVNRepositoryPool(null, null).shutdownConnections(true); }
/** * Disposes this pool. Clears all inactive {@link SVNRepository} objects from this pool. * * @since 1.2.0 */ public void dispose() { synchronized (myInactiveRepositories) { myTimer = null; } shutdownInactiveRepositories(Long.MAX_VALUE); Map<String, SVNRepository> pool = getPool(); for (Iterator<String> protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = protocols.next(); SVNRepository repository = pool.get(key); repository.closeSession(); } myPool = null; synchronized (DefaultSVNRepositoryPool.class) { if (myScheduledTimeoutTask != null) { myScheduledTimeoutTask.cancel(false); myScheduledTimeoutTask = null; } ourInstanceCount--; if (ourInstanceCount <= 0) { ourInstanceCount = 0; shutdownTimer(); } } }
/** * Disposes this pool. Clears all inactive {@link SVNRepository} objects from this pool. * * @since 1.2.0 */ public void dispose() { synchronized (myInactiveRepositories) { myInactiveRepositories.clear(); myTimer = null; } Map pool = getPool(); for (Iterator protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = (String) protocols.next(); SVNRepository repository = (SVNRepository) pool.get(key); repository.closeSession(); } myPool = null; synchronized (DefaultSVNRepositoryPool.class) { ourInstanceCount--; if (ourInstanceCount <= 0) { ourInstanceCount = 0; shutdownTimer(); } } }
Map pool = getPool(); if (!mayReuse || pool == null) { repos = SVNRepositoryFactory.create(url, this); repos = retriveRepository(pool, url.getProtocol()); if (repos != null) { repos.setLocation(url, false); } else { repos = SVNRepositoryFactory.create(url, this); saveRepository(pool, repos, url.getProtocol());
Map<String, SVNRepository> pool = getPool(); if (!mayReuse || pool == null) { repos = SVNRepositoryFactory.create(url, this); repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller); setOptionalSpoolLocation(repos, myTunnelProvider); return repos; repos.setDebugLog(myDebugLog); repos.setCanceller(myCanceller); setOptionalSpoolLocation(repos, myTunnelProvider); return repos;
/** * Closes connections of cached <b>SVNRepository</b> objects. * * @param shutdownAll if <span class="javakeyword">true</span> - closes * connections of all the cached objects, otherwise only * connections of those cached objects which owner threads * have already disposed * @see org.tmatesoft.svn.core.io.SVNRepository */ public synchronized void shutdownConnections(boolean shutdownAll) { Map pool = null; if (myPoolMode == INSTANCE_POOL) { pool = myPool; } else if (myPoolMode == RUNTIME_POOL){ pool = ourPool; } if (pool != null) { synchronized (ourPoolMonitor) { clearPool(pool, shutdownAll); } } }
ourTimer = createExecutor(); ourTimer = createExecutor(); myTimer = ourTimer; myScheduledTimeoutTask = myTimer.scheduleWithFixedDelay(new TimeoutTask(), 10, 10, TimeUnit.SECONDS);
/** * Disposes this pool. Clears all inactive {@link SVNRepository} objects from this pool. * * @since 1.2.0 */ public void dispose() { synchronized (myInactiveRepositories) { myInactiveRepositories.clear(); myTimer = null; } Map pool = getPool(); for (Iterator protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = (String) protocols.next(); SVNRepository repository = (SVNRepository) pool.get(key); repository.closeSession(); } myPool = null; synchronized (DefaultSVNRepositoryPool.class) { ourInstanceCount--; if (ourInstanceCount <= 0) { ourInstanceCount = 0; shutdownTimer(); } } }
private static SVNRepository retriveRepository(Map pool, String protocol) { synchronized (ourPoolMonitor) { clearPool(pool, false); for (Iterator references = pool.keySet().iterator(); references.hasNext();) { WeakReference reference = (WeakReference) references.next(); if (reference.get() == Thread.currentThread()) { Map repositoriesMap = (Map) pool.get(reference); if (repositoriesMap.containsKey(protocol)) { return (SVNRepository) repositoriesMap.get(protocol); } return null; } } return null; } }
protected SVNBasicClient(final ISVNAuthenticationManager authManager, ISVNOptions options) { this(new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil.createDefaultAuthenticationManager() : authManager, options, true, DefaultSVNRepositoryPool.RUNTIME_POOL), options); }
/** * Sets the given authentication instance to this pool and to all {@link SVNRepository} objects * stored in this pool. * * @param authManager authentication manager instance */ public void setAuthenticationManager(ISVNAuthenticationManager authManager) { myAuthManager = authManager; Map pool = getPool(); for (Iterator protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = (String) protocols.next(); SVNRepository repository = (SVNRepository) pool.get(key); repository.setAuthenticationManager(myAuthManager); } }
/** * Closes connections of cached <b>SVNRepository</b> objects. * * <p> * Actually, calls the {@link #dispose()} routine. * * @param shutdownAll if <span class="javakeyword">true</span> - closes * connections of all the cached objects, otherwise only * connections of those cached objects which owner threads * have already disposed * @see SVNRepository */ public synchronized void shutdownConnections(boolean shutdownAll) { dispose(); }
private static void saveRepository(Map pool, SVNRepository repository, String protocol) { synchronized (ourPoolMonitor) { clearPool(pool, false); for (Iterator references = pool.keySet().iterator(); references.hasNext();) { WeakReference reference = (WeakReference) references.next(); if (reference.get() == Thread.currentThread()) { Map repositoriesMap = (Map) pool.get(reference); repositoriesMap.put(protocol, repository); return; } } Map map = new HashMap(); map.put(protocol, repository); pool.put(new WeakReference(Thread.currentThread()), map); } } }
public SVNBasicDelegate(final ISVNAuthenticationManager authManager, ISVNOptions options) { this(new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil.createDefaultAuthenticationManager() : authManager, options, 0, false), options); }
/** * Sets the given authentication instance to this pool and to all {@link SVNRepository} objects * stored in this pool. * * @param authManager authentication manager instance */ public void setAuthenticationManager(ISVNAuthenticationManager authManager) { myAuthManager = authManager; Map pool = getPool(); for (Iterator protocols = pool.keySet().iterator(); protocols.hasNext();) { String key = (String) protocols.next(); SVNRepository repository = (SVNRepository) pool.get(key); repository.setAuthenticationManager(myAuthManager); } }
/** * Closes connections of cached <b>SVNRepository</b> objects. * * <p> * Actually, calls the {@link #dispose()} routine. * * @param shutdownAll if <span class="javakeyword">true</span> - closes * connections of all the cached objects, otherwise only * connections of those cached objects which owner threads * have already disposed * @see SVNRepository */ public synchronized void shutdownConnections(boolean shutdownAll) { dispose(); }
private SVNClientManager(ISVNOptions options, final ISVNAuthenticationManager authManager) { this(options, new DefaultSVNRepositoryPool(authManager == null ? SVNWCUtil.createDefaultAuthenticationManager() : authManager, options)); }