org.apache.avalon.repository.impl
Class DefaultCacheManager

java.lang.Object
  extended byorg.apache.avalon.repository.impl.DefaultCacheManager
All Implemented Interfaces:
CacheManager

public class DefaultCacheManager
extends Object
implements CacheManager

A component that provides access to versioned resources based on an underlying file system.

Version:
$Revision: 1.3 $ $Date: 2003/12/19 16:46:15 $
Author:
Avalon Development Team

Constructor Summary
DefaultCacheManager(File base, ProxyContext context, String[] hosts)
          Creation of a new cache manager.
 
Method Summary
 Repository createRepository()
          Creation of a new repository handler using teh default hosts.
 Repository createRepository(String[] hosts)
          Creation of a new repository handler.
 File getCacheDirectory()
          Return cache root directory.
 String[] getDefaultHosts()
          Return the default hosts.
 BlockManifest install(URL url, StringBuffer buffer)
          Install a block archive into the repository.
 String toString()
          Return the repository address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultCacheManager

public DefaultCacheManager(File base,
                           ProxyContext context,
                           String[] hosts)
Creation of a new cache manager.

Parameters:
base - the base directory for the repository cache
context - the proxy context
hosts - the default hosts
Method Detail

getCacheDirectory

public File getCacheDirectory()
Return cache root directory.

Specified by:
getCacheDirectory in interface CacheManager
Returns:
the cache directory

getDefaultHosts

public String[] getDefaultHosts()
Return the default hosts.

Returns:
the host names

createRepository

public Repository createRepository()
Creation of a new repository handler using teh default hosts.

Specified by:
createRepository in interface CacheManager
Returns:
the repository

createRepository

public Repository createRepository(String[] hosts)
Creation of a new repository handler.

Specified by:
createRepository in interface CacheManager
Parameters:
hosts - the set of hosts to assign to the repository
Returns:
the repository

install

public BlockManifest install(URL url,
                             StringBuffer buffer)
                      throws RepositoryException
Install a block archive into the repository.

Specified by:
install in interface CacheManager
Parameters:
url - the block archive url
buffer - a string buffer against which messages may be logged
Returns:
the block manifest
Throws:
RepositoryException

toString

public String toString()
Return the repository address.

Returns:
the address


Copyright © Apache Software Foundation. All Rights Reserved.