org.jmonks.dms.versioncontrol.api
Class RepositoryFactory

java.lang.Object
  extended byorg.jmonks.dms.versioncontrol.api.RepositoryFactory

public final class RepositoryFactory
extends java.lang.Object

The purpose of this class is to get the Repository object from the providerClass. It make sure only one instance of Repository is available in the system. It sets the contextParams to the repository object, if provided.

Author:
Suresh Pragada

Field Summary
private static org.apache.log4j.Logger logger
           
private static java.util.Map repositoryMap
          Holds the Repository instances treating provider class name as keys.
private static java.lang.String SINGLETON_METHOD_NAME
           
 
Constructor Summary
RepositoryFactory()
           
 
Method Summary
static Repository getRepository(java.lang.String providerClass)
          Returns the Repository instance based on provider class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.log4j.Logger logger

SINGLETON_METHOD_NAME

private static final java.lang.String SINGLETON_METHOD_NAME
See Also:
Constant Field Values

repositoryMap

private static java.util.Map repositoryMap
Holds the Repository instances treating provider class name as keys.

Constructor Detail

RepositoryFactory

public RepositoryFactory()
Method Detail

getRepository

public static Repository getRepository(java.lang.String providerClass)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.InstantiationException,
                                       java.lang.IllegalAccessException,
                                       java.lang.NoSuchMethodException,
                                       java.lang.reflect.InvocationTargetException
Returns the Repository instance based on provider class. If repository instance is not available, it creates and returns. It sets the contextParams to the created or existed object.

Parameters:
providerClass - Provider classname to load.
Returns:
Returns the Repository instance.
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException