Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » [P2] Extending RepositoryTrackerComponent
[P2] Extending RepositoryTrackerComponent [message #850067] Thu, 19 April 2012 18:31 Go to next message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
Hi,

I'm relatively new to p2 and Eclipse services, and I need advice on how to go about replacing RepositoryTrackerComponent with my own implementation, which in-turn would provide my own implementation of RepositoryTracker.

I thought about registering my IAgentServiceFactory service the same way I register my Policy, in my RCP product plug-in's Activator.start() method (i.e. context.registerService(...)), but it didn't work; the original RepositoryTrackerComponent is still used.

Your support is greatly appreciated!

-Olivier
Re: [P2] Extending RepositoryTrackerComponent [message #850165 is a reply to message #850067] Thu, 19 April 2012 20:45 Go to previous messageGo to next message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
Well, after some more troubleshooting and trial-and-error, I found a way to make this work.

I wouldn't be surprised if there were a better way, so please advise if you know one.

Here's how I did it, in my plug-in's Activator:

	public void start(BundleContext context) throws Exception {
		...
		registerP2RepositoryTracker(context);
	}

	private void registerP2RepositoryTracker(BundleContext context) {
		ProvisioningUI ui = ProvisioningUI.getDefaultUI();

		// Extending ColocatedRepositoryTracker since we'll always have both repos at the same location
		ColocatedRepositoryTracker tracker = new ColocatedRepositoryTracker(ui) {

			@Override
			public void reportLoadFailure(URI location, ProvisionException e) {
				// Just pop a message saying updates are temporarily unavailable
				...
			}
		};
		ui.getSession().getProvisioningAgent().registerService(RepositoryTracker.class.getName(), tracker);
	}
Re: [P2] Extending RepositoryTrackerComponent [message #850224 is a reply to message #850165] Thu, 19 April 2012 22:10 Go to previous message
Olivier Labrosse is currently offline Olivier LabrosseFriend
Messages: 49
Registered: November 2011
Member
It turns out a lesser issue spawned from this "fix".

My message shows just fine, but I still get the "No updates were found." message after, which I meant to replace with mine.

I've spent the last hour or so trying to find a way to get rid of it, without success.

Again, I ask if you can advise me on this particular issue of mine.

Thanks.
Previous Topic:disable bundle verification during P2 update
Next Topic:P2: cached repository data
Goto Forum:
  


Current Time: Mon Oct 18 05:02:32 GMT 2021

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

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

Back to the top