public class Workbench extends Object
To delay startup, add a Startup Blocker before Errai starts calling AfterInitialization methods. The
best place to do this is in the PostConstruct method of an EntryPoint bean. You would then remove the
startup blocker from within the callback from the server:
@EntryPointpublic class MyMutableGlobal() {@Inject private Workbench workbench;@Inject private Caller<MyRemoteService> remoteService;// set up by a server call. don't start the app until it's populated!private MyParams params;@PostConstructprivate void earlyInit() { workbench.addStartupBlocker(MyMutableGlobal.class); }@AfterInitializationprivate void lateInit() { remoteService.call(newRemoteCallback<MyParams>{ public void callback(MyParams params) { MyMutableGlobal.this.params = params; workbench.removeStartupBlocker(MyMutableGlobal.class); } }).fetchParameters(); } }
| Constructor and Description |
|---|
Workbench() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStartupBlocker(Class<?> responsibleParty)
Requests that the workbench does not attempt to create any UI parts until the given responsible party has
been removed as a startup blocker.
|
void |
removeStartupBlocker(Class<?> responsibleParty)
Causes the given responsible party to no longer block workbench initialization.
|
public void addStartupBlocker(Class<?> responsibleParty)
responsibleParty - any Class object; typically it will be the class making the call to this method.
Must not be null.public void removeStartupBlocker(Class<?> responsibleParty)
After removing the blocker, if there are no more blockers left in the blocking set, the workbench UI is bootstrapped immediately. If there are still one or more blockers left in the blocking set, the workbench UI remains uninitialized.
responsibleParty - any Class object that was previously passed to addStartupBlocker(Class).
Must not be null.Copyright © 2012–2016 JBoss by Red Hat. All rights reserved.