org.coinjema.context
Class SpiceRack
java.lang.Object
org.coinjema.context.SpiceRack
- All Implemented Interfaces:
- Registry
public final class SpiceRack
- extends Object
- implements Registry
The SpiceRack keeps a single registry-like tree for the entire JVM, though
different contexts can be accessed by creating new Spiceracks and passing in
a context name.
- Author:
- mstover
To change the template for this generated type comment go to Window -
Preferences - Java - Code Generation - Code and Comments
contextObjects
public static org.coinjema.context.WeakPool contextObjects
getRoot
public static final SpiceRack getRoot()
getInstance
public static final SpiceRack getInstance(CoinjemaContext context)
addChild
public final void addChild(SpiceRack child)
removeChild
public final void removeChild(SpiceRack child)
lookupContext
public final Object lookupContext(String resourceName,
Class<?> objClass,
Object obj)
getScope
public MetaType getScope(String resourceName,
Class<?> objClass,
Object obj)
addContext
public final Object addContext(Resource res,
Class<?> objClass,
Object obj,
Object dep)
getParent
protected final SpiceRack getParent()
createRootContext
public static final void createRootContext()
throws Exception
- Throws:
Exception
createRootContext
public static void createRootContext(ContextSource directory)
throws Exception
- Throws:
Exception
createContext
public static final void createContext(String contextName,
ContextSource directory)
destroyContext
public static final void destroyContext(String contextName)
clearChild
protected final void clearChild()
clear
protected final void clear()
refresh
public final void refresh()
refresh
public final void refresh(boolean redo)
getContext
public final CoinjemaContext getContext()
setContext
public final void setContext(CoinjemaContext context)
getDirectory
public final ContextSource getDirectory()
- Returns:
- Returns the directory.
setDirectory
public final void setDirectory(ContextSource directory)
- Parameters:
directory
- The directory to set.
setParent
public final void setParent(SpiceRack parent)
- Parameters:
parent
- The parent to set.
getContextRoot
public File getContextRoot()
- Specified by:
getContextRoot
in interface Registry
getSharedDep
public Object getSharedDep(String contextPath,
String depName)
- Specified by:
getSharedDep
in interface Registry
getSharedDep
public Object getSharedDep(String contextPath)
- Specified by:
getSharedDep
in interface Registry
toString
public String toString()
- Overrides:
toString
in class Object
Public Domain Software.