Class RequestContext


  • public class RequestContext
    extends Object
    The context attached to the current thread and created for a specific new request to Cyclos made to any of its available entry points.
    Please have a look at the ServiceFacade interface for the list of entry points.

    It differs from the InvocationContext in the sense it transcends the transaction used to invoke the requested operation.
    The most common case is when the operation throws a RetryException, for that case, all the invocation chain from ServiceInvokerHandler onwards is restarted and the InvocationContext is cleaned and removed from the current thread but this context remains. It is removed ONLY when the request was finished (because was processed successfully, an error other than RetryException has occurred or the max retries was reached).
    See Also:
    ServiceFacade
    • Method Detail

      • addSensitiveQueryParamValue

        public static void addSensitiveQueryParamValue​(Object value)
        Adds a sensitive query parameter value to the current context. When profiling is active, any value marked as sensitive will be masked in the resulting profiling data.
      • ensure

        public static RequestContext ensure()
        Returns the current context instance or create a new one if missing.
      • remove

        public static void remove()
        Removes the current context
      • isSensitiveQueryParamValue

        public boolean isSensitiveQueryParamValue​(Object value)
      • registerFile

        public void registerFile​(File file)
        Register a new file created when processing the request. All registered files are removed when the context is removed.