JanosVM v1.0 API

edu.utah.janosvm.kit.server.memfs
Class MemoryFileSystem

java.lang.Object
  |
  +--edu.utah.janosvm.kit.server.memfs.MemoryFileSystem

public final class MemoryFileSystem
extends java.lang.Object

The core class for the MemoryFileSystem. This class provides a few static variables for public use, otherwise, it is for internal use only.


Field Summary
static java.lang.String CLASS_GROUP_NAME
          The expected name of the class group in the config file.
private static TeamLocal current
           
private  PortAuthority pa
          The team's PortAuthority, used to export new MemoryBlockBackEnds.
private  int state
          The state of the object.
private static int STATE_NEW_BORN
          The MemoryFileSystem object has just been created and hasn't loaded the store from disk.
private static int STATE_READY
          The MemoryFileSystem object is ready to accept new objects.
static java.lang.String SYNC_FILE
          The name of the file we'll back up the store too.
private  java.util.Hashtable table
          Our "custom" name space for the exported objects.
static java.lang.String TEAM_NAME
          The name of the team, needed when others are trying to access files.
 
Constructor Summary
private MemoryFileSystem()
          Construct an empty MemoryFileSystem object.
 
Method Summary
(package private) static MemoryFileSystem current()
          There is only one MemoryFileSystem object maintained in the data team and this will return it.
(package private)  ExportManager get(java.lang.String name)
          Get a memory block from the file system.
(package private)  void load(java.lang.String fileName)
          Load the object with the data from the given file name.
(package private)  ExportManager put(java.lang.String name, MemoryBlockBackEnd newbe)
          Put a memory block in the file system.
(package private)  boolean remove(java.lang.String name)
           
(package private) static void start()
          Startup the MemoryFileSystem Server.
(package private)  void store(java.lang.String fileName)
          Save the file system to disk in the given file name.
 java.lang.String toString()
           
(package private)  void waitForLoad()
          Wait for the object to finish loading the store from disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

current

private static final TeamLocal current

CLASS_GROUP_NAME

public static final java.lang.String CLASS_GROUP_NAME
The expected name of the class group in the config file.

TEAM_NAME

public static final java.lang.String TEAM_NAME
The name of the team, needed when others are trying to access files.

SYNC_FILE

public static final java.lang.String SYNC_FILE
The name of the file we'll back up the store too.

STATE_NEW_BORN

private static final int STATE_NEW_BORN
The MemoryFileSystem object has just been created and hasn't loaded the store from disk.

STATE_READY

private static final int STATE_READY
The MemoryFileSystem object is ready to accept new objects.

pa

private final PortAuthority pa
The team's PortAuthority, used to export new MemoryBlockBackEnds.

table

private final java.util.Hashtable table
Our "custom" name space for the exported objects.

state

private int state
The state of the object.
Constructor Detail

MemoryFileSystem

private MemoryFileSystem()
Construct an empty MemoryFileSystem object.
Method Detail

current

static MemoryFileSystem current()
There is only one MemoryFileSystem object maintained in the data team and this will return it.
Returns:
The MemoryFileSystem object.

start

static void start()
Startup the MemoryFileSystem Server.

waitForLoad

void waitForLoad()
           throws java.lang.InterruptedException,
                  java.lang.IllegalMonitorStateException
Wait for the object to finish loading the store from disk.

load

void load(java.lang.String fileName)
Load the object with the data from the given file name.
Parameters:
fileName - The name of the file containing the flattened version of the MemoryFileSystem.

store

void store(java.lang.String fileName)
     throws java.io.IOException
Save the file system to disk in the given file name.
Parameters:
fileName - The file name to save the data to.

put

ExportManager put(java.lang.String name,
                  MemoryBlockBackEnd newbe)
Put a memory block in the file system.
Parameters:
name - The name that maps to the given export.
newbe - The MemoryBlockBackEnd to put in the file system.
Returns:
The ExportManager for the newly exported MemoryBlockBackEnd or the existing back end.

get

ExportManager get(java.lang.String name)
Get a memory block from the file system.
Parameters:
name - The name that maps to the given block.
Returns:
The ExportManager for the block or null if it couldn't be found.

remove

boolean remove(java.lang.String name)
Parameters:
name - The name of the block to remove from the file system.
Returns:
True if the name was found and removed.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003