Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » B3 » Using the ProvisioningAgent
Using the ProvisioningAgent [message #518178] Wed, 03 March 2010 11:14 Go to next message
Filip Hrbek is currently offline Filip HrbekFriend
Messages: 233
Registered: July 2009
Senior Member
Hi all,

I am trying to user the provisioning framework properly in the b3 aggregator (no more restarting p2 bundles to switch p2 data area etc.).

I created a dedicated provisioning agent (with its location in the aggregation target) for everything that is done during the aggregation.
It means that, in headless run, there are no repository managers registered as "global" services, but they are obtained on demand from the provisioning agent.

Everything seems to work perfectly but one thing - if loading of UpdateSiteArtifactRepository fails (which is expected if the target folder is empty),
there's a piece of code that tries to refresh the artifact manager in this way (SimpleArtifactRepository.java, method setProperty):

public String setProperty(String key, String newValue) {
...
save();
//force repository manager to reload this repository because it caches properties
ArtifactRepositoryManager manager = (ArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.SERVICE_NAME);
if (manager.removeRepository(getLocation()))
manager.addRepository(this);
return oldValue;
}

Obviously, there's no artifact repository manager global service available at the moment, so I get an NPE on "manager.removeRepository".
(This does not prevent the aggregator from finishing its work since this error is silently ignored - it just means "the repo does not exist")

Does it mean that there are some pieces of code in p2 that are not adapted to proper usage of the provisioning framework?
Or am I doing anything wrong?
Should I rather ask at p2-dev?

Thanks for hints.

Filip
Re: Using the ProvisioningAgent [message #518193 is a reply to message #518178] Wed, 03 March 2010 12:05 Go to previous message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Filip,
I think you need to update the p2 that you use to the latest I-build where I believe this has been fixed already. That's
a good idea for other reasons as well since some of the p2 API's have changed now. The bugzillas you entered about
inconsistent getters and naming are two of them.

- thomas



On 03/03/2010 12:14 PM, Filip Hrbek wrote:
> Hi all,
>
> I am trying to user the provisioning framework properly in the b3
> aggregator (no more restarting p2 bundles to switch p2 data area etc.).
>
> I created a dedicated provisioning agent (with its location in the
> aggregation target) for everything that is done during the aggregation.
> It means that, in headless run, there are no repository managers
> registered as "global" services, but they are obtained on demand from
> the provisioning agent.
>
> Everything seems to work perfectly but one thing - if loading of
> UpdateSiteArtifactRepository fails (which is expected if the target
> folder is empty),
> there's a piece of code that tries to refresh the artifact manager in
> this way (SimpleArtifactRepository.java, method setProperty):
>
> public String setProperty(String key, String newValue) {
> ...
> save();
> //force repository manager to reload this repository because it caches
> properties
> ArtifactRepositoryManager manager = (ArtifactRepositoryManager)
> ServiceHelper.getService(Activator.getContext(),
> IArtifactRepositoryManager.SERVICE_NAME);
> if (manager.removeRepository(getLocation()))
> manager.addRepository(this);
> return oldValue;
> }
>
> Obviously, there's no artifact repository manager global service
> available at the moment, so I get an NPE on "manager.removeRepository".
> (This does not prevent the aggregator from finishing its work since this
> error is silently ignored - it just means "the repo does not exist")
>
> Does it mean that there are some pieces of code in p2 that are not
> adapted to proper usage of the provisioning framework?
> Or am I doing anything wrong?
> Should I rather ask at p2-dev?
>
> Thanks for hints.
>
> Filip
Re: Using the ProvisioningAgent [message #602131 is a reply to message #518178] Wed, 03 March 2010 12:05 Go to previous message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Filip,
I think you need to update the p2 that you use to the latest I-build where I believe this has been fixed already. That's
a good idea for other reasons as well since some of the p2 API's have changed now. The bugzillas you entered about
inconsistent getters and naming are two of them.

- thomas



On 03/03/2010 12:14 PM, Filip Hrbek wrote:
> Hi all,
>
> I am trying to user the provisioning framework properly in the b3
> aggregator (no more restarting p2 bundles to switch p2 data area etc.).
>
> I created a dedicated provisioning agent (with its location in the
> aggregation target) for everything that is done during the aggregation.
> It means that, in headless run, there are no repository managers
> registered as "global" services, but they are obtained on demand from
> the provisioning agent.
>
> Everything seems to work perfectly but one thing - if loading of
> UpdateSiteArtifactRepository fails (which is expected if the target
> folder is empty),
> there's a piece of code that tries to refresh the artifact manager in
> this way (SimpleArtifactRepository.java, method setProperty):
>
> public String setProperty(String key, String newValue) {
> ...
> save();
> //force repository manager to reload this repository because it caches
> properties
> ArtifactRepositoryManager manager = (ArtifactRepositoryManager)
> ServiceHelper.getService(Activator.getContext(),
> IArtifactRepositoryManager.SERVICE_NAME);
> if (manager.removeRepository(getLocation()))
> manager.addRepository(this);
> return oldValue;
> }
>
> Obviously, there's no artifact repository manager global service
> available at the moment, so I get an NPE on "manager.removeRepository".
> (This does not prevent the aggregator from finishing its work since this
> error is silently ignored - it just means "the repo does not exist")
>
> Does it mean that there are some pieces of code in p2 that are not
> adapted to proper usage of the provisioning framework?
> Or am I doing anything wrong?
> Should I rather ask at p2-dev?
>
> Thanks for hints.
>
> Filip
Previous Topic:Using the ProvisioningAgent
Next Topic:In search of a good name...
Goto Forum:
  


Current Time: Wed Apr 24 18:29:37 GMT 2024

Powered by FUDForum. Page generated in 0.02933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top