Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to create singleton from extention
How to create singleton from extention [message #585719] Sun, 23 November 2008 22:03
Andrey Ilinykh is currently offline Andrey IlinykhFriend
Messages: 12
Registered: July 2009
Junior Member
Hello, everybody!
In my plugin I define extention point which describes service I wanted to be
implemented by contributers- IService.
When I need all implementations I go to extention registry and read all
configuration elements:
IConfigurationElement[] config =
Platform.getExtensionRegistry().getConfigurationElementsFor( "myRcp.brokers");
Then I create objects by caling
for (IConfigurationElement e : config) {
try {
Object o = e.createExecutableExtension("class");
IService service = (IService)o;
....
} catch(){}

I works. The problem is - each contribution is a singlton. I don't have to
create new object every time when I need it, but rather use already created
instance.
How to do this? Is it my responsibility to create just one object? Or
eclipse has some facility for that?

Thank you,
Andrey
Previous Topic:How to create singleton from extention
Next Topic:Remove action from ToolBarManager
Goto Forum:
  


Current Time: Thu Apr 25 06:43:43 GMT 2024

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

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

Back to the top