Interface IAppSessionGyro
- All Superinterfaces:
- ILocaleString,- IMessageBox,- IPrivateStorage,- IRuntimeImageCache,- IToaster
- All Known Implementing Classes:
- AppSessionGyro
- Author:
- Christopher Mindus
- Nested Class Summary- Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox- IMessageBox.Icon- Nested classes/interfaces inherited from interface com.iizix.gyro.IToaster- IToaster.Direction, IToaster.Position, IToaster.Type
- Field SummaryFields- Fields inherited from interface com.iizix.gyro.IMessageBox- ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING- Fields inherited from interface com.iizix.gyro.IToaster- TOASTER_DEFAULT_DURATION, TOASTER_MAX_DURATION, TOASTER_MIN_DURATION
- Method SummaryModifier and TypeMethodDescription- booleanAdds a client connection listener for the application session.- boolean- addDisposeListener- (IAppSessionDisposeListener listener) Adds a dispose listener for the application session.- intDecreases the incremental lock state.- boolean- dispose()Disposes of the Application session gyro, and effectively closes all the client sessions and end point connections.Returns the application session history used for backward and forward navigation.- getAppID()Gets the application ID.Retrieves the KStringInfoProvider for the application session.Gets the application timer engine.Gets the application session info.Gets the AppSessionGyro's Virtual Thread Group.Gets the Worker for the Application.Gets the authenticated user information.Gets the user ID for background location service identification.Gets the active client session Gyro's for this application session Gyro.- intGets the count of client sessions.- longGets the creation time in milliseconds.Returns the current focus in the VirtualSpace.- getCustomAppValue- (String key) Gets a value for a key in the custom app properties.Gets the original environment properties for Selector's or Value's.- getFocusEngine- (IFocusComp comp) Returns the focus engine instance for the specified component.Retrieves the KStringInfoProvider for the application session.Gets the language code of the application session.Returns an instance of the geolocation service.- intReturns the incremental lock count that governs the UI locking state.Gets the locale'd texts instance for the sessions language and text tables.- getRootFromName- (GProp<?> requestor, String module) Gets the module root for a name.- GProp- <?> - getRuntimePropFromReference- (String reference) Gets a reference for runtime use to get the reference of an item.- GProp- <?> - getRuntimePropFromReference- (String reference, boolean fallBackToNonVirtualized) Gets a reference for runtime use to get the reference of an item.- static IAppSessionGyroGets the runtime application instance for the current thread in a client session.- static IAppSessionGyro- getSessionInstance- (SessionInfo sessionInfo) Gets the runtime application instance for the current thread in a client session.Gets the SessionUserIdentifier.Gets the transaction coordinator of the session.Gets the user authentication UI interface used for the initial login.- getVirtualizedVirtualSpace- (VirtualSpace virtualSpace, boolean doVirtualize) Gets the virtualized counterpart of a VirtualSpace.- getVirtualizedVSComponent- (IVSComponent component) Gets the virtualized VSComponent counterpart from a non-virtualized VSComponent.- <VSC extends VSComponent>
 VSC- getVirtualizedVSComponent- (VSC component) Gets the virtualized VSComponent counterpart from a non-virtualized VSComponent.- intIncreases the incremental lock state.- booleanChecks if the application session Gyro is disposed of.- booleanGet the current UI lock state.- boolean- isVirtualized- (VirtualSpace virtualSpace) Returns if a VirtualSpace already is virtualized for the application.- booleanLocks the UI with a message and a delay.- boolean- lockUI- (KString waitMsg, ProgressIndicatorDelay delay) Locks the UI with a message and a delay.- default voidHelper method to post a runnable for execution.- booleanRemoves a client connection listener for the application session.- booleanRemoves a dispose listener for the application session.Requests a UI lock state.- setLocale- (LocaleInfo locale) Changes or sets the LocaleInfo for the environment.- boolean- setLockMessage- (KString msg) Sets the message to display for the lock state, above the indicator.- boolean- setLockMessage- (KString msg, int progress) Sets the message to display for the lock state, above the indicator, along with a progress value.- boolean- setLockMessage- (KString msg, int delay, int progress) Sets the message to display for the lock state, above the indicator, along with a progress value.- boolean- setLockProgress- (int progress) Sets the current progress bar value.Sets the focus to the specified VS component, regardless if the VS component is virtualized or not.- setVirtualizeSupportFocus- (IVSComponent vsComp, IGProp<?> trigger) Sets the focus to the specified VS component, regardless if the VS component is virtualized or not.- boolean- unlockUI()Unlocks the UI.- Methods inherited from interface com.iizix.text.ILocaleString- getLocale, getLocaleKString, getLocaleKString- Methods inherited from interface com.iizix.gyro.IMessageBox- messageBox, messageBox, messageBox, messageBox- Methods inherited from interface com.iizix.api.IPrivateStorage- getPrivateData, getPrivateData, getPrivateStorageMap, setPrivateData- Methods inherited from interface com.iizix.gyro.IRuntimeImageCache- clearImageCache, getImage, removeImage, setImage
- Field Details- STORAGE_NAMELocal storage name in SessionInfo.
 
- Method Details- getSessionInstanceGets the runtime application instance for the current thread in a client session.- Returns:
- The RuntimeApp instance when called from a thread of the client session, nullotherwise.
 
- getSessionInstanceGets the runtime application instance for the current thread in a client session.- Parameters:
- sessionInfo- A session information instance, or null for none.
- Returns:
- The RuntimeApp instance when called from a thread of the client session, nullotherwise.
 
- addDisposeListenerAdds a dispose listener for the application session. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeDisposeListenerRemoves a dispose listener for the application session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- addClientConnectionListenerAdds a client connection listener for the application session. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeClientConnectionListenerRemoves a client connection listener for the application session.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- disposeboolean dispose()Disposes of the Application session gyro, and effectively closes all the client sessions and end point connections.- Returns:
- true for dispose success, false if already disposed of.
 
- isDisposedboolean isDisposed()Checks if the application session Gyro is disposed of.- Returns:
- true if the user's app-session is disposed of along with all client sessions, false otherwise.
 
- getTransactionCoordinatorITXPCoordinator getTransactionCoordinator()Gets the transaction coordinator of the session.- Returns:
- The TXP coordinator, or null for none.
 
- getAppWorkerWorker getAppWorker()Gets the Worker for the Application.- Returns:
- The Application Worker.
 
- postHelper method to post a runnable for execution. The runnable is executed in the application session's worker thread and is typically used to ensure that execution takes place in the correct application session thread when performing inter-session calls.- Parameters:
- runnable- The runnable.
 
- getAppThreadGroupVirtualThreadGroup getAppThreadGroup()Gets the AppSessionGyro's Virtual Thread Group.- Returns:
- The Virtual Thread Group.
 
- getApplicationTimerEngineITimerEngine getApplicationTimerEngine()Gets the application timer engine. All timer tasks as disposed of automatically when the application session exits.- Returns:
- The application session implementation of the timeout engine.
 
- getAppIDString getAppID()Gets the application ID.- Returns:
- The AppID is an upper case string.
 
- getEnvironmentEnvProps getEnvironment()Gets the original environment properties for Selector's or Value's.- This is NOT the same instance as the one available from the - IClientSessionGyro.getEnvironment().- Returns:
- The original environment properties for selectors, null if never initialized.
 
- getAppSessionInfoSessionInfo getAppSessionInfo()Gets the application session info.- Returns:
- The original session information that initiated the application session.
 
- getCreationTimelong getCreationTime()Gets the creation time in milliseconds.- Returns:
- Milliseconds since the epoch.
 
- getSessionUserIdentifierSessionUserIdentifier getSessionUserIdentifier()Gets the SessionUserIdentifier.- Returns:
- The user identifier of the session.
 
- getAuthenticatedUserIAuthenticatedUser getAuthenticatedUser()Gets the authenticated user information.- Returns:
- The authenticated user instance, or nullfor none.
 
- getCustomAppValueGets a value for a key in the custom app properties.- Parameters:
- key- The key or name of the property to retrieve.
- Returns:
- The value, or null if no value is defined for the key, or the custom map is not defined.
 
- getAppKStringInfoProviderIKStringInfoProvider getAppKStringInfoProvider()Retrieves the KStringInfoProvider for the application session.- Note: it is recommended to use the - IClientSessionGyro.getKStringInfoProvider()- Returns:
- The KString information provider instance, or null if not possible.
 
- getKStringInfoProviderIKStringInfoProvider getKStringInfoProvider()Retrieves the KStringInfoProvider for the application session.- Note: it is recommended to use the - IClientSessionGyro.getKStringInfoProvider()- Specified by:
- getKStringInfoProviderin interface- ILocaleString
- Returns:
- The KString information provider instance, or null if not possible. This method returns the same value as getAppKStringInfoProvider().
 
- getLanguageCodeString getLanguageCode()Gets the language code of the application session. This language may very well not be the one requested by the end user device, but rather one of the languages the application supports.- Returns:
- The language code.
 
- setLocaleChanges or sets the LocaleInfo for the environment.- Parameters:
- locale- localeInfo The locale information to use.
- Returns:
- The old LocaleInfo, or null if not set.
 
- getPrettyLocaledTextsPrettyLocaledTexts getPrettyLocaledTexts()Gets the locale'd texts instance for the sessions language and text tables.- Returns:
- The instance used to create locale'd strings for e.g. duration and distances.
 
- getRuntimePropFromReferenceGets a reference for runtime use to get the reference of an item. The reference must be fully qualified such as "*ALIAS:/type/path" or "MODULE:/type/path" and cannot be relative.- Note: The reference can be to the static or virtualized properties, but if a property type is virtualized and the property is not found, a fall-back to search the application for the static non-virtualized property IS NOT PERFORMED. - Calling this method is the same as calling - getRuntimePropFromReference(reference, false)}.- Parameters:
- reference- The reference to look-up.
- Returns:
- The property found, or null for reference not found.
 
- getRuntimePropFromReferenceGets a reference for runtime use to get the reference of an item. The reference must be fully qualified such as "*ALIAS:/type/path" or "MODULE:/type/path" and cannot be relative.- If the flag - fallBackToNonVirtualizedis false, the search will not fallback to searching for the non-virtualized property in the runtime app. The result will only returned virtualized properties, i.e. for a reference as e.g. "module:/vs/someVS", and depending on where this method is called (the client session), also includes other virtualized properties such as panels as e.g. "module:/panel/somePanel".- To always fallback to also searching the runtime app, specify - fallBackToNonVirtualizedto true.- Parameters:
- reference- The reference to look-up.
- fallBackToNonVirtualized- Flag indicating a fallback to non-virtualized properties.
- Returns:
- The property found, or null for reference not found.
 
- getRootFromNameGets the module root for a name. In the Editor, the module is the project, and that root container is returned. In the Server, the module doesn't matter, so the real root returns itself.- When running with assertions, this call throws an assertion error by default, showing that the call is directed to a non-root property container. - Parameters:
- requestor- The requestor property.
- module- The module name (without colon), i.e. the project name in the Designer.
- Returns:
- The root property container, or null if this container is not the root, or if the module name is not found. The default implementation returns null.
 
- getClientSessionsCountint getClientSessionsCount()Gets the count of client sessions.
- getClientSessionGyrosIClientSessionGyro[] getClientSessionGyros()Gets the active client session Gyro's for this application session Gyro.- Returns:
- The array of active client session Gyro's.
 
- requestUILockILockState requestUILock()Requests a UI lock state. The object returned can be used to set a message below the lock spinner. It can also be used to set a progress indicator, also below the spinner. A progress indicator can also be handled using the lock object.- Note: You MUST call the objects - {link @ILockState#release()}method to release the lock state.- Returns:
- The lock state object.
 
- isUILockedboolean isUILocked()Get the current UI lock state.- You may also query the incremental lock state using - getLockCount()- Returns:
- true if busy state is on, false otherwise.
 
- lockUILocks the UI with a message and a delay.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Parameters:
- waitMsg- The wait message, null for none.
- delay- Delay before the message is shown in the Client.
- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
 
- lockUILocks the UI with a message and a delay.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Parameters:
- waitMsg- The wait message, null for none.
- delay- Delay of lock spinner: -2 for default (1.5 second), -1 disabled, 0=no delay, >0 wait time in milliseconds (1-20000, i.e. 20 seconds).
- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
- Throws:
- IllegalArgumentException- If the- delayvalue is not -1 to 20000 (20 seconds).
 
- unlockUIboolean unlockUI()Unlocks the UI.- Consider using the method - requestUILock()- This call will not change the potential wait message or wait message delay if the method is not successful. - Also consider using the method - decrementUILock()- Returns:
- Busy change flag, true if busy state changed, false otherwise. The return value may be false because the lock count is non-zero.
 
- getLockCountint getLockCount()Returns the incremental lock count that governs the UI locking state. Note that the lock state may be in effect even if the lock count is zero.- Returns:
- The lock count, zero or positive value.
 
- incrementUILockint incrementUILock()Increases the incremental lock state. If it was zero, it will UI lock the session. Each call to this method must match a call to- decrementUILock()- Consider using the method - requestUILock()- Returns:
- The lock count, i.e. the number of calls that has been made to this method minus the number of calls to decrementUILock()
 
- decrementUILockint decrementUILock()Decreases the incremental lock state. If it becomes zero, it will UI unlock the session. Each call to this method must match a call to- incrementUILock()- If this method is called and the lock count is zero, nothing will happen, but a warning event with a call stack will be logged. - Returns:
- The lock count, i.e. the number of calls that has been made to incrementUILock()
 
- setLockMessageSets the message to display for the lock state, above the indicator.- Parameters:
- msg- The message to display, or null to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of message.
 
- setLockMessageSets the message to display for the lock state, above the indicator, along with a progress value.- Parameters:
- msg- The message to display, or null to remove it.
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of values.
- Throws:
- IllegalArgumentException- If the progress value is not -1 or 0 to 100.
 
- setLockMessageSets the message to display for the lock state, above the indicator, along with a progress value.- Parameters:
- msg- The message to display, or null to remove it.
- delay- Delay of lock spinner: -2 for default (1.5 second), -1 disabled, 0=no delay, >0 wait time in milliseconds (1-20000, i.e. 20 seconds).
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changed, or false if busy state is not present or no change of values.
- Throws:
- IllegalArgumentException- If progress value is not -1 or 0 to 100, or delay is smaller than -2 or larger than 20000.
 
- setLockProgressboolean setLockProgress- (int progress) Sets the current progress bar value. This method will not do anything if the lock state is not present.- Parameters:
- progress- The progress value between 0 and 100, or -1 to remove it.
- Returns:
- true for changes, false for no change or no lock state.
- Throws:
- IllegalArgumentException- If the progress value is not -1 or 0 to 100.
 
- getFocusEngineReturns the focus engine instance for the specified component.- Parameters:
- comp- The component requesting the focus engine. For the AppSessionGyro, the focus engine returns an instance of the VirtualSpace focus engine if the component instance is a VSComponent (VSTable, VSField, etc) or a VirtualSpace, for now.
- Returns:
- The focus engine instance, or null if not found.
 
- isVirtualizedReturns if a VirtualSpace already is virtualized for the application.- Parameters:
- virtualSpace- The VirtualSpace.
- Returns:
- true if vitualSpacealready is virtualized or a virtualized instance is present, false otherwise.
 
- getVirtualizedVSComponentGets the virtualized VSComponent counterpart from a non-virtualized VSComponent. If the component's VirtualSpace is not virtualized, it will be done. If the component parameter already is virtualized, that instance is returned. This method can also process a VirtualSpace instance as it is implementing the IVSComponent interface.- Parameters:
- component- A VS component.
- Returns:
- A virtualized component for the component parameter, or the component parameter instance if it was virtualized. nullis returned if the VirtualSpace is virtualized and the VSComponent counterpart doesn't exist or the class instance is not the same as the original component, or if thecomponentparameter isnull.
 
- getVirtualizedVirtualSpaceGets the virtualized counterpart of a VirtualSpace. If the VirtualSpace is not virtualized, it will be done. If the VirtualSpace parameter already is a virtualized VirtualSpace, that instance is returned.- This method is typically used by data connectors as action actors that have another target VirtualSpace. Focus can be set to a component in another VirtualSpace once virtualized. - Parameters:
- virtualSpace- The VirtualSpace.
- doVirtualize- Flag to virtualize the virtualSpace if not already virtualized or not.
- Returns:
- A virtualized VirtualSpace for the virtualSpace parameter, or the virtualSpace parameter instance if it was virtualized.
 
- getVirtualizedVSComponentGets the virtualized VSComponent counterpart from a non-virtualized VSComponent. If the component's VirtualSpace is not virtualized, it will be done. If the component parameter already is virtualized, that instance is returned.- Parameters:
- component- A VS component.
- Returns:
- A virtualized component for the component parameter, or the component parameter instance if it was virtualized. nullis returned if the VirtualSpace is virtualized and the VSComponent counterpart doesn't exist or the class instance is not the same as the original component, or if thecomponentparameter isnull.
 
- getCurrentFocusIVSComponent getCurrentFocus()Returns the current focus in the VirtualSpace. If no particular component is in focus, the VirtualSpace that last had focus is returned.- Returns:
- The component in focus, or null if no focus is currently set.
 
- setVirtualizeSupportFocusSets the focus to the specified VS component, regardless if the VS component is virtualized or not. If not virtualized, it will be prior to setting the focus.- Parameters:
- vsComp- The VS component to focus.
- Returns:
- Error message, or null for success.
 
- setVirtualizeSupportFocusSets the focus to the specified VS component, regardless if the VS component is virtualized or not. If not virtualized, it will be prior to setting the focus.- Parameters:
- vsComp- The VS component to focus.
- trigger- The trigger component, null for none.
- Returns:
- Error message, or null for success.
 
- getAppHistoryIAppHistory getAppHistory()Returns the application session history used for backward and forward navigation.- Returns:
- The application session history instance.
 
- getLocationServiceILocationService getLocationService()Returns an instance of the geolocation service.- Returns:
- The instance, always non-null.
 
- getAuthenticatedUserUUIDString getAuthenticatedUserUUID()Gets the user ID for background location service identification.- Returns:
- String made up of the authenticated user's UUID, null if the user is not yet authenticated or undefined.
 
- getUserAuthenticationUIIUserAuthenticationUI getUserAuthenticationUI()Gets the user authentication UI interface used for the initial login.- Returns:
- The user authentication interface.