Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading a singleton with a specified classloader in Eclipse
    primarykey
    data
    text
    <p>I have a little problem in my project. We develop a client for our server as eclipse plugin.</p> <p>There, we have our 'ApplicationRegistry' which is barely more than a map that holds all objects we need only once but shouldn't be singletons. This ApplicationRegistry is implemented as enum singleton and among some other stuff in another plugin. Everything works fine so far.</p> <p>Now the customer wants different 'perspectives' which show slightly different features. This is also no problem. By now we only have two runnables and two different menu entries to start the two different classes but it is no problem (and would probably be better) to divide them in to two or three plugins.</p> <p>Now I come to the problem: We can run both of those perspectives at a time. But the ApplicationRegistry is created by the classloader of its own plugin and therefor exists once for all of our perspectives. So when we try to open a new tab in the first perspective, it opens in the second.</p> <p>To cut a long story short: plugins 'parent1' and 'parent2' use a singleton in plugin 'child' and affect each other in an undesirable way. My idea is to load the singleton in each of the parent plugins with their own classloader. But since I have no idea how to load an enum singleton with a specified classloader, I cannot verify if this solution would do it.</p> <p>Can anybody tell me how to load an enum singleton with a specified classloader (and if the correct ApplicationRegistry would get addressed furthermore in each plugin), if this could work or if there is another solution that doesn't involve a huge re-engineering in the whole project?</p> <p>Thanks, Sebastian</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload