Pepper 3.7.0
A highly extensible plattform for conversion and
|
This class is an implementation of Pepper
.
More...
Inherits Pepper, and org.corpus_tools.pepper.connectors.PepperConnector.
Public Member Functions | |
boolean | isInitialized () |
Returns whether this object has been initialized. | |
void | init () |
Starts the OSGi environment and installs and starts all bundles located in the plugin directory. | |
void | stopOSGi () throws Exception |
Stops the OSGi environment. | |
PepperConfiguration | getConfiguration () |
{@inheritDoc Pepper::getConfiguration()} | |
PepperStarterConfiguration | getPepperStarterConfiguration () |
void | setConfiguration (PepperConfiguration configuration) |
BundleContext | getBundleContext () |
Returns the BundleContext object used for this PepperConnector . | |
void | setBundleContext (BundleContext bundleContext) |
Sets the BundleContext object used for this connector. | |
void | addSharedPackage (String packageName, String packageVersion) |
Adds a package to the list of shared packages. | |
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. | |
Bundle | install (URI bundleURI) throws BundleException |
Installs the given bundle, but does not start it. | |
void | uninstall (Long bundleId) throws BundleException |
Uninstalls a bundle from OSGi context. | |
void | uninstall (URI location) throws BundleException |
Uninstalls a bundle from OSGi context. | |
boolean | remove (String bundleName) throws BundleException, IOException |
Removes the passed bundle from the OSGi content and removes its jar file and folder if exist. | |
void | start (Long bundleId) |
Starts the passed bundle. | |
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 () |
Collection< String > | selfTest () |
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 . | |
String | getBlacklist () |
Bundle | getBundle (String groupId, String artifactId, String version) |
This method returns the bundle matching the specified maven project. | |
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 | |
String | printDependencies (String groupId, String artifactId, String version, String repositoryUrl) |
prints all transitive dependencies of the specified maven project | |
Set< String > | findAppropriateImporters (org.eclipse.emf.common.util.URI corpusPath) throws FileNotFoundException |
Collection< PepperModuleDesc > | getRegisteredImporters () |
Collection< ModuleFitness > | checkFitness () |
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. | |
Pepper | getPepper () |
Returns an instance of Pepper , which is running inside OSGi. | |
String | getSharedPackages () |
Returns a String, containing a formatted list of packages to be shared between current classloader and OSGi classloaders. | |
Collection< Bundle > | installBundles (URI pluginPath, List< URI > dropinPaths) throws BundleException, URISyntaxException, IOException |
Tries to install all jar-files, of the given pluginPath. | |
void | startBundles (Collection< Bundle > bundles) throws BundleException |
Starts all bundle being contained in the given list of bundles. | |
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) |
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.
Pepper
from inside the OSGi environment. PepperStarterConfiguration org.corpus_tools.pepper.connectors.impl.PepperOSGiConnector.getPepperStarterConfiguration | ( | ) |
PepperStarterConfiguration
|
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 |
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.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 |