|
Re: How to temporarily store data to use after PlatformUI.getWorkbench().restart(); [message #483283 is a reply to message #483182] |
Mon, 31 August 2009 21:00 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Hi Markus,
Add lifeycle control to your RCP application:
If you override this method in your WorkbenchAdvisor:
@Override
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
configurer.setSaveAndRestore(true);
}
then the saveState(IMemento) and restoreSate(IMemento) methods are called
during the lifecycle in your advisor classes.
If your application is not in control then I would save and restore state in
one of my activators
@See AbstractUiPlugin.getDialogSettings(),
AbstractUiPlugin.getPreferenceStore(), AbstractUiPlugin.getStateLocation()
Best regards,
Wim Jongman
> Hi,
>
> I want to hold some data to use after restart but I don't want to store
them
> in Preferences because I'll only use this for restart-purposes.
>
> I've already tried System.setProperty() but this doesn't work. :-(
>
> Any other ideas?
>
> Markus
|
|
|
Re: How to temporarily store data to use after PlatformUI.getWorkbench().restart(); [message #483409 is a reply to message #483283] |
Tue, 01 September 2009 14:13 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: TheRealHawk.Freenet.de
But I want to hold my login-data to do a relogin after restart and therefore
I don't want to store the data permanently.
Markus
"Wim Jongman" <wim.jongman@gmail.com> schrieb im Newsbeitrag
news:h7hdl5$dfp$1@build.eclipse.org...
> Hi Markus,
>
> Add lifeycle control to your RCP application:
>
> If you override this method in your WorkbenchAdvisor:
>
> @Override
> public void initialize(IWorkbenchConfigurer configurer) {
> super.initialize(configurer);
> configurer.setSaveAndRestore(true);
> }
>
> then the saveState(IMemento) and restoreSate(IMemento) methods are called
> during the lifecycle in your advisor classes.
>
> If your application is not in control then I would save and restore state
> in
> one of my activators
>
> @See AbstractUiPlugin.getDialogSettings(),
> AbstractUiPlugin.getPreferenceStore(), AbstractUiPlugin.getStateLocation()
>
>
> Best regards,
>
> Wim Jongman
>
>> Hi,
>>
>> I want to hold some data to use after restart but I don't want to store
> them
>> in Preferences because I'll only use this for restart-purposes.
>>
>> I've already tried System.setProperty() but this doesn't work. :-(
>>
>> Any other ideas?
>>
>> Markus
|
|
|
Re: How to temporarily store data to use after PlatformUI.getWorkbench().restart(); [message #483419 is a reply to message #483409] |
Tue, 01 September 2009 14:57 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Eclipse User wrote on Tue, 01 September 2009 10:13 | Originally posted by: TheRealHawk.Freenet.de
But I want to hold my login-data to do a relogin after restart and therefore
I don't want to store the data permanently.
|
The IMemento (which is a standard way to store application state between restarts) will exist until the next restart. If that's too long for you, then you should write out the information to a file in your plugin state location when your bundle stops (and you know you're doing a restart), and read it in (and delete the file) when your plugin starts (on next startup).
Then it's only on disk for the length of the restart.
Eclipse has bundles (like Equinox secure storage) that would allow you to encrypt it while on the disk ... you still need a key in your code to encrypt/unencrypt, but at least it wouldn't be plain text.
PW
|
|
|
Powered by
FUDForum. Page generated in 0.04105 seconds