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

The ModuleResolverImpl realizes a bridge between the Pepper framework and the OSGi environment. More...

Inherits org.corpus_tools.pepper.core.ModuleResolver.

Public Member Functions

 ModuleResolverImpl ()
 TODO make docu.
 
ComponentContext getComponentContext ()
 Returns the ComponentContext of the OSGi environment the bundle was started in.
Returns

 
void activate (ComponentContext componentContext)
 Sets the ComponentContext of the OSGi environment the bundle was started in.
Parameters
componentContext

 
String getStatus ()
 Returns a status description as String.The returned String contains the number of all available PepperModule objects in a readable format.
Returns
String representation of all PepperModule objects available by this PepperModuleResolver object.

 
void addPepperImporterComponentFactory (ComponentFactory pepperImporterComponentFactory)
 This method is called by OSGi framework and adds all registered ComponentFactory objects having the name PepperImporterComponentFactory to this object.All ComponentFactory objects are stored in an internal object pepperImporterComponentFactories
 
void removePepperImporterComponentFactory (ComponentFactory pepperImporterComponentFactory)
 TODO make docu.
 
List< ComponentFactory > getPepperImporterComponentFactories ()
 TODO make docu.
 
void addPepperManipulatorComponentFactory (ComponentFactory pepperManipulatorComponentFactory)
 This method is called by OSGi framework and adds all registered ComponentFactory objects having the name PepperManipulatorComponentFactory to this object.All ComponentFactory objects are stored in an internal object pepperManipulatorComponentFactories.
 
void removePepperManipulatorComponentFactory (ComponentFactory pepperManipulatorComponentFactory)
 TODO make docu.
 
List< ComponentFactory > getPepperManipulatorComponentFactories ()
 TODO make docu.
 
void addPepperExporterComponentFactory (ComponentFactory pepperExporterComponentFactory)
 This method is called by OSGi framework and adds all registered ComponentFactory objects having the name PepperExporterComponentFactory to this object.All ComponentFactory objects are stored in the internal object list pepperExporterComponentFactories.
Parameters
pepperExporterComponentFactoryComponentFactory object to be stored in internal list @model pepperExporterComponentFactoryDataType= "de.hub.corpling.pepper.pepperFW.ComponentFactory" @generated

 
void removePepperExporterComponentFactory (ComponentFactory pepperExporterComponentFactory)
 TODO make some docu.
 
List< ComponentFactory > getPepperExporterComponentFactories ()
 TODO make docu.
 
synchronized void setConfiguration (PepperConfiguration pepperConfiguration)
 Sets the configuration object for this object.
Parameters
pepperConfiguration

 
PepperConfiguration getConfiguration ()
 Returns the configuration object for this converter object.If no PepperConfiguration object was set, an automatic detection of configuration file will be started.
Returns
configuration object

 
List< PepperImportergetPepperImporters ()
 Creates an instance of PepperImporter for each listed ComponentFactory in list pepperImporterComponentFactories and returns that list.This PepperModuleResolver instance does not store any link to the created object, so it can be used and removed as the caller like. Thus each call creates a new list containing new objects.
Returns
a list of PepperImporter objects.

 
List< PepperManipulatorgetPepperManipulators ()
 Creates an instance of PepperManipulator for each listed ComponentFactory in list pepperManipulatorComponentFactories and returns that list.This PepperModuleResolver instance does not store any link to the created object, so it can be used and removed as the caller like. Thus each call creates a new list containing new objects.
Returns
a list of PepperManipulator objects.

 
List< PepperExportergetPepperExporters ()
 Creates an instance of PepperExporter for each listed ComponentFactory in list pepperExporterComponentFactories and returns that list.This PepperModuleResolver instance does not store any link to the created object, so it can be used and removed as the caller like. Thus each call creates a new list containing new objects.
Returns
a list of PepperExporter objects.

 
PepperModule getPepperModule (StepDesc stepDesc)
 Returns a PepperModule object matching to the given StepDesc.A new instance of the specific PepperImporter class is created and returned. No references to the returned object will be stored in this PepperModuleResolver object. When calling getPepperModule(ImporterParams) a new instance of PepperModule is created.
Parameters
pepperImporterParamsspecifies the PepperModule object to be found
Returns
a new instance of PepperModule matching the given StepDesc

 
PepperImporter getPepperImporter (StepDesc stepDesc)
 Returns a PepperImporter object matching to the given ImporterParams.A new instance of the specific PepperImporter class is created and returned. No references to the returned object will be stored in this PepperModuleResolver object. When calling getPepperImporter(ImporterParams) a new instance of PepperImporter is created.
Parameters
pepperImporterParamsspecifies the PepperImporter object to be found
Returns
a new instance of PepperImporter matching the given ImporterParams

 
PepperManipulator getPepperManipulator (StepDesc stepDesc)
 Creates an instance of PepperManipulator for each listed ComponentFactory in list pepperManipulatorComponentFactories and returns that list.This PepperModuleResolver instance does not store any link to the created object, so it can be used and removed as the caller like. Thus each call creates a new list containing new objects.
Returns
a list of PepperManipulator objects.

 
PepperExporter getPepperExporter (StepDesc stepDesc)
 Creates an instance of PepperExporter for each listed ComponentFactory in list pepperExporterComponentFactories and returns that list.This PepperModuleResolver instance does not store any link to the created object, so it can be used and removed as the caller like. Thus each call creates a new list containing new objects.
Returns
a list of PepperExporter objects.

 
String toString ()
 TODO make docu.
 

Static Public Attributes

static final String PROP_OSGI_BUNDLES = "osgi.bundles"
 name of system property to determine the locations of OSGi bundles
 
- Static Public Attributes inherited from org.corpus_tools.pepper.core.ModuleResolver
static final String RESOURCES = ".resources"
 

Protected Member Functions

void setResources (PepperModule module)
 Sets resources to a given PepperModule-object. More...
 
String retrieveResourcePathFromBundle (PepperModule module)
 Retrieves the path, where the bundle is located and extracts the path, where resources are estimated. More...
 
void setTemporaries (PepperModule module, int number)
 Sets a temporary folder for each PepperModule to store temporary files if necessary. More...
 

Protected Attributes

ComponentFactory pepperImporterComponentFactory = null
 This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin. More...
 
List< ComponentFactory > pepperImporterComponentFactories
 TODO make docu.
 
ComponentFactory pepperManipulatorComponentFactory
 This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin. More...
 
List< ComponentFactory > pepperManipulatorComponentFactories
 TODO make docu.
 
ComponentFactory pepperExporterComponentFactory
 This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin. More...
 
List< ComponentFactory > pepperExporterComponentFactories
 TODO make docu.
 

Detailed Description

The ModuleResolverImpl realizes a bridge between the Pepper framework and the OSGi environment.

Through OSGi declarative services all PepperModule no matter if PepperImporter, PepperExporter or PepperManipulator, all of them are registered in the ModuleResolverImpl. The main task of this class is to get a description of a PepperModule and to resolve a real instance of that PepperModule.

Author
Florian Zipser

Member Function Documentation

◆ retrieveResourcePathFromBundle()

String org.corpus_tools.pepper.core.ModuleResolverImpl.retrieveResourcePathFromBundle ( PepperModule  module)
protected

Retrieves the path, where the bundle is located and extracts the path, where resources are estimated.

Returns

◆ setResources()

void org.corpus_tools.pepper.core.ModuleResolverImpl.setResources ( PepperModule  module)
protected

Sets resources to a given PepperModule-object.

The policy of computing the resource path is the following:

  1. If a system property named SYMBOLIC_NAME_OF_MODULE+RESOURCES is set, the PepperModule#getResources() would be directed the value contained by this property
  2. If environment variable {@value PepperConfiguration::ENV_PEPPER_MODULE_RESOURCES} is set, PepperModule#getResources() would be directed to value of {@value PepperConfiguration::ENV_PEPPER_MODULE_RESOURCES} /SYMBOLIC_NAME_OF_MODULE
  3. If system property {@value PepperConfiguration::PROP_PEPPER_MODULE_RESOURCES} is set, PepperModule#getResources() would be directed to value of {@value PepperConfiguration::PROP_PEPPER_MODULE_RESOURCES} /SYMBOLIC_NAME_OF_MODULE
  4. If nothing is set, PepperModule#getResources() would be directed to a subfolder having the name equal to the symbolic name of the bundle, which is located in the same folder as the bundle is located
Parameters
module
  • the object for setting resources

◆ setTemporaries()

void org.corpus_tools.pepper.core.ModuleResolverImpl.setTemporaries ( PepperModule  module,
int  number 
)
protected

Sets a temporary folder for each PepperModule to store temporary files if necessary.

The general temporary folder could either be given via the property PepperConfiguration#PROP_TEMP_FOLDER or if this is not set, resolved by via using the temporary folder provided by the OS.
The specific temporary folder is given by the general temporary folder + a subfolder for the modules name and a subfolder for the number of the instance of the current module.

Parameters
module
  • the object for setting temporaries
number
  • number of module instance

Member Data Documentation

◆ pepperExporterComponentFactory

ComponentFactory org.corpus_tools.pepper.core.ModuleResolverImpl.pepperExporterComponentFactory
protected

This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin.

Here it is not possible to use a list as osgi-reference. (this is a workaround)

◆ pepperImporterComponentFactory

ComponentFactory org.corpus_tools.pepper.core.ModuleResolverImpl.pepperImporterComponentFactory = null
protected

This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin.

Here it is not possible to use a list as osgi-reference. (this is a workaround)

◆ pepperManipulatorComponentFactory

ComponentFactory org.corpus_tools.pepper.core.ModuleResolverImpl.pepperManipulatorComponentFactory
protected

This unnecessary variable must be initialized, because of restrictions of the maven osgi scr plugin.

Here it is not possible to use a list as osgi-reference. (this is a workaround)