public class ContainerHelper extends Object
| Modifier and Type | Class and Description | 
|---|---|
protected static class  | 
ContainerHelper.ContextAwareListener
Context aware delegating listener. 
 | 
protected static class  | 
ContainerHelper.ContextAwarePrimingListener
Context aware delegating synchronous priming listener. 
 | 
protected static class  | 
ContainerHelper.ContextAwareSyncListener
Context aware delegating synchronous listener. 
 | 
| Constructor and Description | 
|---|
ContainerHelper()  | 
| Modifier and Type | Method and Description | 
|---|---|
static MapListener | 
getContextAwareListener(Service service, MapListener listener)
Wrap the specified MapListener in such a way that the returned listener would dispatch events using the caller's context rather than context associated with the specified Service. 
 | 
static ContainerContext | 
getSwitchCurrentContext(Service service)
Given the ContainerContext associated with the specified Service and the current thread's context, return a ContainerContext instance that should be used by the Service thread to perform actions on behalf of the current thread's context. 
 | 
static ContainerContext | 
getSwitchServiceContext(Service service)
Given the ContainerContext associated with the specified Service and the current thread's context, return a ContainerContext instance that should be used by the current thread to perform actions on behalf of the Service thread's context. 
 | 
static void | 
initializeThreadContext(Service service)
Initialize the thread context for the given Service. 
 | 
public static void initializeThreadContext(Service service)
service - a Service instancepublic static ContainerContext getSwitchCurrentContext(Service service)
service - a Service instancepublic static ContainerContext getSwitchServiceContext(Service service)
service - a Service instancepublic static MapListener getContextAwareListener(Service service, MapListener listener)
service - a Service instancelistener - the listener to wrap