Ensuring RSE has initialized/loaded [message #629804] |
Wed, 29 September 2010 11:17  |
Eclipse User |
|
|
|
What is the recommended way to ensure that RSE has fully initialized loaded prior to using it? I have some code that checks if a profle exists and if not it creates it:
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
ISystemProfile profile = registry.getSystemProfile("ZZ");
IHost host = null;
if (profile == null){
try{
profile = registry.createSystemProfile("ZZ", true);
}catch (Exception e){}
}
profile is always null, (even after it has been created the first time though)however if I set a breakpoint, wait a couple seconds, then evaluate the profile is found. I am guessing the issue is that RSE is not fully started yet?
Thanks.
|
|
|
Re: Ensuring RSE has initialized/loaded [message #629871 is a reply to message #629804] |
Wed, 29 September 2010 15:30  |
Eclipse User |
|
|
|
There are two APIs for this in RSECorePlugin. The wait for the RSE model to
be fully restored while the second waits for a specific phase to complete
(INIT_ALL, INIT_INITIALIZER or INIT_MODEL).
public static IStatus waitForInitCompletion()
public static IStatus waitForInitCompletion(int phase)
<mlists@bigrideau.com> wrote in message
news:i7vl51$iri$1@news.eclipse.org...
> What is the recommended way to ensure that RSE has fully initialized
> loaded prior to using it? I have some code that checks if a profle exists
> and if not it creates it:
>
> ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
> ISystemProfile profile = registry.getSystemProfile("ZZ");
>
> IHost host = null;
> if (profile == null){
> try{
> profile = registry.createSystemProfile("ZZ", true);
> }catch (Exception e){}
> }
> profile is always null, (even after it has been created the first time
> though)however if I set a breakpoint, wait a couple seconds, then evaluate
> the profile is found. I am guessing the issue is that RSE is not fully
> started yet?
>
> Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.02706 seconds