Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » B3 » Using the ProvisioningAgent
Using the ProvisioningAgent [message #602121] Wed, 03 March 2010 11:14
Filip Hrbek is currently offline Filip Hrbek
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
Previous Topic:Problems with DS on startup
Next Topic:Using the ProvisioningAgent
Goto Forum:
  


Current Time: Thu Oct 23 00:50:18 GMT 2014

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

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