public class ALDVersionProviderFactory extends Object
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.
Modifier and Type | Field and Description |
---|---|
private static String |
currentVersionProvider
Stores name of current version provider class.
|
private static String |
defaultVersionProvider
Fallback provider if nothing else specified.
|
private static Hashtable<String,ALDVersionProvider> |
providerInstances
Hashmap with global version provider objects.
|
Constructor and Description |
---|
ALDVersionProviderFactory() |
Modifier and Type | Method and Description |
---|---|
protected static 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(String providerClass)
Returns a reference to the provider object of the specified class.
|
private static Object |
instantiateObject(String providerClass)
Instantiates an object of the specified version provider class.
|
static boolean |
isClassNameSpecified()
Returns true if the factory can be properly configured.
|
static void |
setProviderClass(String pclass)
Explicitly request a certain class from the code.
|
private static final String defaultVersionProvider
private static String currentVersionProvider
private static Hashtable<String,ALDVersionProvider> providerInstances
public static ALDVersionProvider getProviderInstance()
The provider class can be specified by environment properties. This method guarantees to never return null.
public static ALDVersionProvider getProviderInstance(String providerClass)
providerClass
- Name of desired provider class.public static void setProviderClass(String pclass)
Note: this setting overrides potentially existing environment settings!
pclass
- Desired class for provider objects.private static Object instantiateObject(String providerClass)
providerClass
- Identifier for provider class to be instantiated.protected static String getClassName()
public static boolean isClassNameSpecified()
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.