mitoolkit.core
Class ClassSpace
java.lang.Object
mitoolkit.core.ClassSpace
- All Implemented Interfaces:
- java.io.Serializable
- public class ClassSpace
- extends java.lang.Object
- implements java.io.Serializable
Class ClassSpace: HProvides a container that holds a list of class objects
for classes in the classspace of a classloader. Also holds the corresponding
bytecode for the classes.
On the transfer of a class the bytecode is helsd in the private classpace
ready to be loaded by the classloader it is associated with. However if no
name clashes are detected in the shared class space the class is moved to the
shared classpace
The private classpace ensures that in the presence of name clashes the
migrated object uses only the corect classes transfered from its source. The
shared class space is available to all object residing on a server, both
mobile and stationary.
No metods are provided to allow the programmer to manually manipulate
classpaces, Instead this is done automatically by the mobile classloader
responsible for loading the migrated class. Classes are automatically
published in the shared classpace of a server upon migration to promote
shared access
- See Also:
- Serialized Form
Field Summary |
(package private) java.util.Hashtable |
byteCode
|
(package private) java.util.Hashtable |
space
|
Method Summary |
boolean |
containsByteCode(java.lang.String className)
|
boolean |
containsClass(java.lang.String className)
|
byte[] |
getByteCode(java.lang.String className)
returns the bytecode corresponding to the class name if it's not a class
that has been migrated i.e. |
private static byte[] |
getByteCodeFromFile(java.lang.String className)
Gets the bytecode from the classpath* i.e. |
java.lang.Class |
getClass(java.lang.String className)
|
void |
putByteCode(java.lang.String className,
byte[] bc)
|
void |
putClass(java.lang.String className,
java.lang.Class classObj)
|
void |
removeClass(java.lang.String className)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
byteCode
java.util.Hashtable byteCode
space
java.util.Hashtable space
ClassSpace
public ClassSpace()
containsClass
public boolean containsClass(java.lang.String className)
containsByteCode
public boolean containsByteCode(java.lang.String className)
getClass
public java.lang.Class getClass(java.lang.String className)
putClass
public void putClass(java.lang.String className,
java.lang.Class classObj)
putByteCode
public void putByteCode(java.lang.String className,
byte[] bc)
removeClass
public void removeClass(java.lang.String className)
getByteCode
public byte[] getByteCode(java.lang.String className)
throws java.io.IOException
- returns the bytecode corresponding to the class name if it's not a class
that has been migrated i.e. an aplication class then get the class from
the filestore
- Throws:
java.io.IOException
getByteCodeFromFile
private static byte[] getByteCodeFromFile(java.lang.String className)
throws java.io.IOException
- Gets the bytecode from the classpath* i.e. those in the classpath
- Throws:
java.io.IOException