gnu.expr

Class 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

Object
checkInstance(ModuleInfo info)
ModuleInfo
findFromInstance(Object instance)
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()
Object
makeInstance(ModuleInfo info)
Allocate a new instance of the class corresponding to the argument.
void
setInstance(ModuleInfo info, Object instance)

Constructor Details

ModuleContext

public ModuleContext(ModuleManager manager)

Method Details

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)