Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Loading data when Application starts
Loading data when Application starts [message #1080055] Mon, 05 August 2013 12:17 Go to next message
Johannes Spreemann is currently offline Johannes SpreemannFriend
Messages: 19
Registered: August 2013
Location: Germany/Netherlands
Junior Member
Hello,

I want to load some specific data/preferences for my e4 application without compatibility to 3.x. I took this class from a standard java application i created. It's a singleton config class with several classes that store data for specified parts of my application.

Now I have the problem when to load/create my configuration class to get access to the values when the application starts.

Do I have to create an OSGI service for this or is there somewhere the possibility to control it manually within some kind of main method as in a standard app.

Greetings
Johannes
Re: Loading data when Application starts [message #1080061 is a reply to message #1080055] Mon, 05 August 2013 12:21 Go to previous messageGo to next message
Eclipse UserFriend
You can provide a lifecycle POJO and put your startup code in a method annotated @PostContextCreate in which you can have the application context injected. Something like @PostContextCreate public void setUp(IEclipseContext){..}

http://www.vogella.com/articles/Eclipse4LifeCycle/article.html

[Updated on: Mon, 05 August 2013 12:22] by Moderator

Report message to a moderator

Re: Loading data when Application starts [message #1080069 is a reply to message #1080061] Mon, 05 August 2013 12:33 Go to previous message
Johannes Spreemann is currently offline Johannes SpreemannFriend
Messages: 19
Registered: August 2013
Location: Germany/Netherlands
Junior Member
This is exactly what I was looking for! Thank you!
Previous Topic:HandledToolbaritem display text and icon
Next Topic: e4 compatability layer: add toolbar item in main toolbar
Goto Forum:
  


Current Time: Sat Apr 20 10:41:11 GMT 2024

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

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

Back to the top