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.
|
Context |
getLocalContext(Object obj) |
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 ApplicationContextProvider
public Context getActiveContext()
getActiveContext
in interface ActiveContextProvider
public 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–2017 Drombler. All rights reserved.