I have a large, p2-enabled Eclipse RCP app composed of many individual features 
(>500 plugins). Currently, the app is deployed as a single product. I'd like to 
break off the majority of the features and have them installed automatically 
from one or more p2 repositories via a custom, lightweight, headless app 
accompanied by the necessary p2/equinox bundles and their transitive 
dependencies. What's more (and this is important), I need the headless app to 
automatically start some of the installed plugins (without a platform 
restart!), which would kick off the full-blown application.

Imagine a "core" product accompanied by dozens of additional features (which 
have already been developed). Different users in the organization would use the 
product for different needs and roles. Instead of downloading a single, 
gargantuan product, the app would automatically download and install only the 
features necessary for their particular roles and responsibilities. In fact, 
some users would automatically be prevented from seeing or being able to 
download certain features.

More specifically, my users would download and execute a simple script that 
would kick off an installation process like the following:

    1. The script kicks off the RCP app's Eclipse executable (done/works ok)
    2. The Eclipse/Equinox framework initializes, runs the SimpleConfigurator, 
and starts my IApplication bundle (done/works ok)
    3. The framework instantiates my IApplication implementation based on my 
config.ini's eclipse.application param (done/works ok)
    4. The framework invokes my IApplication instance's 
start(IApplicationContext) method
    5. My IApplication instance resolves and executes a p2 ProvisioningJob 
based on a configurable list of IUs (done/works ok)
    6. My IApplication instance uses the Eclipse extension framework to 
identify one of the newly installed bundles that contains its own IApplication 
(doesn't work)
    7. My IApplication instance uses the Eclipse extension framework to create 
an executable instance of the newly installed bundle's IApplication class 
(doesn't work)
    8. My IApplication instance calls the other IApplication instance and 
blocks until the other IApplication returns

So far, I've got an IApplication implementation that successfully works through 
Step #5. However, everything after Step 5 is giving me problems. As you know, 
the p2 logic only installs the IUs. It doesn't start the plugins, much less 
make their extension points available for creating executable extensions.

I tried to mimic the p2 UI logic by looking up the SimpleConfigurator and 
invoking its applyConfiguration() method. However, it caused the 
org.eclipse.core.runtime plugin to stop, kill the running Platform, and stop my 
IApplication instance and its plugin.

After that I tried to initialize my installed plugins manually, such as using 
the PlatformAdmin to set start levels, resolve, etc. However, I kept running 
into NoClassDefFound errors since some plugins didn't lazily initialize as 
expected.

I also tried to set up a separate profile, install my "heavyweight" features to 
the dropins directory, and use the reconciler APIs to initialize my plugins. 
Unfortunately, the app still tried to restart the org.eclipse.core.runtime 
plugin and kill the running Platform.

Any advice? This is a crucial step in making my RCP app lightweight and easier 
to deploy and update.

Thanks,
Chip
_______________________________________________
p2-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/p2-dev

Reply via email to