public class IltSystemInitializer extends Object
IltSystem.Init()
. It also forces the
TGO graphic components (Tree, Table, Network and Equipment) instantiation,
which yields faster display whey they are first made visible.
This is particularly useful on applications performing time consuming tasks during startup and/or initialization (network connections, user authentication, etc).
Usage example:
// Start initialization on a worker thread IltSystemInitializer.Init("my/deployment/file.xml"); ...
IltSystem.GetDefaultContext()
or before instantiating TGO
components such as IlpNetwork
and IlpTable
.
IltSystemInitializer.WaitInitialization(); if (null != IlpSystemInitializer.GetError()) { // Error! } _context = IltSystem.GetDefaultContext(); _tree = new IlpTree(_context); ...Please note that it is not recommended to invoke this API from the AWT Event Dispatch Thread (EDT) as it will block it.
You can extend and/or customize the initialization behavior by extending
abstract inner class Initializer
and passing it to the static
method Init(ilog.tgo.util.IltSystemInitializer.Initializer)
. With a
custom Initializer
you can implement custom initialization
routines for your own resources, and also enabling/disabling the time
consuming forced component instantiation.
Modifier and Type | Class and Description |
---|---|
protected static class |
IltSystemInitializer.Initializer
Abstract internal implementation of
Runnable that
initializes all TGO resources in a dedicated thread. |
Constructor and Description |
---|
IltSystemInitializer() |
Modifier and Type | Method and Description |
---|---|
static Throwable |
GetError()
Accesses the captured exception or error data, in case of problems.
|
static void |
Init()
Initializes JViews TGO on a working thread, creating a default context
using a deployment descriptor.
|
static void |
Init(Applet applet)
Deprecated.
since 9.0 : Applet will be deprecated with JDK 9
|
static void |
Init(Applet applet,
String deploymentDescriptorName)
Deprecated.
since 9.0 : Applet will be deprecated with JDK 9
|
static void |
Init(IlpContext defaultContext)
Initializes JViews TGO on a working thread using a given service context.
|
static void |
Init(IltSystemInitializer.Initializer initializer)
Initializes JViews TGO on a working thread using a given customized
initializer object.
|
static void |
Init(String deploymentDescriptorName)
Initializes JViews TGO on a working thread, creating a default context
using a deployment descriptor specified by a file name.
|
static boolean |
IsInitialized()
Returns whether or not the initialization is complete.
|
static void |
WaitInitialization()
This method will block the caller thread until the initialization
is complete.
|
public static void WaitInitialization()
Usage example:
public void initUI() { IltSystemInitializer.WaitInitialization(); if (null != IlpSystemInitializer.GetError()) { // Error! } IlpNetwork myNetwork = new IlpNetwork(); ... }
In case of InterruptedException
, method
will hold a reference to the
exception.GetError()
public static boolean IsInitialized()
true
if the initialization is complete;
false
otherwise.public static Throwable GetError()
Once the error is returned, the static reference is set to
null
.
Throwable
, if any, or
null
.public static void Init()
IltSystem.Init()
public static void Init(String deploymentDescriptorName)
deploymentDescriptorName
- absolute or relative file nameIltSystem.Init(IlpContext)
public static void Init(Applet applet)
IltSystem.Init(Applet)
public static void Init(Applet applet, String deploymentDescriptorName)
IltSystem.Init(Applet, String)
public static void Init(IlpContext defaultContext)
The user should ensure that the context is properly configured for subsequent use.
defaultContext
- The default service context used in the applicationIltSystem.Init(IlpContext)
public static void Init(IltSystemInitializer.Initializer initializer)
initializer
- The Initializer
implementation that
customizes how TGO will be initialized according
to user needs.IltSystemInitializer.Initializer
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.