de.unihalle.informatik.Alida.version
Class ALDVersionProviderFactory

java.lang.Object
  extended by de.unihalle.informatik.Alida.version.ALDVersionProviderFactory

public class ALDVersionProviderFactory
extends java.lang.Object

Factory for dynamic instantiation of version providers at runtime.

Here JVM properties are evaluated to dynamically configure the way, how Alida handles software versions. Usually there are different possibilities from where to get software version information. The probably most popular way is to query software repositories like CVS, SVN or Git. However, other options can be imagined as well.

Alida supports dynamic configuration of the version data handling. This factory instantiates a concrete version provider based on the environment property alida_versionprovider_class. This property should contain the name of a class extending base class ALDVersionProvider. The generated instance of this class will be used for all software version requests triggered during Alida operator invocations.

Author:
moeller

Field Summary
private static java.lang.String defaultVersionProvider
          Fallback provider if nothing else specified.
private static java.util.Hashtable<java.lang.String,ALDVersionProvider> providerInstances
          Hashmap with global version provider objects.
 
Constructor Summary
ALDVersionProviderFactory()
           
 
Method Summary
static java.lang.String getClassName()
          Returns version provider class according to environment configuration.
static ALDVersionProvider getProviderInstance()
          Returns a reference to the currently selected provider object.
static ALDVersionProvider getProviderInstance(java.lang.String providerClass)
          Returns a reference to the provider object of the specified class.
private static java.lang.Object instantiateObject(java.lang.String providerClass)
          Instantiates an object of the specified version provider class.
static boolean isClassNameSpecified()
          Returns true if the factory can be properly configured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultVersionProvider

private static final java.lang.String defaultVersionProvider
Fallback provider if nothing else specified.

See Also:
Constant Field Values

providerInstances

private static java.util.Hashtable<java.lang.String,ALDVersionProvider> providerInstances
Hashmap with global version provider objects.

Constructor Detail

ALDVersionProviderFactory

public ALDVersionProviderFactory()
Method Detail

getClassName

public static java.lang.String getClassName()
Returns version provider class according to environment configuration.


getProviderInstance

public static ALDVersionProvider getProviderInstance()
Returns a reference to the currently selected provider object.

The provider class can be specified by environment properties. This method guarantees to never return null.

Returns:
Instance of previously configured version provider.

getProviderInstance

public static ALDVersionProvider getProviderInstance(java.lang.String providerClass)
Returns a reference to the provider object of the specified class.

Parameters:
providerClass - Name of desired provider class.
Returns:
Corresponding provider object.

instantiateObject

private static java.lang.Object instantiateObject(java.lang.String providerClass)
Instantiates an object of the specified version provider class.

Parameters:
providerClass - Identifier for provider class to be instantiated.
Returns:
Instantiated provider class object, null in case of failure.

isClassNameSpecified

public static boolean isClassNameSpecified()
Returns true if the factory can be properly configured.