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 #34214] 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
How to do this? Is it my responsibility to create just one object? Or
eclipse has some facility for that?

Thank you,
Previous Topic:Custom icons for workbench content
Next Topic:How to create singleton from extention
Goto Forum:

Current Time: Mon Sep 20 13:52:36 GMT 2021

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

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

Back to the top