org.apache.avalon.repository.provider
Interface InitialContextFactory

All Known Implementing Classes:
DefaultInitialContextFactory

public interface InitialContextFactory

Utility interface that provides support for the creation of a new initial context.

Version:
$Revision: 1.9 $
Author:
Avalon Development Team

Field Summary
static String[] KEYS
          An array of property keys that are used to locate default values.
 
Method Summary
 InitialContext createInitialContext()
          Creation of an inital context based on the system and working directory, parent classloader, repository cache manager implementation artifact, cache directory, and remote hosts sequence supplied to the factory.
 File getHomeDirectory()
          Return the home directory value direved from the application key.
 void setCacheDirectory(File cache)
          The cache directory is the directory into which resources such as jar files are loaded by a repository cache manager.
 void setFactoryArtifacts(Artifact[] artifacts)
          Register a set of factory artifacts.
 void setHosts(String[] hosts)
          Set the initial hosts to be used by a repository cache manager implementation and the initial context implementation when resolving dependent resources.
 void setImplementation(Artifact artifact)
          The initial context factory support the establishment of an initial context which is associated with a repository cache manager implementation.
 void setOnlineMode(boolean policy)
          Set the online mode of the repository.
 void setParentClassLoader(ClassLoader classloader)
          Set the parent classloader.
 void setProxyHost(String host)
          Set the proxy host name.
 void setProxyPassword(String password)
          Set the proxy account password.
 void setProxyPort(int port)
          Set the proxy host port.
 void setProxyUsername(String username)
          Set the proxy username.
 

Field Detail

KEYS

public static final String[] KEYS
An array of property keys that are used to locate default values.

See Also:
InitialContext.IMPLEMENTATION_KEY, InitialContext.CACHE_KEY, InitialContext.HOSTS_KEY, InitialContext.ONLINE_KEY, InitialContext.FACTORY_ARTIFACTS_KEY
Method Detail

getHomeDirectory

public File getHomeDirectory()
Return the home directory value direved from the application key.

Returns:
the home directory.

setFactoryArtifacts

public void setFactoryArtifacts(Artifact[] artifacts)
Register a set of factory artifacts.

Parameters:
artifacts - the factory artifact references

setOnlineMode

public void setOnlineMode(boolean policy)
Set the online mode of the repository. The default policy is to to enable online access to remote repositories. Setting the onLine mode to false disables remote repository access.

Parameters:
policy - the online connected policy

setParentClassLoader

public void setParentClassLoader(ClassLoader classloader)
Set the parent classloader.

Parameters:
classloader - the parent classloader

setImplementation

public void setImplementation(Artifact artifact)
The initial context factory support the establishment of an initial context which is associated with a repository cache manager implementation. A client can override the default repository cache manager implementation by declaring an artifact referencing a compliant factory (not normally required).

Parameters:
artifact - the repository cache manager artifact

setCacheDirectory

public void setCacheDirectory(File cache)
The cache directory is the directory into which resources such as jar files are loaded by a repository cache manager.

Parameters:
cache - the repository cache directory

setProxyHost

public void setProxyHost(String host)
Set the proxy host name. If not supplied proxy usage will be disabled.

Parameters:
host - the proxy host name

setProxyPort

public void setProxyPort(int port)
Set the proxy host port.

Parameters:
port - the proxy port

setProxyUsername

public void setProxyUsername(String username)
Set the proxy username.

Parameters:
username - the proxy username

setProxyPassword

public void setProxyPassword(String password)
Set the proxy account password.

Parameters:
password - the proxy password

setHosts

public void setHosts(String[] hosts)
Set the initial hosts to be used by a repository cache manager implementation and the initial context implementation when resolving dependent resources. If is resource is not present in a local cache, remote hosts are checked in the order presented in the supplied list. A host may be a file url or a http url.

Parameters:
hosts - a sequence of remote host urls

createInitialContext

public InitialContext createInitialContext()
Creation of an inital context based on the system and working directory, parent classloader, repository cache manager implementation artifact, cache directory, and remote hosts sequence supplied to the factory.

Returns:
a new initial context


Copyright © The Apache Software Foundation. All Rights Reserved.