Class RuntimeApp
- java.lang.Object
- com.iizix.server.app.RuntimeApp
- All Implemented Interfaces:
IRuntimeReferenceLookup
public class RuntimeApp extends java.lang.Object implements IRuntimeReferenceLookup
The runtime application is a session instance bound application. The runtime application contains the current panel focus, as it is set on per-session basis.This instance contains contains a property container for all virtualized instances
- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STORAGE_NAME
Local storage name in SessionInfo.
Constructor Summary
Constructors Constructor Description RuntimeApp(SessionInfo sessionInfo, AppFactory appFactory, PropMgr propMgr, ClientProps clientRoot, IFocusEngineProvider focusEngineProvider, IVirtualsContainer<VirtualSpace> virtualSpace)
Creates the runtime application a client session.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes of the runtime application instance for a client session.AppFactory
getAppFactory()
Gets the application factory.java.lang.String
getAppID()
Gets the App ID.IVirtualsContainer<UIContextMenu>
getContextMenus()
Gets the context menu available on the client.EnvProps
getEnvironment()
Gets the environment properties to use.IVirtualsContainer<UIPanelBase>
getPanels()
Gets the panels available on the client.PropCnr
getRootFromName(GProp<?> requestor, java.lang.String module)
Gets the module root for a name.GProp<?>
getRuntimePropFromReference(java.lang.String reference, boolean fallBackToNonVirtualized)
Gets a reference for runtime use to get the reference of an item.static RuntimeApp
getSessionInstance()
Gets the runtime application instance for the current thread in a client session.GProp<?>
getVirtualizedPropFromReference(java.lang.String reference)
Attempts to look up a virtualized property from a reference.IVirtualsContainer<VirtualSpace>
getVirtualSpace()
Gets the VirtualSpace current instances.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.iizix.server.app.IRuntimeReferenceLookup
getRuntimePropFromReference
Constructor Detail
RuntimeApp
public RuntimeApp(SessionInfo sessionInfo, AppFactory appFactory, PropMgr propMgr, ClientProps clientRoot, IFocusEngineProvider focusEngineProvider, IVirtualsContainer<VirtualSpace> virtualSpace)
Creates the runtime application a client session.The virtual panels are added into the client root property.
- Parameters:
sessionInfo
- The session info.appFactory
- The application factory.propMgr
- The property manager for panels (the Client property manager).clientRoot
- The client root property.focusEngineProvider
- The (panel) focus engine provider.virtualSpace
- The existing VirtualSpace.
Method Detail
getSessionInstance
public static RuntimeApp getSessionInstance()
Gets 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,
null
otherwise.
dispose
public void dispose()
Disposes of the runtime application instance for a client session.
getAppID
public java.lang.String getAppID()
Gets the App ID.- Returns:
- The App ID string.
getAppFactory
public AppFactory getAppFactory()
Gets the application factory.- Specified by:
getAppFactory
in interfaceIRuntimeReferenceLookup
- Returns:
- The application factory.
getVirtualSpace
public IVirtualsContainer<VirtualSpace> getVirtualSpace()
Gets the VirtualSpace current instances.
getPanels
public IVirtualsContainer<UIPanelBase> getPanels()
Gets the panels available on the client.
getContextMenus
public IVirtualsContainer<UIContextMenu> getContextMenus()
Gets the context menu available on the client.
getVirtualizedPropFromReference
public GProp<?> getVirtualizedPropFromReference(java.lang.String reference)
Attempts to look up a virtualized property from a reference.- Parameters:
reference
- The reference to look-up.- Returns:
- The virtualized instance of the property, null if not found.
getRuntimePropFromReference
public GProp<?> getRuntimePropFromReference(java.lang.String reference, boolean fallBackToNonVirtualized)
Gets 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
fallBackToNonVirtualized
is 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
fallBackToNonVirtualized
to true.- Specified by:
getRuntimePropFromReference
in interfaceIRuntimeReferenceLookup
- 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.
getRootFromName
public PropCnr getRootFromName(GProp<?> requestor, java.lang.String module)
Gets 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.
- Specified by:
getRootFromName
in interfaceIRuntimeReferenceLookup
- 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.
getEnvironment
public EnvProps getEnvironment()
Gets the environment properties to use.- Specified by:
getEnvironment
in interfaceIRuntimeReferenceLookup
- Returns:
- The environment for the client session.