|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.utah.janosvm.sys.ListNode | +--edu.utah.janosvm.sys.Importable | +--edu.utah.janosvm.kit.server.memfs.MemoryBlock
A fault tolerant handle for a MemoryBlockBackEnd.
Field Summary | |
private MemoryBlockBackEnd |
be
The exportable. |
private static long |
CONNECT_DELAY
The number of milliseconds to wait before retrying to connect to the server. |
private static int |
CONNECT_RETRIES
The number of times to try connecting to the server. |
private java.lang.String |
fileName
The name of the block to import. |
private static java.lang.Class |
THIS_CLASS
Pointer to this class, used for set/getClassLocal. |
Fields inherited from class edu.utah.janosvm.sys.Importable |
em |
Fields inherited from class edu.utah.janosvm.sys.ListNode |
pred, succ |
Constructor Summary | |
(package private) |
MemoryBlock(java.lang.String fileName)
Construct a MemoryBlock handle that will import the MemoryBlockBackEnd with the given name. |
Method Summary | |
protected void |
bindTo(Exportable ex)
Bind this Importable to the given Exportable. |
(package private) void |
connect(boolean create)
A fault tolerant method for connecting to the server and the exported object. |
(package private) boolean |
delete()
|
(package private) boolean |
isConnected()
|
(package private) int |
read(int cursor,
byte[] buffer,
int offset,
int length)
|
(package private) void |
sync()
Force a write to disk of the whole MemoryFileSystem. |
java.lang.String |
toString()
|
protected void |
unbindFrom()
Unbind this Importable from any objects it is referencing. |
(package private) void |
write(int cursor,
byte[] buffer,
int offset,
int length)
|
Methods inherited from class edu.utah.janosvm.sys.Importable |
copy, finalize, getExportManager, revoke, setExportManager |
Methods inherited from class edu.utah.janosvm.sys.ListNode |
append, clone, inList, prepend, remove |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
Field Detail |
private static final java.lang.Class THIS_CLASS
private static final long CONNECT_DELAY
private static final int CONNECT_RETRIES
private final java.lang.String fileName
private MemoryBlockBackEnd be
Constructor Detail |
MemoryBlock(java.lang.String fileName)
fileName
- The name of the MemoryBlockBackEnd to import.Method Detail |
protected void bindTo(Exportable ex)
Importable
This method will be invoked as a side-effect of binding this
importable to an Exportable object via TeamHandle.importObject(edu.utah.janosvm.sys.Importable, java.lang.Object)
.
XXX Add note about synchronized.
bindTo
in class Importable
edu.utah.janosvm.sys.Importable
ex
- The Exportable that is being imported.protected void unbindFrom()
Importable
This method will be invoked as a side-effect of canceling this import
, or when the
Team owning the Exportable is terminated
, or when the Exportable is revoked
.
XXX rename to just 'unbind'.
unbindFrom
in class Importable
edu.utah.janosvm.sys.Importable
TeamHandle.cancelImport(edu.utah.janosvm.sys.Importable)
,
Team.revokeObject(java.lang.Object)
,
TeamHandle.terminate()
boolean isConnected()
void connect(boolean create) throws java.io.FileNotFoundException
create
- Create the object if it doesn't already exist.Throws
- FileNotFoundException if the file couldn't be found
and create is false or if the method was unable to connect to the
server.int read(int cursor, byte[] buffer, int offset, int length) throws DeadTeamException
cursor
- The offset to read from the file.buffer
- The buffer to read the data into.offset
- The offset into buffer to start reading.length
- The number of bytes to read into buffer.Throws
- a DeadTeamException if the import has been revoked.void write(int cursor, byte[] buffer, int offset, int length) throws DeadTeamException, TeamEjectionException
cursor
- The offset to start writing into the file.buffer
- The buffer to read the data to write.offset
- The offset into buffer to start reading.length
- The number of bytes to write into buffer.Throws
- a DeadTeamException if the import has been revoked or
the server team is unreachable.Throws
- a TeamEjectionException if the thread was ejected
during processing.boolean delete() throws DeadTeamException, TeamEjectionException
void sync() throws DeadTeamException, TeamEjectionException, java.io.IOException
public java.lang.String toString()
toString
in class Importable
|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |