[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] How to set activate on startup to 'true' in bundles.info file

Hi Pradeep,

Whether a bundle will be marked for start or not in the bundles.info is determined by the metadata, published for this bundle in the p2 repository, from where it is installed. The description of the bundle's IU in the repo can include a touchpoint action (see the documentation about org.eclipse.equinox.p2.touchpoint.eclipse.markStarted on [1]) that explicitly instructs the p2 framework to mark the bundle to be started.

There are a few ways to add such actions for your components but the most straightforward one is through the <configuration> section in your .product file. There is a "Configuration" tab in the Product Editor in Eclipse IDE for this purpose, and since I was not able to find any specification about the contents of the .product file, I give a very basic example for reference:

<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product name="Simple Product" uid="SimpleProduct" version="1.0.0" useFeatures="false" includeLaunchers="true">

   <configIni use="default">

      <plugin id="Bundle"/>

      <plugin id="Bundle" autoStart="true" startLevel="0" />


Regarding your second question - if it is possible for all the bundles in a product to be started, there is a trick in p2 which can make this happen, although, as Neil pointed out, it is not recommended and not needed in most cases. Product publishing generates a special configuration unit ('tooling.osgi.bundle.default') in the repository which instruments the default behavior of all bundles in the product ([2]). You can override this unit by means of a special p2.inf file ([3]) that customizes the product and replaces the osgi.bundle.default with another version which is capable of forcing the start of all bundles (unless the bundle comes with its own touchpoint action or CU that prevents the start).

[1] http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_actions_touchpoints.html 
[2] http://wiki.eclipse.org/Equinox/p2/Setting_Start_Levels 
[3] http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/guide/p2_customizing_metadata.html 

Shenol Yousouf
SAP Labs Bulgaria

-----Original Message-----
From: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] On Behalf Of Pradeep Fernando
Sent: 16 август 2011 г. 09:23 ч.
To: Equinox development mailing list
Subject: Re: [equinox-dev] How to set activate on startup to 'true' in bundles.info file

Hi Neil/devs,

On Tue, Aug 16, 2011 at 8:56 AM, Neil Bartlett <njbartlett@xxxxxxxxx> wrote:
> I don't actually know the answer to your question, but I'm hoping the
> answer is "no, that's not possible".

Yes I got your point. I too think you are correct here.
But I'm not clear the what makes it 'true' or 'true' in the bundles.info file.

like, "all bundles that has an activator will be activated by startup."

may be this is a trivial question, but I couldnt find a document
explaining that.


> Your bundle probably does not need to be activated when Eclipse is
> started. If you and all other plug-in authors were able to do this,
> then Eclipse would take hours to start.
> Please consider other ways to achieve what you want to do.
> Rgds,
> Neil
> On Tue, Aug 16, 2011 at 4:11 AM, Pradeep Fernando <pradeepfn@xxxxxxxxx> wrote:
>> Hi devs,
>> I have a p2-aware product that uses simpleconfigurator. In the
>> bundles.info file the activate on startup field is set to 'false' for
>> most of the bundles.
>> How simpleconfigurator decides weather to put to 'false' or 'true' in
>> bundles.info. Is it possible to make the default value to 'true'.
>> (activate bundle at startup)
>> Thanks,
>> --Pradeep Fernando
>> _______________________________________________
>> equinox-dev mailing list
>> equinox-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev

Pradeep Fernando.
equinox-dev mailing list