Using the ProvisioningAgent [message #602121] |
Wed, 03 March 2010 11:14 |
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
|
|
|
Powered by
FUDForum. Page generated in 0.04946 seconds