Package org.glassfish.contextpropagation
Class Location
- java.lang.Object
-
- org.glassfish.contextpropagation.Location
-
- All Implemented Interfaces:
ContextLifecycle
,ViewCapable
public class Location extends Object implements ViewCapable, ContextLifecycle
The Location class provides information about the current location of the request relative to the point where it originally entered the system. As the request hops from one region of the system to the next (from thread to thread or from process to process) the Location is updated to reflect the changes in location.
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY
static EnumSet<PropagationMode>
PROP_MODES
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextAdded()
Informs this Context that it was added to the ContextMap.void
contextChanged(Object replacementContext)
Informs the receiver that a new context is taking its place in the ContextMapvoid
contextRemoved()
Informs this Context that it was removed from the ContextMapViewCapable
contextToPropagate()
Sent to a Context just before it is propagated.String
getLocationId()
String
getOrigin()
-
-
-
Field Detail
-
PROP_MODES
public static final EnumSet<PropagationMode> PROP_MODES
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Location
protected Location(View aView)
-
-
Method Detail
-
getOrigin
public String getOrigin()
- Returns:
- The original unique identifier for the request. This identifier is generated by the process where the request was originally submitted.
-
getLocationId
public String getLocationId()
- Returns:
- a unique String illustrating the shortest path between the original location where the request entered the system and current location.
-
contextChanged
public void contextChanged(Object replacementContext)
Description copied from interface:ContextLifecycle
Informs the receiver that a new context is taking its place in the ContextMap- Specified by:
contextChanged
in interfaceContextLifecycle
- Parameters:
replacementContext
- The replacement context.
-
contextAdded
public void contextAdded()
Description copied from interface:ContextLifecycle
Informs this Context that it was added to the ContextMap. This notification is particularly valuable when this Context was automatically added to a ContextMap during deserialization.- Specified by:
contextAdded
in interfaceContextLifecycle
-
contextRemoved
public void contextRemoved()
Description copied from interface:ContextLifecycle
Informs this Context that it was removed from the ContextMap- Specified by:
contextRemoved
in interfaceContextLifecycle
-
contextToPropagate
public ViewCapable contextToPropagate()
Description copied from interface:ContextLifecycle
Sent to a Context just before it is propagated.- Specified by:
contextToPropagate
in interfaceContextLifecycle
- Returns:
- The context to propagate. It could be this, another context, or null if the receiver wants to prevent this context propagation.
-
-