Interface ImpersonationService

All Known Implementing Classes:
DefaultImpersonationService

public interface ImpersonationService
The impersonation service executes code passed in a ImpersonationService.Executor in the ImpersonationContext which is used to exchange session user, currency, language, site, etc.
  • Method Details

    • executeInContext

      <R, T extends Throwable> R executeInContext(ImpersonationContext context, ImpersonationService.Executor<R,T> wrapper) throws T
      Execute the wrapper code in the context of the specified user
      Type Parameters:
      R - The type of the return value
      T - The type of the exception thrown by the wrapper
      Parameters:
      context - The context to execute in
      wrapper - The code to execute in that context
      Returns:
      The result of method being executed
      Throws:
      T - The exception thrown by the wrapper if an error occurs