Pepper  3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
org.corpus_tools.pepper.common.PepperConfiguration Class Reference

This class contains all possible configurations, to take influence on the Pepper process. More...

Inherits Properties.

Inherited by org.corpus_tools.pepper.cli.PepperStarterConfiguration.

Public Member Functions

 PepperConfiguration ()
 Standard constructor which initializes this object with default values: More...
 
 PepperConfiguration (Properties properties)
 Initializes a new object and copies all properties of the given Properties object. More...
 
void load (File configurationFile)
 Loads the configuration from the passed file location. More...
 
void load (ComponentContext componentContext)
 Resolves the location of the bundle by the given ComponentContext and loads the configuration file. More...
 
File getConfFolder ()
 Returns the folder containing the configuration file(s). More...
 
File getTempPath ()
 Returns a temporary path, where the entire system and all modules can store temp files. More...
 
File getWorkspace ()
 Returns the default workspace for PepperJobImpl objects, if one is given in configuration. More...
 
MEMORY_POLICY getMemPolicy ()
 Returns the memory policy for instance to configure the behavior of loading documents. More...
 
Integer getMaxAmountOfDocuments ()
 Returns the the maximal number of currently processed SDocument-objects. More...
 
Boolean getGcAfterDocumentSleep ()
 
Boolean getKeepDocuments ()
 name of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates. More...
 
Integer getReportInterval ()
 Flag to determine the time interval of the convert status report.
 
Boolean getDetaialedStatReport ()
 Property to determine whether the status report should contain a progress for each module or just the global progress. More...
 

Static Public Attributes

static final String EMAIL = "saltnpepper@lists.hu-berlin.de"
 pepper-eMail address
 
static final String HOMEPAGE = "http://corpus-tools.org/pepper/"
 pepper-homepage
 
static final String FITNESS_FEATURE_DESC = "https://korpling.github.io/pepper/doc/fitness.html"
 link to Pepper developers homepage for fitness features
 
static final String DEFAULT_WORKSPACE = "workspace"
 A sub folder in Pepper directory to be used as workspace (to store jobs etc.)
 
static final String PROP_PREFIX = "pepper"
 flag if Pepper shall measure and display the performance of the used PepperModules
 
static final String PROP_COMPUTE_PERFORMANCE = PROP_PREFIX + ".computePerformance"
 flag if Pepper shall measure and display the performance of the used PepperModules
 
static final String PROP_TEMP_FOLDER = PROP_PREFIX + ".temporaries"
 Name of the property, which determines a temporary folder, where the framework and all modules can store temporary data.
 
static final String PROP_MAX_AMOUNT_OF_SDOCUMENTS = PROP_PREFIX + ".maxAmountOfProcessedSDocuments"
 the maximal number of currently processed SDocument-objects
 
static final String PROP_MEMORY_POLICY = PROP_PREFIX + ".memPolicy"
 Name of property to set the memory policy, for instance to configure the behavior of loading documents. More...
 
static final String PROP_CALL_GC_AFTER_DOCUMENT = PROP_PREFIX + ".gcAfterDocumentSleep"
 Name of property, to determine, if the garbage collector should run after a SDocument has been send to sleep when it waits in DocumentBus between to steps.
 
static final String PROP_KEEP_TEMP_DOCS = PROP_PREFIX + ".keepTempDocs"
 name of the flag to determine whether the temporary created document-graph files should be preserved or deleted after Pepper terminates.
 
static final String PROP_DETAILED_STATUS_REPORT = PROP_PREFIX + ".detailedStatusReport"
 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.
 
static final String PROP_WORKSPACE = PROP_PREFIX + ".workspace"
 name of the flag to determine a workspace for pepper, where all jobs are stored by default.
 
static final String PROP_REPORT_INTERVAL = PROP_PREFIX + ".reportInterval"
 name of property to determine the time interval of the convert status report
 
static final String[] ALL_PROP_NAMES = { PROP_COMPUTE_PERFORMANCE, PROP_MAX_AMOUNT_OF_SDOCUMENTS }
 This array contains all properties, which with the Pepper framework can be configured.
 
static final String ENV_PEPPER_MODULE_RESOURCES = "pepper.modules.resources"
 
static final String PROP_PEPPER_MODULE_RESOURCES = "pepper.modules.resources"
 
static final String SOURCES_RESOURCES = "src/main/resources/"
 Folder where the resources of a bundle is expected to be. More...
 
static final String FILE_CONF_FOLDER = "conf"
 Name of the folder containing configuration files.
 
static final String FILE_CONF_FILE = "pepper.properties"
 Name of the configuration file.
 
static final String FILE_CONF_TEST_FILE = "pepper-test.properties"
 Name of the configuration file for testing.
 

Protected Member Functions

void setConfFolder (File confFolder)
 Sets the folder containing the configuration file(s). More...
 

Detailed Description

This class contains all possible configurations, to take influence on the Pepper process.

A configuration is realized as a Property, therefore this class is derived from the general Properties class. 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 normal Properties object.

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.

  1. development phase: it is assumed, that the configuration file is stored in PEPPER_SOURCE_HOME/src/main/resoruces
  2. testing phase: it is assumed, that the configuration file is stored in BUNDLE_LOCATION/../BUNDLE_NAME
Author
Florian Zipser

Constructor & Destructor Documentation

◆ PepperConfiguration() [1/2]

org.corpus_tools.pepper.common.PepperConfiguration.PepperConfiguration ( )

Standard constructor which initializes this object with default values:

◆ PepperConfiguration() [2/2]

org.corpus_tools.pepper.common.PepperConfiguration.PepperConfiguration ( Properties  properties)

Initializes a new object and copies all properties of the given Properties object.

Parameters
properties

Member Function Documentation

◆ getConfFolder()

File org.corpus_tools.pepper.common.PepperConfiguration.getConfFolder ( )

Returns the folder containing the configuration file(s).

If no configuration file is used this method returns null.

Returns

◆ getDetaialedStatReport()

Boolean org.corpus_tools.pepper.common.PepperConfiguration.getDetaialedStatReport ( )

Property to determine whether the status report should contain a progress for each module or just the global progress.

Returns

◆ getKeepDocuments()

Boolean org.corpus_tools.pepper.common.PepperConfiguration.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.

◆ getMaxAmountOfDocuments()

Integer org.corpus_tools.pepper.common.PepperConfiguration.getMaxAmountOfDocuments ( )

Returns the the maximal number of currently processed SDocument-objects.

Returns

◆ getMemPolicy()

MEMORY_POLICY org.corpus_tools.pepper.common.PepperConfiguration.getMemPolicy ( )

Returns the memory policy for instance to configure the behavior of loading documents.

See MEMORY_POLICY for more details.

Returns

◆ getTempPath()

File org.corpus_tools.pepper.common.PepperConfiguration.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()

File org.corpus_tools.pepper.common.PepperConfiguration.getWorkspace ( )

Returns the default workspace for PepperJobImpl objects, if one is given in configuration.

If no one is given, the temporary folder is returned.

Returns
workspace to be used to store PepperJobImpl

◆ load() [1/2]

void org.corpus_tools.pepper.common.PepperConfiguration.load ( ComponentContext  componentContext)

Resolves the location of the bundle by the given ComponentContext and loads the configuration file.

Expects the configuration file to be in one of the two locations:

  1. development phase: it is assumed, that the configuration file is stored in PEPPER_SOURCE_HOME/src/main/resoruces
  2. testing phase: it is assumed, that the configuration file is stored in BUNDLE_LOCATION/../BUNDLE_NAME
Parameters
componentContext

◆ load() [2/2]

void org.corpus_tools.pepper.common.PepperConfiguration.load ( File  configurationFile)

Loads the configuration from the passed file location.

Parameters
configuration

Reimplemented in org.corpus_tools.pepper.cli.PepperStarterConfiguration.

◆ setConfFolder()

void org.corpus_tools.pepper.common.PepperConfiguration.setConfFolder ( File  confFolder)
protected

Sets the folder containing the configuration file(s).

Parameters
confFolder

Member Data Documentation

◆ PROP_MEMORY_POLICY

final String org.corpus_tools.pepper.common.PepperConfiguration.PROP_MEMORY_POLICY = PROP_PREFIX + ".memPolicy"
static

Name of property to set the memory policy, for instance to configure the behavior of loading documents.

See MEMORY_POLICY for more details.

◆ SOURCES_RESOURCES

final String org.corpus_tools.pepper.common.PepperConfiguration.SOURCES_RESOURCES = "src/main/resources/"
static

Folder where the resources of a bundle is expected to be.

This follows the maven structure of a project