Pepper
3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
|
This class is an implementation of Pepper. More...
Inherits org.corpus_tools.pepper.common.Pepper, and org.corpus_tools.pepper.connectors.PepperConnector.
Public Member Functions | |
boolean | isInitialized () |
Returns whether this object has been initialized. More... | |
void | init () |
Starts the OSGi environment and installs and starts all bundles located in the plugin directory. More... | |
void | stopOSGi () throws Exception |
Stops the OSGi environment. More... | |
PepperConfiguration | getConfiguration () |
{@inheritDoc Pepper::getConfiguration()} | |
PepperStarterConfiguration | getPepperStarterConfiguration () |
void | setConfiguration (PepperConfiguration configuration) |
Sets the configuration for Pepper. More... | |
BundleContext | getBundleContext () |
Returns the BundleContext object used for this PepperConnector. More... | |
void | setBundleContext (BundleContext bundleContext) |
Sets the BundleContext object used for this connector. More... | |
void | addSharedPackage (String packageName, String packageVersion) |
Adds a package to the list of shared packages. More... | |
Long | getBundleId (URI location) |
Returns the bundle id to an already installed bundle from the passed location. | |
Bundle | installAndCopy (URI bundleURI) throws BundleException, IOException |
Installs the given bundle and copies it to the plugin path, but does not start it. More... | |
Bundle | install (URI bundleURI) throws BundleException |
Installs the given bundle, but does not start it. More... | |
void | uninstall (Long bundleId) throws BundleException |
Uninstalls a bundle from OSGi context. More... | |
void | uninstall (URI location) throws BundleException |
Uninstalls a bundle from OSGi context. More... | |
boolean | remove (String bundleName) throws BundleException, IOException |
Removes the passed bundle from the OSGi content and removes its jar file and folder if exist. More... | |
void | start (Long bundleId) |
Starts the passed bundle. More... | |
String | createJob () |
{@inheritDoc Pepper::createJob()} | |
PepperJob | getJob (String id) throws JobNotFoundException |
{@inheritDoc Pepper::getJob(String)} | |
boolean | removeJob (String id) throws JobNotFoundException |
{@inheritDoc Pepper::removeJob(String)} | |
Collection< PepperModuleDesc > | getRegisteredModules () |
{@inheritDoc Pepper::getRegisteredModules()} | |
String | getRegisteredModulesAsString () |
Returns a string representation of the method getRegisteredModules(). More... | |
Collection< String > | selfTest () |
Checks if the Pepper framework is ready to run. More... | |
boolean | update (String groupId, String artifactId, String repositoryUrl, boolean isSnapshot, boolean ignoreFrameworkVersion) |
This method checks the pepperModules in the modules.xml for updates and triggers the installation process if a newer version is available. | |
String | getFrameworkVersion () |
returns the version of pepper-framework read from the pepper-framework OSGi Bundle. More... | |
String | getBlacklist () |
Bundle | getBundle (String groupId, String artifactId, String version) |
This method returns the bundle matching the specified maven project. More... | |
boolean | isSingleton (Bundle bundle) |
Returns whether the given bundle is a singleton. | |
String | printDependencies (String bundleId) |
prints all transitive dependencies of the specified bundle, if the bundle can be related to a maven project More... | |
String | printDependencies (String groupId, String artifactId, String version, String repositoryUrl) |
prints all transitive dependencies of the specified maven project More... | |
Set< String > | findAppropriateImporters (org.eclipse.emf.common.util.URI corpusPath) throws FileNotFoundException |
Collection< PepperModuleDesc > | getRegisteredImporters () |
Returns all PepperModuleDesc corresponding to a registered importer. More... | |
Collection< ModuleFitness > | checkFitness () |
Checks the fitness of each registered Pepper module. More... | |
Public Member Functions inherited from org.corpus_tools.pepper.common.Pepper | |
Set< String > | findAppropriateImporters (final URI corpusPath) throws FileNotFoundException |
Returns the names of importers which can import the data located at the specified corpusPath . More... | |
Static Public Attributes | |
static final String | PROP_OSGI_BUNDLES = "osgi.bundles" |
name of system property to determine the locations of OSGi bundles | |
Protected Member Functions | |
BundleContext | startEquinox () throws Exception |
Starts the OSGi Equinox environment. More... | |
Pepper | getPepper () |
Returns an instance of Pepper, which is running inside OSGi. More... | |
String | getSharedPackages () |
Returns a String, containing a formatted list of packages to be shared between current classloader and OSGi classloaders. More... | |
Collection< Bundle > | installBundles (URI pluginPath, List< URI > dropinPaths) throws BundleException, URISyntaxException, IOException |
Tries to install all jar-files, of the given pluginPath. More... | |
void | startBundles (Collection< Bundle > bundles) throws BundleException |
Starts all bundle being contained in the given list of bundles. More... | |
This class is an implementation of Pepper.
It acts as a bridge between the pure java environment and the Pepper universe inside the OSGi environment. This class should help not dealing with OSGi issues when using Pepper and therefore enables it to use Pepper as an embedded library.
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.addSharedPackage | ( | String | packageName, |
String | packageVersion | ||
) |
Adds a package to the list of shared packages.
The shared packages are necessary to bridge the OSGi container. In OSGi each bundle has its own classloader, which is a different one than in a standard Java application. In Java classes needs to be load by the same class loader to have a unique identification. For instance to share Salt objects between Pepper modules and the application outside OSGi they need to be added to shared packeges.
packageName | name of the package |
packageVersion | version of the package (normally the bundle's version) |
Collection<ModuleFitness> org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.checkFitness | ( | ) |
Checks the fitness of each registered Pepper module.
The fitness of a module indicates in what way a module is docking to the Pepper interface. For instance it checks whether a module provides a contact address of the module'supplier. Or when the module is an importer whether it supports the PepperImporterImpl#isImportable(URI) method.
Further the fitness says whether a module is ready to start.
Implements org.corpus_tools.pepper.common.Pepper.
String org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getBlacklist | ( | ) |
Bundle org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getBundle | ( | String | groupId, |
String | artifactId, | ||
String | version | ||
) |
This method returns the bundle matching the specified maven project.
groupId | – the project's group id |
artifactId | – the project's artifact id |
version | – the project's version |
BundleContext org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getBundleContext | ( | ) |
Returns the BundleContext object used for this PepperConnector.
String org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getFrameworkVersion | ( | ) |
|
protected |
Returns an instance of Pepper, which is running inside OSGi.
This class will be resolved via the BundleContext. If it was resolved once, a singleton instance of this object is returned.
PepperStarterConfiguration org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getPepperStarterConfiguration | ( | ) |
Collection<PepperModuleDesc> org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getRegisteredImporters | ( | ) |
Returns all PepperModuleDesc corresponding to a registered importer.
When no importer is registered returns an empty collection, not null.
Implements org.corpus_tools.pepper.common.Pepper.
String org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getRegisteredModulesAsString | ( | ) |
Returns a string representation of the method getRegisteredModules().
Implements org.corpus_tools.pepper.common.Pepper.
|
protected |
Returns a String, containing a formatted list of packages to be shared between current classloader and OSGi classloaders.
The list is formatted as it could be taken of the property Constants#FRAMEWORK_SYSTEMPACKAGES_EXTRA.
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.init | ( | ) |
Starts the OSGi environment and installs and starts all bundles located in the plugin directory.
Sets property PepperOSGiRunner#PROP_TEST_DISABLED to true.
Implements org.corpus_tools.pepper.connectors.PepperConnector.
Bundle org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.install | ( | URI | bundleURI | ) | throws BundleException |
Installs the given bundle, but does not start it.
bundleURI |
BundleException |
Bundle org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.installAndCopy | ( | URI | bundleURI | ) | throws BundleException, IOException |
Installs the given bundle and copies it to the plugin path, but does not start it.
If the the URI is of scheme http or https, the file will be downloaded.
If the URI points to a zip file, it will be extracted and copied.
bundleURI |
BundleException | |
IOException |
|
protected |
Tries to install all jar-files, of the given pluginPath.
Each installed jar will be added to system property {@value PROP_OSGI_BUNDLES} as reference:file:JAR_FILE.
pluginPath | path where the bundles are |
bundleAction | a flag, which shows if bundle has to be started or just installed |
dropinPaths | A list of additionally paths to load bundles from |
BundleException | |
URISyntaxException | |
IOException |
boolean org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.isInitialized | ( | ) |
Returns whether this object has been initialized.
Implements org.corpus_tools.pepper.connectors.PepperConnector.
String org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.printDependencies | ( | String | bundleId | ) |
prints all transitive dependencies of the specified bundle, if the bundle can be related to a maven project
bundleId | – the bundle's id |
String org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.printDependencies | ( | String | groupId, |
String | artifactId, | ||
String | version, | ||
String | repositoryUrl | ||
) |
prints all transitive dependencies of the specified maven project
groupId | – the project's group id |
artifactId | – the project's artifact id |
version | – the project's version |
boolean org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.remove | ( | String | bundleName | ) | throws BundleException, IOException |
Removes the passed bundle from the OSGi content and removes its jar file and folder if exist.
BundleException | |
IOException |
Collection<String> org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.selfTest | ( | ) |
Checks if the Pepper framework is ready to run.
This means, it checks if everything necessary is given and if all registered modules could be ran. This method can be used as a kind of integration test.
Implements org.corpus_tools.pepper.common.Pepper.
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.setBundleContext | ( | BundleContext | bundleContext | ) |
Sets the BundleContext object used for this connector.
bundleContext | the object to be set |
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.setConfiguration | ( | PepperConfiguration | configuration | ) |
Sets the configuration for Pepper.
configuration |
Implements org.corpus_tools.pepper.common.Pepper.
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.start | ( | Long | bundleId | ) |
Starts the passed bundle.
bundle |
|
protected |
Starts all bundle being contained in the given list of bundles.
bundles | a list of bundles to start |
BundleException |
|
protected |
Starts the OSGi Equinox environment.
Exception |
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.stopOSGi | ( | ) | throws Exception |
Stops the OSGi environment.
Exception |
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.uninstall | ( | Long | bundleId | ) | throws BundleException |
Uninstalls a bundle from OSGi context.
BundleException |
void org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.uninstall | ( | URI | location | ) | throws BundleException |
Uninstalls a bundle from OSGi context.
BundleException |