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 StringKEYstatic EnumSet<PropagationMode>PROP_MODES
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextAdded()Informs this Context that it was added to the ContextMap.voidcontextChanged(Object replacementContext)Informs the receiver that a new context is taking its place in the ContextMapvoidcontextRemoved()Informs this Context that it was removed from the ContextMapViewCapablecontextToPropagate()Sent to a Context just before it is propagated.StringgetLocationId()StringgetOrigin()
-
-
-
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:ContextLifecycleInforms the receiver that a new context is taking its place in the ContextMap- Specified by:
contextChangedin interfaceContextLifecycle- Parameters:
replacementContext- The replacement context.
-
contextAdded
public void contextAdded()
Description copied from interface:ContextLifecycleInforms 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:
contextAddedin interfaceContextLifecycle
-
contextRemoved
public void contextRemoved()
Description copied from interface:ContextLifecycleInforms this Context that it was removed from the ContextMap- Specified by:
contextRemovedin interfaceContextLifecycle
-
contextToPropagate
public ViewCapable contextToPropagate()
Description copied from interface:ContextLifecycleSent to a Context just before it is propagated.- Specified by:
contextToPropagatein interfaceContextLifecycle- Returns:
- The context to propagate. It could be this, another context, or null if the receiver wants to prevent this context propagation.
-
-