use of org.eclipse.scout.rt.platform.internal.PlatformStarter in project scout.rt by eclipse.
the class PlatformAwaitStartedTest method testAwaitPlatformStarted.
@Test
public void testAwaitPlatformStarted() {
final FixturePlatformWithStartListener platform = new FixturePlatformWithStartListener();
new PlatformStarter(platform).start();
try {
platform.m_asyncFinished.await(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
throw new PlatformException("interrupted waiting for asyncFinished", e);
}
Assert.assertArrayEquals(new Object[] { "asyncStart", "listenerFinished", "asyncFinished" }, platform.m_events.toArray());
}
use of org.eclipse.scout.rt.platform.internal.PlatformStarter in project scout.rt by eclipse.
the class Platform method initialize.
private static synchronized void initialize() {
if (platform != null) {
return;
}
IPlatform tmpPlatform = null;
ServiceLoader<IPlatform> loader = ServiceLoader.load(IPlatform.class);
for (IPlatform p : loader) {
tmpPlatform = p;
break;
}
if (tmpPlatform == null) {
tmpPlatform = new DefaultPlatform();
}
// Start platform initialization in separate thread to let class initialization complete
new PlatformStarter(tmpPlatform).start();
tmpPlatform.awaitPlatformStarting();
platform = tmpPlatform;
}
Aggregations