DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Storing information about bundles in Activator for the rest of the application to use
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2009
Red face Storing information about bundles in Activator for the rest of the application to use - 04-25-2009, 06:39 AM

Hi!

I'm quite new when it comes to RCP development after developing mostly plain old Java previously and I have run into a problem :-)

I have tried to solve this the POJO way, creating an object to store some values, in this case a particular type of Bundles.

The problem is that I can not access this object from my view classes, because they do not seem to carry a reference to the Activator class(?) I believe I have to do this in the Activator class, because the bundlelistener has to be registered with the context.

In my Activator class I have created an object servicesList containing a vector of Bundles

Code:
public class Activator extends AbstractUIPlugin implements BundleListener {

	// The shared instance
	private static Activator plugin;
	
	public ServicesList servicesList;
and registered a BundleListener
Code:
	public void start(BundleContext context) throws Exception {...
		this.servicesList= new ServicesList();
		context.addBundleListener(this);
		
	...}
In the listener I store an array of all bundles and sort out the ones I am interested in

Code:
@Override
	public void bundleChanged(BundleEvent event) {
		Bundle[] bundles = context.getBundles();
		servicesList.cleanList();
 		for(Bundle b:bundles){
 			if(b.getSymbolicName().startsWith("my.specific.bundletype.")){
 				servicesList.addServiceBundle(b);
 			}
 		}
		
	}
I reallize this is probably not the Eclipse way of doing storage, so does someone have another solution?

Any help would be greatly appreciated!
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2009
Default 05-02-2009, 11:03 AM

bump, anyone?
Reply With Quote
Reply

Tags
datastorage, eclipse, rcp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrieve type information in computeCompletionProposals method bowser83 Eclipse 0 02-20-2009 05:07 PM
Application fails on Mac - can't load application class kam_83 Eclipse 0 05-02-2008 10:21 AM
Using Existing OSGi Bundles in Eclipse RCP evan38109 Eclipse 2 04-15-2008 12:39 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com