gnu.expr
Class ModuleContext

java.lang.Object
  extended by gnu.expr.ModuleContext

public class ModuleContext
extends java.lang.Object

Maps modules to module instances. Given a class, species a specific instance object for that class.


Constructor Summary
ModuleContext(ModuleManager manager)
           
 
Method Summary
 java.lang.Object checkInstance(ModuleInfo info)
           
 ModuleInfo findFromInstance(java.lang.Object instance)
           
 java.lang.Object findInstance(ModuleInfo info)
          If there is no instance of the argument's class, allocated one.
static ModuleContext getContext()
          For now returns the shared global ModuleContext.
 ModuleManager getManager()
           
 java.lang.Object makeInstance(ModuleInfo info)
          Allocate a new instance of the class corresponding to the argument.
 void setInstance(ModuleInfo info, java.lang.Object instance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleContext

public ModuleContext(ModuleManager manager)
Method Detail

getContext

public static ModuleContext getContext()
For now returns the shared global ModuleContext. Later provide a means for thread-specific overriding.


getManager

public ModuleManager getManager()

checkInstance

public java.lang.Object checkInstance(ModuleInfo info)

makeInstance

public java.lang.Object makeInstance(ModuleInfo info)
Allocate a new instance of the class corresponding to the argument.


findInstance

public java.lang.Object findInstance(ModuleInfo info)
If there is no instance of the argument's class, allocated one.


setInstance

public void setInstance(ModuleInfo info,
                        java.lang.Object instance)

findFromInstance

public ModuleInfo findFromInstance(java.lang.Object instance)