org.grinvin.workspace

Class Workspace


public class Workspace
extends java.lang.Object

Handles session persistence. The singleton object of this type allows sessions to be persisted to a workspace directory on disk.

Field Summary

List
subsystems

Method Summary

void
addWorkspaceListener(WorkspaceListener listener)
void
dispose()
void
fireLocationChanged()
static Workspace
getInstance()
Get the singleton instance of this class
File
getLocation()
void
newWorkspace(File location)
Initialize all subsystems and perform an initial save into the given workspace directory.
void
registerSubsystem(Subsystem subsystem)
Register (the wrapper) of a subsystem.
void
removeWorkspaceListener(WorkspaceListener listener)
void
setLocation(File location)

Field Details

subsystems

public List subsystems

Method Details

addWorkspaceListener

public void addWorkspaceListener(WorkspaceListener listener)

dispose

public void dispose()

fireLocationChanged

public void fireLocationChanged()

getInstance

public static Workspace getInstance()
Get the singleton instance of this class
Returns:
the single instance of this class

getLocation

public File getLocation()

newWorkspace

public void newWorkspace(File location)
            throws WorkspaceException
Initialize all subsystems and perform an initial save into the given workspace directory. If there is an active workspace already, it is disposed of first. If the new directory already exists, all its contents are removed.

registerSubsystem

public void registerSubsystem(Subsystem subsystem)
Register (the wrapper) of a subsystem. The subsystem that is registered first is also loaded and initialized first, but disposed and saved last. If a subsystem A depends on a subsystem B, then B should be registered before A.

removeWorkspaceListener

public void removeWorkspaceListener(WorkspaceListener listener)

setLocation

public void setLocation(File location)