Skip to main content



      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 17:03
Eclipse UserFriend
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:Custom icons for workbench content
Next Topic:How to create singleton from extention
Goto Forum:
  


Current Time: Wed Jul 23 07:51:09 EDT 2025

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

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

Back to the top