|
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.resources.NameSpaceResource
Provides access methods to the current team's root name space.
A standard JVM provides a root name space to contain system classes and some/all user classes for the program, similarly, the JanosVM provides a root name space for each team in the system. However, a team doesn't exist in isolation so it must be able to cooperate with, at least the kernel team, or other server teams. Therefore, we must provide a mechanism for sharing classes between teams so that they can function and still obey the type rules of java. We might be able to accomplish this by using class loader magic but this could quickly become confusing and could force odd restrictions on what classes teams could share with each other. The current solution is to create an abstraction at a lower level then a class loader, the class group, which acts as a container for a loosely related set of classes. In addition, each class group can have a number of view groups which can map the real names of the classes to something more appropriate for the team using the classes. We hope the combination of class groups and view groups will provide a sufficiently flexible and secure way of sharing classes between teams without resorting to more confusing and possibly restrictive class loader magic.
java.lang.*
since this is what Kaffe used
internally and all the development tools use. If a real java runtime was
written for JanosVM then it would probably want its own version of the
java.lang classes instead of the JanosVM specific ones. A possible solution
is to provide a view group for the kernel classes that mapped the class
names to something more unique, but still retaining their identity as the
real JanosVM version of the classes. However, mapping names is complicated
by the fact that classes don't live an isolated existence, since their
fields and methods reference related classes, hence the need to group them
together. The actual mapping is specified as the real class name followed
by the mapped name in a viewgroup section of the config file and is
then stored internally as a ViewGroupType within the
ClassGroupType. By default, every class group has an "identity" view
group which, as you might expect, makes the classes available under their
builtin names. For example, the following config file section describes the
class group "myServer" and its "emulateBlah" view group which maps the
"myServer" class names so as to emulate similar set of classes.
%begin namespace-resource %begin classgroup myServer Foo FooHandle %begin viewgroup emulateBlah Foo Blah FooHandle BlahHandle %end %end %end
exportClassGroup(String)
,
NameSpaceSpec
,
NameSpaceGroup
Constructor Summary | |
private |
NameSpaceResource()
Its a static only class. |
Method Summary | |
static void |
exportClassGroup(java.lang.String type)
Export a ClassGroup from the current team by loading the classes, collecting them under the internal class group object, and making them available for other teams to use. |
static void |
importClassGroup(NameSpaceGroup nsg)
Import a ClassGroup into the current team. |
static java.lang.Class |
loadTeamClass(java.lang.String className)
Load a class into the root ClassLoader of the current team. |
static java.lang.Class |
loadTeamClass(java.lang.String className,
boolean initialize)
Load a class into the root ClassLoader of the current team. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait, wait0 |
Constructor Detail |
private NameSpaceResource()
Method Detail |
public static void exportClassGroup(java.lang.String type) throws java.lang.ClassNotFoundException, ClassGroupNotFoundException, InvalidClassGroupException
ClassGroups are defined in the JanosVM configuration file. A ClassGroup must be an internally consistent set of classes that can be safely shared between Teams. That is, all classes referenced by any class in a ClassGroup must be satisfied by that ClassGroup or by a class in another ClassGroup which is also exported to this team.
type
- The name of a classgroup section in the config file.public static void importClassGroup(NameSpaceGroup nsg) throws ClassGroupNotFoundException, ViewGroupNotFoundException, DeadTeamException
nsg
- The group specification, containing the name, team, and view
to be used.Throws
- ClassGroupNotFoundException if the class group
specified in nsg could not be found.Throws
- ViewGroupNotFoundException if the view group for the
class group specified in nsg could not be found.Throws
- DeadTeamException if there was a problem visiting the
source team.public static java.lang.Class loadTeamClass(java.lang.String className) throws java.lang.ClassNotFoundException
className
- The name of the class to load.Throws
- ClassNotFoundException if the class couldn't be found.public static java.lang.Class loadTeamClass(java.lang.String className, boolean initialize) throws java.lang.ClassNotFoundException
className
- The name of the class to load.initialize
- Initialize the class.Throws
- ClassNotFoundException if the class couldn't be found.
|
JanosVM v1.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |