Package org.corpus_tools.pepper.common
Class PepperConfiguration
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<Object,Object>
-
- java.util.Properties
-
- org.corpus_tools.pepper.common.PepperConfiguration
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
public class PepperConfiguration extends Properties
This class contains all possible configurations, to take influence on the Pepper process. A configuration is realized as aProperty, therefore this class is derived from the generalPropertiesclass. It is enhanced for methods to have an easier access to fields to configure the Pepper framework, but you can also find anything necessary when treating this object as a normalPropertiesobject.Loading and resolving configuration
Next to the the mechanisms of loading a prop file or an xml file, this object can also resolve the configuration file by checking the location of the Pepper bundle. It is assumed, that the configuration file is contained in one of two possible locations.- development phase: it is assumed, that the configuration file is stored in PEPPER_SOURCE_HOME/src/main/resoruces
- testing phase: it is assumed, that the configuration file is stored in BUNDLE_LOCATION/../BUNDLE_NAME
- Author:
- Florian Zipser
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String[]ALL_PROP_NAMESThis array contains all properties, which with the Pepper framework can be configured.static StringDEFAULT_WORKSPACEA sub folder in Pepper directory to be used as workspace (to store jobs etc.)static StringEMAILpepper-eMail addressstatic StringENV_PEPPER_MODULE_RESOURCESstatic StringFILE_CONF_FILEName of the configuration file.static StringFILE_CONF_FOLDERName of the folder containing configuration files.static StringFILE_CONF_TEST_FILEName of the configuration file for testing.static StringFITNESS_FEATURE_DESClink to Pepper developers homepage for fitness featuresstatic StringHOMEPAGEpepper-homepagestatic StringPROP_CALL_GC_AFTER_DOCUMENTName of property, to determine, if the garbage collector should run after aSDocumenthas been send to sleep when it waits inDocumentBusbetween to steps.static StringPROP_COMPUTE_PERFORMANCEflag if Pepper shall measure and display the performance of the used PepperModulesstatic StringPROP_DETAILED_STATUS_REPORTName of the property to determine Property to determine whether the status report should contain a progress for each module or just the global progress.static StringPROP_KEEP_TEMP_DOCSname of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates.static StringPROP_MAX_AMOUNT_OF_SDOCUMENTSthe maximal number of currently processed SDocument-objectsstatic StringPROP_MEMORY_POLICYName of property to set the memory policy, for instance to configure the behavior of loading documents.static StringPROP_PEPPER_MODULE_RESOURCESstatic StringPROP_PREFIXflag if Pepper shall measure and display the performance of the used PepperModulesstatic StringPROP_REPORT_INTERVALname of property to determine the time interval of the convert status reportstatic StringPROP_TEMP_FOLDERName of the property, which determines a temporary folder, where the framework and all modules can store temporary data.static StringPROP_WORKSPACEname of the flag to determine a workspace for pepper, where all jobs are stored by default.static StringSOURCES_RESOURCESFolder where the resources of a bundle is expected to be.-
Fields inherited from class java.util.Properties
defaults
-
-
Constructor Summary
Constructors Constructor Description PepperConfiguration()Standard constructor which initializes this object with default values: "pepper.gcAfterDocumentSleep"= "pepper.memPolicy"= "pepper.maxAmountOfProcessedSDocuments"= 10PepperConfiguration(Properties properties)Initializes a new object and copies all properties of the givenPropertiesobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegetConfFolder()Returns the folder containing the configuration file(s).BooleangetDetaialedStatReport()Property to determine whether the status report should contain a progress for each module or just the global progress.BooleangetGcAfterDocumentSleep()BooleangetKeepDocuments()name of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates.IntegergetMaxAmountOfDocuments()Returns the the maximal number of currently processed SDocument-objectsMEMORY_POLICYgetMemPolicy()Returns the memory policy for instance to configure the behavior of loading documents.IntegergetReportInterval()Flag to determine the time interval of the convert status reportFilegetTempPath()Returns a temporary path, where the entire system and all modules can store temp files.FilegetWorkspace()Returns the default workspace forPepperJobImplobjects, if one is given in configuration.voidload(File configurationFile)Loads the configuration from the passed file locationvoidload(org.osgi.service.component.ComponentContext componentContext)Resolves the location of the bundle by the givenComponentContextand loads the configuration file.protected voidsetConfFolder(File confFolder)Sets the folder containing the configuration file(s).-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Field Detail
-
EMAIL
public static final String EMAIL
pepper-eMail address- See Also:
- Constant Field Values
-
HOMEPAGE
public static final String HOMEPAGE
pepper-homepage- See Also:
- Constant Field Values
-
FITNESS_FEATURE_DESC
public static final String FITNESS_FEATURE_DESC
link to Pepper developers homepage for fitness features- See Also:
- Constant Field Values
-
DEFAULT_WORKSPACE
public static final String DEFAULT_WORKSPACE
A sub folder in Pepper directory to be used as workspace (to store jobs etc.)- See Also:
- Constant Field Values
-
PROP_PREFIX
public static final String PROP_PREFIX
flag if Pepper shall measure and display the performance of the used PepperModules- See Also:
- Constant Field Values
-
PROP_COMPUTE_PERFORMANCE
public static final String PROP_COMPUTE_PERFORMANCE
flag if Pepper shall measure and display the performance of the used PepperModules- See Also:
- Constant Field Values
-
PROP_TEMP_FOLDER
public static final String PROP_TEMP_FOLDER
Name of the property, which determines a temporary folder, where the framework and all modules can store temporary data.- See Also:
- Constant Field Values
-
PROP_MAX_AMOUNT_OF_SDOCUMENTS
public static final String PROP_MAX_AMOUNT_OF_SDOCUMENTS
the maximal number of currently processed SDocument-objects- See Also:
- Constant Field Values
-
PROP_MEMORY_POLICY
public static final String PROP_MEMORY_POLICY
Name of property to set the memory policy, for instance to configure the behavior of loading documents. SeeMEMORY_POLICYfor more details.- See Also:
- Constant Field Values
-
PROP_CALL_GC_AFTER_DOCUMENT
public static final String PROP_CALL_GC_AFTER_DOCUMENT
Name of property, to determine, if the garbage collector should run after aSDocumenthas been send to sleep when it waits inDocumentBusbetween to steps.- See Also:
- Constant Field Values
-
PROP_KEEP_TEMP_DOCS
public static final String PROP_KEEP_TEMP_DOCS
name of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates.- See Also:
- Constant Field Values
-
PROP_DETAILED_STATUS_REPORT
public static final String PROP_DETAILED_STATUS_REPORT
Name of the property to determine Property to determine whether the status report should contain a progress for each module or just the global progress.- See Also:
- Constant Field Values
-
PROP_WORKSPACE
public static final String PROP_WORKSPACE
name of the flag to determine a workspace for pepper, where all jobs are stored by default.- See Also:
- Constant Field Values
-
PROP_REPORT_INTERVAL
public static final String PROP_REPORT_INTERVAL
name of property to determine the time interval of the convert status report- See Also:
- Constant Field Values
-
ALL_PROP_NAMES
public static final String[] ALL_PROP_NAMES
This array contains all properties, which with the Pepper framework can be configured.
-
ENV_PEPPER_MODULE_RESOURCES
public static final String ENV_PEPPER_MODULE_RESOURCES
- See Also:
- Constant Field Values
-
PROP_PEPPER_MODULE_RESOURCES
public static final String PROP_PEPPER_MODULE_RESOURCES
- See Also:
- Constant Field Values
-
SOURCES_RESOURCES
public static final String SOURCES_RESOURCES
Folder where the resources of a bundle is expected to be. This follows the maven structure of a project- See Also:
- Constant Field Values
-
FILE_CONF_FOLDER
public static final String FILE_CONF_FOLDER
Name of the folder containing configuration files.- See Also:
- Constant Field Values
-
FILE_CONF_FILE
public static final String FILE_CONF_FILE
Name of the configuration file.- See Also:
- Constant Field Values
-
FILE_CONF_TEST_FILE
public static final String FILE_CONF_TEST_FILE
Name of the configuration file for testing.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PepperConfiguration
public PepperConfiguration()
Standard constructor which initializes this object with default values:
-
PepperConfiguration
public PepperConfiguration(Properties properties)
Initializes a new object and copies all properties of the givenPropertiesobject.- Parameters:
properties-
-
-
Method Detail
-
load
public void load(File configurationFile)
Loads the configuration from the passed file location- Parameters:
configuration-
-
load
public void load(org.osgi.service.component.ComponentContext componentContext)
Resolves the location of the bundle by the givenComponentContextand loads the configuration file. Expects the configuration file to be in one of the two locations:- development phase: it is assumed, that the configuration file is stored in PEPPER_SOURCE_HOME/src/main/resoruces
- testing phase: it is assumed, that the configuration file is stored in BUNDLE_LOCATION/../BUNDLE_NAME
- Parameters:
componentContext-
-
setConfFolder
protected void setConfFolder(File confFolder)
Sets the folder containing the configuration file(s).- Parameters:
confFolder-
-
getConfFolder
public File getConfFolder()
Returns the folder containing the configuration file(s). If no configuration file is used this method returns null.- Returns:
-
getTempPath
public File getTempPath()
Returns a temporary path, where the entire system and all modules can store temp files. If no temp folder is given by configuration file, the default temporary folder given by the operating system is used.- Returns:
- path, where to store temporary files
-
getWorkspace
public File getWorkspace()
Returns the default workspace forPepperJobImplobjects, if one is given in configuration. If no one is given, the temporary folder is returned.- Returns:
- workspace to be used to store
PepperJobImpl
-
getMemPolicy
public MEMORY_POLICY getMemPolicy()
Returns the memory policy for instance to configure the behavior of loading documents. SeeMEMORY_POLICYfor more details.- Returns:
-
getMaxAmountOfDocuments
public Integer getMaxAmountOfDocuments()
Returns the the maximal number of currently processed SDocument-objects- Returns:
-
getGcAfterDocumentSleep
public Boolean getGcAfterDocumentSleep()
-
getKeepDocuments
public Boolean getKeepDocuments()
name of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates. Default value is false.
-
getReportInterval
public Integer getReportInterval()
Flag to determine the time interval of the convert status report
-
getDetaialedStatReport
public Boolean getDetaialedStatReport()
Property to determine whether the status report should contain a progress for each module or just the global progress.- Returns:
-
-