gnu.expr

Class ModuleContext

public class ModuleContext extends Object

Maps modules to module instances. Given a class, species a specific instance object for that class.
Constructor Summary
ModuleContext(ModuleManager manager)
Method Summary
ObjectcheckInstance(ModuleInfo info)
ModuleInfofindFromInstance(Object instance)
ObjectfindInstance(ModuleInfo info)
If there is no instance of the argument's class, allocated one.
static ModuleContextgetContext()
For now returns the shared global ModuleContext.
ModuleManagergetManager()
ObjectmakeInstance(ModuleInfo info)
Allocate a new instance of the class corresponding to the argument.
voidsetInstance(ModuleInfo info, Object instance)

Constructor Detail

ModuleContext

public ModuleContext(ModuleManager manager)

Method Detail

checkInstance

public Object checkInstance(ModuleInfo info)

findFromInstance

public ModuleInfo findFromInstance(Object instance)

findInstance

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

getContext

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

getManager

public ModuleManager getManager()

makeInstance

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

setInstance

public void setInstance(ModuleInfo info, Object instance)