COSMOS ${releaseVersion} resource-modeling Project
Public API Specification

org.eclipse.cosmos.rm.repository.provisional.core
Class SMLRepositoryFactory

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.provisional.core.SMLRepositoryFactory

public abstract class SMLRepositoryFactory
extends java.lang.Object

Clients are expected to use this factory class to create an instance of a repository. An instance can be created by either invoking createRepository() or passing a specific Properties to createRepository(Properties).


Constructor Summary
SMLRepositoryFactory()
           
 
Method Summary
static ISMLRepository createRepository()
          An instance of a repository will be created by first checking the system property to determine if it?s set to a class name.
static ISMLRepository createRepository(java.util.Properties properties)
          Creates an instance of a repository using a specific properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMLRepositoryFactory

public SMLRepositoryFactory()
Method Detail

createRepository

public static ISMLRepository createRepository()
                                       throws MissingRepositoryException
An instance of a repository will be created by first checking the system property to determine if it?s set to a class name. If no such property is found, then the factory class will attempt to retrieve the same property name from the properties file: /META-INF/sml/repository.properties using the context class loader. If no such properties file is found or the repository class file is missing, then MissingRepositoryException is thrown.

Returns:
An instance of a repository if one can be created
Throws:
MissingRepositoryException - If there are no repositories found

createRepository

public static ISMLRepository createRepository(java.util.Properties properties)
                                       throws MissingRepositoryException
Creates an instance of a repository using a specific properties file. The property name will be used to look for a class name.

Parameters:
properties - The properties file
Returns:
An instance of a repository
Throws:
MissingRepositoryException - If no implementation is found

COSMOS ${releaseVersion} resource-modeling Project
Public API Specification