org.hackystat.telemetry.analyzer.configuration
Class TelemetryDefinitionManagerFactory

java.lang.Object
  extended by org.hackystat.telemetry.analyzer.configuration.TelemetryDefinitionManagerFactory

public class TelemetryDefinitionManagerFactory
extends java.lang.Object

Provides a Factory class for generating the single PersistentTelemetryDefinitionManager and as many non-persistent ones as required.

Author:
(Cedric) Qin Zhang

Constructor Summary
TelemetryDefinitionManagerFactory()
           
 
Method Summary
static void buildGlobalPersistentInstance(java.lang.String defDir)
          Creates the singleton persistent instance, using the passed defDir to find telemetry definitions.
static TelemetryDefinitionManager createNonPersistentInstance(boolean linkToGlobalSingleton)
          Creates a new non-persistent version of TelemetryDefinitionManager instance.
static TelemetryDefinitionManager getGlobalPersistentInstance()
          Gets the singleton global instance of TelemetryDefinitionManger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelemetryDefinitionManagerFactory

public TelemetryDefinitionManagerFactory()
Method Detail

getGlobalPersistentInstance

public static TelemetryDefinitionManager getGlobalPersistentInstance()
Gets the singleton global instance of TelemetryDefinitionManger.

Returns:
The global instance of TelemetryDefinitionManager.

buildGlobalPersistentInstance

public static void buildGlobalPersistentInstance(java.lang.String defDir)
Creates the singleton persistent instance, using the passed defDir to find telemetry definitions. Note that this must be called when the Restlet server is being created and thus in advance of any calls to getGlobalPersistentInstance.

Parameters:
defDir - A string indicating the directory where telemetry definitions (in addition to the "builtin" definitions) will be found.

createNonPersistentInstance

public static TelemetryDefinitionManager createNonPersistentInstance(boolean linkToGlobalSingleton)
Creates a new non-persistent version of TelemetryDefinitionManager instance. Note that the returned instance merges its name space with the name space in the global instance. This means that if a definition name is used in the global instance, it cannot be used in the returned instance.

Parameters:
linkToGlobalSingleton - True if the definitions in global singleton telemetry manager should be merged to this instance.
Returns:
A non-persistent version of TelemetryDefinitionManager instance.