org.apache.maven.dotnet.registry.impl
Class RepositoryRegistryImpl

java.lang.Object
  extended by org.apache.maven.dotnet.registry.impl.RepositoryRegistryImpl
All Implemented Interfaces:
RepositoryRegistry, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

public class RepositoryRegistryImpl
extends java.lang.Object
implements RepositoryRegistry, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

Author:
Shane Isbell

Field Summary
 
Fields inherited from interface org.apache.maven.dotnet.registry.RepositoryRegistry
ROLE
 
Constructor Summary
RepositoryRegistryImpl()
           
 
Method Summary
 void addRepository(java.lang.String name, Repository repository)
          Adds a repository to the registry.
 void empty()
          Empties all of the repositories from the registry.
 Repository find(java.lang.String name)
          Finds a repository from the registry.
 java.util.Set getRepositoryNames()
          Accessor for repository names.
 void initialize()
           
 boolean isEmpty()
          Returns true if the registry is empty, otherwise returns true.
 void loadFromFile(java.lang.String fileName)
          Convenience method for loading a file off of a file system.
 void loadFromInputStream(java.io.InputStream inputStream)
          Loads the registry from inputStream.
 void loadFromResource(java.lang.String fileName, java.lang.Class sourceClass)
          Convenience method for loading from a JAR or Resource.
 void removeRepository(java.lang.String name)
          Removes a repository from the registry
 void setRegistryLoader(RegistryLoader loader)
          Mutator for setting the RegistryLoader
 void setRepositoryLoader(RepositoryLoader loader)
          Mutator for setting the RepositoryLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryRegistryImpl

public RepositoryRegistryImpl()
Method Detail

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
See Also:
Initializable.initialize()

isEmpty

public boolean isEmpty()
Description copied from interface: RepositoryRegistry
Returns true if the registry is empty, otherwise returns true.

Specified by:
isEmpty in interface RepositoryRegistry
Returns:
true if the registry is empty, otherwise returns true.

setRepositoryLoader

public void setRepositoryLoader(RepositoryLoader loader)
Description copied from interface: RepositoryRegistry
Mutator for setting the RepositoryLoader

Specified by:
setRepositoryLoader in interface RepositoryRegistry

setRegistryLoader

public void setRegistryLoader(RegistryLoader loader)
Description copied from interface: RepositoryRegistry
Mutator for setting the RegistryLoader

Specified by:
setRegistryLoader in interface RepositoryRegistry

loadFromInputStream

public void loadFromInputStream(java.io.InputStream inputStream)
                         throws java.io.IOException
Description copied from interface: RepositoryRegistry
Loads the registry from inputStream. Multiple config files may be loaded into the registry.

Specified by:
loadFromInputStream in interface RepositoryRegistry
Parameters:
inputStream - contains the jvending-config file.
Throws:
java.io.IOException - thrown on interrupted I/O

loadFromFile

public void loadFromFile(java.lang.String fileName)
                  throws java.io.IOException
Description copied from interface: RepositoryRegistry
Convenience method for loading a file off of a file system.

Specified by:
loadFromFile in interface RepositoryRegistry
Parameters:
fileName - relative or absolute path of the file
Throws:
java.io.IOException - thrown on interrupted I/O

loadFromResource

public void loadFromResource(java.lang.String fileName,
                             java.lang.Class sourceClass)
                      throws java.io.IOException
Description copied from interface: RepositoryRegistry
Convenience method for loading from a JAR or Resource.

Specified by:
loadFromResource in interface RepositoryRegistry
Parameters:
fileName - relative or absolute path of the file
Throws:
java.io.IOException - thrown on interrupted I/O

addRepository

public void addRepository(java.lang.String name,
                          Repository repository)
Description copied from interface: RepositoryRegistry
Adds a repository to the registry. If the repository name already exists, this method will overwrite the old Repository instance within the registry.

Specified by:
addRepository in interface RepositoryRegistry
Parameters:
name - name of the repository
repository - instance of the repository

find

public Repository find(java.lang.String name)
Description copied from interface: RepositoryRegistry
Finds a repository from the registry.

Specified by:
find in interface RepositoryRegistry
Parameters:
name - name of the repository.
Returns:
instance of the Repository or null if instance does not exist

removeRepository

public void removeRepository(java.lang.String name)
Description copied from interface: RepositoryRegistry
Removes a repository from the registry

Specified by:
removeRepository in interface RepositoryRegistry
Parameters:
name - name of the repository

getRepositoryNames

public java.util.Set getRepositoryNames()
Description copied from interface: RepositoryRegistry
Accessor for repository names.

Specified by:
getRepositoryNames in interface RepositoryRegistry
Returns:
unmodifiable set of repository names

empty

public void empty()
Description copied from interface: RepositoryRegistry
Empties all of the repositories from the registry.

Specified by:
empty in interface RepositoryRegistry


Copyright © 2007 NMaven. All Rights Reserved.