Class RuntimeApp

java.lang.Object
com.iizix.server.app.RuntimeApp
All Implemented Interfaces:
IRuntimeReferenceLookup

public class RuntimeApp extends 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 Details

    • STORAGE_NAME

      public static final String STORAGE_NAME
      Local storage name in SessionInfo.
  • Constructor Details

    • 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 Details

    • 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 String getAppID()
      Gets the App ID.
      Returns:
      The App ID string.
    • getAppFactory

      public AppFactory getAppFactory()
      Gets the application factory.
      Specified by:
      getAppFactory in interface IRuntimeReferenceLookup
      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(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(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 interface IRuntimeReferenceLookup
      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, 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 interface IRuntimeReferenceLookup
      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 interface IRuntimeReferenceLookup
      Returns:
      The environment for the client session.