|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.serial.BaseLoader | +--org.erights.e.elang.interp.ImportLoader
The Loader bound to import__uriGetter.
As explained in the superclass comment, this must be thread-safe.
Field Summary | |
private FlexMap |
myAlreadyImported
The values in the slots are either EStaticWrappers on Class objects (for safe classes), PackageScopes (for packages), or whatever value a .emaker file evaluated to, when interpreted in the safeScope. |
private ClassLoader |
myOptLoader
We assume that ClassLoaders are thread-safe |
private OuterScope |
mySafeScope
The only thing we do with this is diverge from it, so diverge must be thread-safe, and it must be thread-safe to mutate each diverged scope in a separate thread. |
Constructor Summary | |
(package private) |
ImportLoader(OuterScope safeScope)
optLoader defaults to null. |
private |
ImportLoader(OuterScope safeScope,
ClassLoader optLoader)
|
Method Summary | |
Object |
get(String name)
Enabled: How modules (and other things) get imported. |
Slot |
getLocalSlot(String fqName)
Must handle cyclic imports |
private StaticMaker |
getOptStaticMaker(String fqName)
null if not found. |
private Object |
getValue(String fqName,
boolean[] isConfinedPtr)
Gets the value at fqName, and indicate whether it is itself DeepFrozen. |
private Twine |
optESource(String fqName)
returns null if not found |
private URL |
optResource(String rName)
returns null if not found |
Object[] |
optUncall(Object obj)
XXX For now, this only need work for StaticMakers. |
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 |
private final OuterScope mySafeScope
private final ClassLoader myOptLoader
private final FlexMap myAlreadyImported
Must synchronize access to this
Constructor Detail |
private ImportLoader(OuterScope safeScope, ClassLoader optLoader)
ImportLoader(OuterScope safeScope)
Method Detail |
private URL optResource(String rName)
private Twine optESource(String fqName)
private StaticMaker getOptStaticMaker(String fqName)
private Object getValue(String fqName, boolean[] isConfinedPtr)
If not found, throws an exception. Sets isConfinedPtr[0] according to whether the result is itself DeepFrozen (transitively immutable & non-authority granting, or safe to treat as such).
TODO each load starts with a clean safe scope in which additional outers are not visible outside the loaded module.
public Object get(String name)
Loader
If this loader is called 'foo__uriGetter', then '
public Slot getLocalSlot(String fqName)
public Object[] optUncall(Object obj)
public String toString()
Object
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
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |