public class TopiaApplicationContextCache extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static Map<Properties,AbstractTopiaApplicationContext> |
contextCache
Cache that contains all some already registered caches
|
| Constructor and Description |
|---|
TopiaApplicationContextCache() |
| Modifier and Type | Method and Description |
|---|---|
static <C extends AbstractTopiaApplicationContext> |
getContext(Properties config,
com.google.common.base.Function<Properties,C> createContextFunction)
Static method that can provide an ApplicationContext.
|
static List<String> |
getRegisteredContextUrls()
Method to get the list of contexts in memory (each context is identified by its URL).
|
static void |
removeContext(AbstractTopiaApplicationContext context)
Remove the given TopiaApplicationContext from the registered ones
|
protected static Map<Properties,AbstractTopiaApplicationContext> contextCache
public static <C extends AbstractTopiaApplicationContext> C getContext(Properties config, com.google.common.base.Function<Properties,C> createContextFunction) throws TopiaNotFoundException
C - the type of TopiaApplicationContext you expectconfig - the configuration of the contextcreateContextFunction - the function that will be in charge of the context creation. It might not be used
inside the method if the context is found and still openedTopiaNotFoundException - if any pbpublic static List<String> getRegisteredContextUrls()
public static void removeContext(AbstractTopiaApplicationContext context)
context - the context instance to removeCopyright © 2004–2013 CodeLutin. All rights reserved.