Package com.tangosol.application
Class ContainerHelper
- java.lang.Object
-
- com.tangosol.application.ContainerHelper
-
public class ContainerHelper extends Object
Helper methods for Container aware logic.- Since:
- Coherence 12.2.1
- Author:
- gg 2005.10.24
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 Summary
Constructors Constructor Description ContainerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
initializeThreadContext
public static void initializeThreadContext(Service service)
Initialize the thread context for the given Service.- Parameters:
service
- a Service instance
-
getSwitchCurrentContext
public 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.- Parameters:
service
- a Service instance- Returns:
- a ContainerContext to use for invocations later or null if the invocation should be done using the service thread context
-
getSwitchServiceContext
public 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.- Parameters:
service
- a Service instance- Returns:
- a ContainerContext to use for invocations later or null if the invocation should be done using the current thread context
-
getContextAwareListener
public 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.- Parameters:
service
- a Service instancelistener
- the listener to wrap- Returns:
- the corresponding context aware listener
-
-