public class ContextManager extends Object implements ActiveContextProvider, ApplicationContextProvider
Context manager allows to register local contexts for objects and manages the Application Context and
the current Active Context.| Constructor and Description |
|---|
ContextManager()
Creates a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
Context |
getActiveContext()
Gets the active context.
|
Context |
getApplicationContext()
Gets the application-wide context.
|
void |
putLocalContext(Object obj,
Context context)
Registers a local context for the given Object.
|
Context |
removeLocalContext(Object obj)
Unregisters a local context.
|
void |
setLocalContextActive(Object obj)
Sets a local context active.
|
public Context getApplicationContext()
getApplicationContext in interface ApplicationContextProviderpublic Context getActiveContext()
getActiveContext in interface ActiveContextProviderpublic void setLocalContextActive(Object obj)
obj - the object whose local context should be set activepublic void putLocalContext(Object obj, Context context)
obj - an objectcontext - the local context of the objectpublic Context removeLocalContext(Object obj)
obj - the object whose local context should be unregistered.Copyright © 2012–2015 Drombler. All rights reserved.