Interface MemoryWorkspaceManager

    • Method Detail

      • getUUID

        String getUUID()
        Returns globally unique ID
        Returns:
      • getDebugMode

        DebugMode getDebugMode()
        This method returns current debug mode active in this JVM
        Returns:
      • setDebugMode

        void setDebugMode​(DebugMode mode)
        This method allows to enable (and pick one) global debug mode for workspaces Default value: DISABLED
        Parameters:
        mode -
      • setDefaultWorkspaceConfiguration

        void setDefaultWorkspaceConfiguration​(WorkspaceConfiguration configuration)
        This method sets default workspace configuration for this provider instance
        Parameters:
        configuration -
      • createNewWorkspace

        MemoryWorkspace createNewWorkspace​(WorkspaceConfiguration configuration)
        This method builds new Workspace with given configuration
        Parameters:
        configuration -
        Returns:
      • createNewWorkspace

        MemoryWorkspace createNewWorkspace()
        This method builds new Workspace with default configuration
        Returns:
      • getWorkspaceForCurrentThread

        MemoryWorkspace getWorkspaceForCurrentThread()
        This method returns you current default Workspace for current Thread PLEASE NOTE: If Workspace wasn't defined, new Workspace will be created using current default configuration
        Returns:
      • getWorkspaceForCurrentThread

        MemoryWorkspace getWorkspaceForCurrentThread​(String id)
        This method returns you Workspace for a given Id for current Thread PLEASE NOTE: If Workspace wasn't defined, new Workspace will be created using current default configuration
        Returns:
      • getWorkspaceForCurrentThread

        MemoryWorkspace getWorkspaceForCurrentThread​(WorkspaceConfiguration configuration,
                                                     String id)
        This method returns you Workspace for a given Id for current Thread PLEASE NOTE: If Workspace wasn't defined, new Workspace will be created using given configuration
        Returns:
      • setWorkspaceForCurrentThread

        void setWorkspaceForCurrentThread​(MemoryWorkspace workspace)
        This method allows you to set given Workspace as default for current Thread
        Parameters:
        workspace -
      • setWorkspaceForCurrentThread

        void setWorkspaceForCurrentThread​(MemoryWorkspace workspace,
                                          String id)
        This method allows you to set given Workspace for spacific Id for current Thread
        Parameters:
        workspace -
      • destroyWorkspace

        void destroyWorkspace​(MemoryWorkspace workspace)
        This method allows you to destroy given Workspace
        Parameters:
        workspace -
      • destroyAllWorkspacesForCurrentThread

        void destroyAllWorkspacesForCurrentThread()
        This method destroys & deallocates all Workspaces for a calling Thread PLEASE NOTE: This method is NOT safe
      • destroyWorkspace

        void destroyWorkspace()
        This method destroys current Workspace for current Thread
      • getAndActivateWorkspace

        MemoryWorkspace getAndActivateWorkspace()
        This method gets & activates default workspace
        Returns:
      • getAndActivateWorkspace

        MemoryWorkspace getAndActivateWorkspace​(String id)
        This method gets & activates workspace with a given Id
        Returns:
      • checkIfWorkspaceExists

        boolean checkIfWorkspaceExists​(String id)
        This method checks, if Workspace with a given Id was created before this call
        Parameters:
        id -
        Returns:
      • checkIfWorkspaceExistsAndActive

        boolean checkIfWorkspaceExistsAndActive​(String id)
        This method checks, if Workspace with a given Id was created before this call, AND is active at the moment of call
        Parameters:
        id -
        Returns:
      • scopeOutOfWorkspaces

        MemoryWorkspace scopeOutOfWorkspaces()
        This method temporary opens block out of any workspace scope. PLEASE NOTE: Do not forget to close this block.
        Returns:
      • printAllocationStatisticsForCurrentThread

        void printAllocationStatisticsForCurrentThread()
        This method prints out allocation statistics for current thread
      • getAllWorkspacesIdsForCurrentThread

        List<String> getAllWorkspacesIdsForCurrentThread()
        This method returns list of workspace IDs for current thread
        Returns:
      • getAllWorkspacesForCurrentThread

        List<MemoryWorkspace> getAllWorkspacesForCurrentThread()
        This method returns all workspaces for current thread
      • anyWorkspaceActiveForCurrentThread

        boolean anyWorkspaceActiveForCurrentThread()
        Determine if there are any workspaces open for the current thread.
        Returns:
        True if any workspaces are open for this thread, false otherwise