Class TypeLoader

All Implemented Interfaces:
Loader, Uncaller

class TypeLoader
extends BaseLoader

The Loader bound to type__uriGetter in the safe scope.

Given a fully-qualified-name, returns a safe type (a DeepFrozen slot-guard and value-guard, and possibly an auditor) corresponding to that name. This is currently only meaningful for Java fully qualified class names, so it currently throws an exception on anything else. An E-to-JVM compiler will cause this to apply somehow to E code, so if this is extended to deal with interpretive E code as well, it should be extended to have the same semantics that it would apply to compiled E code.

As explained in the superclass comment, this must be thread-safe.

Mark S. Miller, E. Dean Tribble

Field Summary
private  ClassLoader myOptLoader
          We assume that ClassLoaders are thread-safe
static TypeLoader THE_ONE
Constructor Summary
private TypeLoader()
          optLoader defaults to null.
private TypeLoader(ClassLoader optLoader)
Method Summary
 Object get(String fqName)
          exception if not found
private  Slot getLocalSlot(String fqName)
private  Object getWrapped(String fqName)
          exception if not found
 Object[] optUncall(Object obj)
          XXX For now, this only need work for Classes and ClassDescs.
 String toString()
          Suppressed: Returns a string representation of the object.
Methods inherited from class org.erights.e.elib.serial.BaseLoader
getOptWrappingUncall, optUnget, ungetToUncall
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


public static final TypeLoader THE_ONE


private final ClassLoader myOptLoader
We assume that ClassLoaders are thread-safe

Constructor Detail


private TypeLoader(ClassLoader optLoader)


private TypeLoader()
optLoader defaults to null.

Method Detail


private Object getWrapped(String fqName)
exception if not found


private Slot getLocalSlot(String fqName)


public Object get(String fqName)
exception if not found


public Object[] optUncall(Object obj)
XXX For now, this only need work for Classes and ClassDescs.

:nullOk([any, String, any[]]); either null or a 3-element list of
  • a receiver object whose reconstruction would receive the message
  • a String, which is the name of the message to call
  • a list of arguments, whose reconstruction are the actual arguments to the call.


public String toString()
Description copied from class: Object
Suppressed: Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())

toString in class Object
a string representation of the object.