|
JanosVM v0.5.1 Java 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 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 %end %begin viewgroup emulateBlah Foo Blah FooHandle BlahHandle %end %end
exportClassGroup(String)
,
NameSpaceSpec
,
NameSpaceGroup
Constructor Summary | |
NameSpaceResource()
|
Method Summary | |
static void |
exportClassGroup(java.lang.String type)
Export the named ClassGroup from the current team. |
static java.lang.Class |
loadTeamClass(java.lang.String className)
|
static java.lang.Class |
loadTeamClass(java.lang.String className,
boolean initialize)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public 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.
XXX define "exports"?
type
- The name of a classgroup section in the config file.public static java.lang.Class loadTeamClass(java.lang.String className) throws java.lang.ClassNotFoundException
public static java.lang.Class loadTeamClass(java.lang.String className, boolean initialize) throws java.lang.ClassNotFoundException
|
JanosVM v0.5.1 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |