Coinjema
1.7

org.coinjema.context
Class SpiceRack

java.lang.Object
  extended by 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

Field Summary
static org.coinjema.context.WeakPool contextObjects
           
 
Method Summary
 void addChild(SpiceRack child)
           
 Object addContext(Resource res, Class<?> objClass, Object obj, Object dep)
           
protected  void clear()
           
protected  void clearChild()
           
static void createContext(String contextName, ContextSource directory)
           
static void createRootContext()
           
static void createRootContext(ContextSource directory)
           
static void destroyContext(String contextName)
           
 CoinjemaContext getContext()
           
 File getContextRoot()
           
 ContextSource getDirectory()
           
static SpiceRack getInstance(CoinjemaContext context)
           
protected  SpiceRack getParent()
           
static SpiceRack getRoot()
           
 MetaType getScope(String resourceName, Class<?> objClass, Object obj)
           
 Object getSharedDep(String contextPath)
           
 Object getSharedDep(String contextPath, String depName)
           
 Object lookupContext(String resourceName, Class<?> objClass, Object obj)
           
 void refresh()
           
 void refresh(boolean redo)
           
 void removeChild(SpiceRack child)
           
 void setContext(CoinjemaContext context)
           
 void setDirectory(ContextSource directory)
           
 void setParent(SpiceRack parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contextObjects

public static org.coinjema.context.WeakPool contextObjects
Method Detail

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

Coinjema
1.7

Public Domain Software.