Class ClientLaunchHook
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.runtime.ClientLaunchHook
-
- All Implemented Interfaces:
LaunchHook
public class ClientLaunchHook extends java.lang.Object implements LaunchHook
This is the hook that gets called from the client bootstrap launcher. This is the "entrypoint" for the Vision Client. It's ClientContextImpl will last for its entire lifecycle, which will always be a single project but may involve logging in and out, and project updates.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ClientLaunchHook.AutoLoginDelegate
Delegate class to make ClientLaunchHook more cohesive and to separate the auto login logic from the hook *
-
Field Summary
Fields Modifier and Type Field Description protected ClientContextImpl
clientContext
protected LaunchContext
launchContext
protected ProjectInitializationParams
launchParams
-
Constructor Summary
Constructors Constructor Description ClientLaunchHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ClientLaunchHook.AutoLoginDelegate
createLoginDelegate(LaunchContext launchContext, Project project)
protected void
initI18N()
protected RuntimeProject
loadVerifiedCacheProject(java.io.File cacheFile, java.io.File chkFile, LaunchStep step, LaunchContext context)
void
setup(LaunchStep startupStep, LaunchContext context)
Called during the final "step" of the bootstrap launch process.void
startup()
Called after setup() to start the application.void
staticSetup()
This setup will be called first, before setup(), but only the first time in a given JVM.
-
-
-
Field Detail
-
launchContext
protected LaunchContext launchContext
-
launchParams
protected ProjectInitializationParams launchParams
-
clientContext
protected ClientContextImpl clientContext
-
-
Method Detail
-
staticSetup
public void staticSetup()
Description copied from interface:LaunchHook
This setup will be called first, before setup(), but only the first time in a given JVM.- Specified by:
staticSetup
in interfaceLaunchHook
-
setup
public void setup(LaunchStep startupStep, LaunchContext context) throws java.lang.Exception
Called during the final "step" of the bootstrap launch process.
- Parses the project that the bootstrap loaded downloaded or read in from the cache, and turns it into a bona-fide Project object.
- Creates the ClientContextImpl which will last the entire lifetime of this Client instance. (but not the bootstrap loader/reloader instance.
- Initializes the GatewayConnectionManager with a ClientGatewayConnection instance and the Gateway URLS found in launchContext.getGatewayAddresses()
- Verifies that connection is valid.
- Loads any Client-scope modules (but does not start them up yet.)
- Attempts to authenticate if:
- This launch was from a retarget. OR
- The project if set to auto-login.
- Specified by:
setup
in interfaceLaunchHook
- Parameters:
startupStep
- The step being displayed. Use this step to affect the message, progress, indeterminate indication, etc of the loading splash screen.context
- The launch context contains information gathered during the loading phase that should be relevant to the starting application.- Throws:
java.lang.Exception
-
createLoginDelegate
protected ClientLaunchHook.AutoLoginDelegate createLoginDelegate(LaunchContext launchContext, Project project)
-
startup
public void startup() throws java.lang.Exception
Description copied from interface:LaunchHook
Called after setup() to start the application.- Specified by:
startup
in interfaceLaunchHook
- Throws:
java.lang.Exception
-
initI18N
protected void initI18N()
-
loadVerifiedCacheProject
protected RuntimeProject loadVerifiedCacheProject(java.io.File cacheFile, java.io.File chkFile, LaunchStep step, LaunchContext context) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-