public class ModuleResolverImpl extends Object implements ModuleResolver
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
.Modifier and Type | Field and Description |
---|---|
protected List<org.osgi.service.component.ComponentFactory> |
pepperExporterComponentFactories
TODO make docu
|
protected org.osgi.service.component.ComponentFactory |
pepperExporterComponentFactory
This unnecessary variable must be initialized, because of restrictions of
the maven osgi scr plugin.
|
protected List<org.osgi.service.component.ComponentFactory> |
pepperImporterComponentFactories
TODO make docu
|
protected org.osgi.service.component.ComponentFactory |
pepperImporterComponentFactory
This unnecessary variable must be initialized, because of restrictions of
the maven osgi scr plugin.
|
protected List<org.osgi.service.component.ComponentFactory> |
pepperManipulatorComponentFactories
TODO make docu
|
protected org.osgi.service.component.ComponentFactory |
pepperManipulatorComponentFactory
This unnecessary variable must be initialized, because of restrictions of
the maven osgi scr plugin.
|
static String |
PROP_OSGI_BUNDLES
name of system property to determine the locations of OSGi bundles
|
RESOURCES
Constructor and Description |
---|
ModuleResolverImpl()
TODO make docu
|
Modifier and Type | Method and Description |
---|---|
void |
activate(org.osgi.service.component.ComponentContext componentContext)
Sets the
ComponentContext of the OSGi environment the bundle was
started in. |
void |
addPepperExporterComponentFactory(org.osgi.service.component.ComponentFactory pepperExporterComponentFactory)
This method is called by OSGi framework and adds all registered
ComponentFactory objects having the name
PepperExporterComponentFactory to this object. |
void |
addPepperImporterComponentFactory(org.osgi.service.component.ComponentFactory pepperImporterComponentFactory)
This method is called by OSGi framework and adds all registered
ComponentFactory objects having the name
PepperImporterComponentFactory to this object. |
void |
addPepperManipulatorComponentFactory(org.osgi.service.component.ComponentFactory pepperManipulatorComponentFactory)
This method is called by OSGi framework and adds all registered
ComponentFactory objects having the name
PepperManipulatorComponentFactory to this object. |
org.osgi.service.component.ComponentContext |
getComponentContext()
Returns the
ComponentContext of the OSGi environment the bundle
was started in. |
PepperConfiguration |
getConfiguration()
Returns the configuration object for this converter object.
|
PepperExporter |
getPepperExporter(StepDesc stepDesc)
Creates an instance of
PepperExporter for each listed
ComponentFactory in list
#pepperExporterComponentFactories and returns that list. |
List<org.osgi.service.component.ComponentFactory> |
getPepperExporterComponentFactories()
TODO make docu
|
List<PepperExporter> |
getPepperExporters()
Creates an instance of
PepperExporter for each listed
ComponentFactory in list
#pepperExporterComponentFactories and returns that list. |
PepperImporter |
getPepperImporter(StepDesc stepDesc)
Returns a
PepperImporter object matching to the given
ImporterParams . |
List<org.osgi.service.component.ComponentFactory> |
getPepperImporterComponentFactories()
TODO make docu
|
List<PepperImporter> |
getPepperImporters()
Creates an instance of
PepperImporter for each listed
ComponentFactory in list
#pepperImporterComponentFactories and returns that list. |
PepperManipulator |
getPepperManipulator(StepDesc stepDesc)
Creates an instance of
PepperManipulator for each listed
ComponentFactory in list
#pepperManipulatorComponentFactories and returns that list. |
List<org.osgi.service.component.ComponentFactory> |
getPepperManipulatorComponentFactories()
TODO make docu
|
List<PepperManipulator> |
getPepperManipulators()
Creates an instance of
PepperManipulator for each listed
ComponentFactory in list
#pepperManipulatorComponentFactories and returns that list. |
PepperModule |
getPepperModule(StepDesc stepDesc)
Returns a
PepperModule object matching to the given
StepDesc . |
String |
getStatus()
Returns a status description as
String . |
void |
removePepperExporterComponentFactory(org.osgi.service.component.ComponentFactory pepperExporterComponentFactory)
TODO make some docu
|
void |
removePepperImporterComponentFactory(org.osgi.service.component.ComponentFactory pepperImporterComponentFactory)
TODO make docu
|
void |
removePepperManipulatorComponentFactory(org.osgi.service.component.ComponentFactory pepperManipulatorComponentFactory)
TODO make docu
|
protected String |
retrieveResourcePathFromBundle(PepperModule module)
Retrieves the path, where the bundle is located and extracts the path,
where resources are estimated
|
void |
setConfiguration(PepperConfiguration pepperConfiguration)
Sets the configuration object for this object.
|
protected void |
setResources(PepperModule module)
Sets resources to a given PepperModule-object.
|
protected void |
setTemporaries(PepperModule module,
int number)
Sets a temporary folder for each
PepperModule to store temporary
files if necessary. |
String |
toString()
TODO make docu
|
protected org.osgi.service.component.ComponentFactory pepperImporterComponentFactory
protected List<org.osgi.service.component.ComponentFactory> pepperImporterComponentFactories
protected org.osgi.service.component.ComponentFactory pepperManipulatorComponentFactory
protected List<org.osgi.service.component.ComponentFactory> pepperManipulatorComponentFactories
protected org.osgi.service.component.ComponentFactory pepperExporterComponentFactory
protected List<org.osgi.service.component.ComponentFactory> pepperExporterComponentFactories
public static final String PROP_OSGI_BUNDLES
public org.osgi.service.component.ComponentContext getComponentContext()
ComponentContext
of the OSGi environment the bundle
was started in.getComponentContext
in interface ModuleResolver
public void activate(org.osgi.service.component.ComponentContext componentContext)
ComponentContext
of the OSGi environment the bundle was
started in.activate
in interface ModuleResolver
public String getStatus()
String
. The returned
String
contains the number of all available PepperModule
objects in a readable format.getStatus
in interface ModuleResolver
String
representation of all PepperModule
objects
available by this PepperModuleResolver
object.public void addPepperImporterComponentFactory(org.osgi.service.component.ComponentFactory pepperImporterComponentFactory)
ComponentFactory
objects having the name
PepperImporterComponentFactory to this object. All
ComponentFactory
objects are stored in an internal object
#pepperImporterComponentFactories
addPepperImporterComponentFactory
in interface ModuleResolver
public void removePepperImporterComponentFactory(org.osgi.service.component.ComponentFactory pepperImporterComponentFactory)
removePepperImporterComponentFactory
in interface ModuleResolver
public List<org.osgi.service.component.ComponentFactory> getPepperImporterComponentFactories()
getPepperImporterComponentFactories
in interface ModuleResolver
public void addPepperManipulatorComponentFactory(org.osgi.service.component.ComponentFactory pepperManipulatorComponentFactory)
ComponentFactory
objects having the name
PepperManipulatorComponentFactory to this object. All
ComponentFactory
objects are stored in an internal object
#pepperManipulatorComponentFactories
.addPepperManipulatorComponentFactory
in interface ModuleResolver
public void removePepperManipulatorComponentFactory(org.osgi.service.component.ComponentFactory pepperManipulatorComponentFactory)
removePepperManipulatorComponentFactory
in interface ModuleResolver
public List<org.osgi.service.component.ComponentFactory> getPepperManipulatorComponentFactories()
getPepperManipulatorComponentFactories
in interface ModuleResolver
public void addPepperExporterComponentFactory(org.osgi.service.component.ComponentFactory pepperExporterComponentFactory)
ComponentFactory
objects having the name
PepperExporterComponentFactory to this object. All
ComponentFactory
objects are stored in the internal object list
#pepperExporterComponentFactories
.addPepperExporterComponentFactory
in interface ModuleResolver
pepperExporterComponentFactory
- ComponentFactory
object to be stored in internal listpublic void removePepperExporterComponentFactory(org.osgi.service.component.ComponentFactory pepperExporterComponentFactory)
removePepperExporterComponentFactory
in interface ModuleResolver
public List<org.osgi.service.component.ComponentFactory> getPepperExporterComponentFactories()
getPepperExporterComponentFactories
in interface ModuleResolver
protected void setResources(PepperModule module)
ModuleResolver.RESOURCES
is set, the PepperModule.getResources()
would be directed the
value contained by this propertyPepperModule.getResources()
would be directed to value of
/SYMBOLIC_NAME_OF_MODULEPepperModule.getResources()
would be directed to value of
/SYMBOLIC_NAME_OF_MODULEPepperModule.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 locatedmodule
- - the object for setting resourcesprotected String retrieveResourcePathFromBundle(PepperModule module)
public void setConfiguration(PepperConfiguration pepperConfiguration)
setConfiguration
in interface ModuleResolver
public PepperConfiguration getConfiguration()
PepperConfiguration
object was set, an automatic detection of
configuration file will be started.getConfiguration
in interface ModuleResolver
protected void setTemporaries(PepperModule module, int number)
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.module
- - the object for setting temporariesnumber
- - number of module instancepublic List<PepperImporter> getPepperImporters()
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.getPepperImporters
in interface ModuleResolver
PepperImporter
objects.public List<PepperManipulator> getPepperManipulators()
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.getPepperManipulators
in interface ModuleResolver
PepperManipulator
objects.public List<PepperExporter> getPepperExporters()
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.getPepperExporters
in interface ModuleResolver
PepperExporter
objects.public PepperModule getPepperModule(StepDesc stepDesc)
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.getPepperModule
in interface ModuleResolver
PepperModule
matching the given
StepDesc
public PepperImporter getPepperImporter(StepDesc stepDesc)
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.getPepperImporter
in interface ModuleResolver
PepperImporter
matching the given
ImporterParams
public PepperManipulator getPepperManipulator(StepDesc stepDesc)
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.getPepperManipulator
in interface ModuleResolver
PepperManipulator
objects.public PepperExporter getPepperExporter(StepDesc stepDesc)
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.getPepperExporter
in interface ModuleResolver
PepperExporter
objects.Copyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.