Interface ImpersonationService
-
- All Known Implementing Classes:
DefaultImpersonationService
public interface ImpersonationServiceThe impersonation service executes code passed in aImpersonationService.Executorin theImpersonationContextwhich is used to exchange session user, currency, language, site, etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceImpersonationService.Executor<R,T extends java.lang.Throwable>Interface to implement for the executeInContext method.static classImpersonationService.Nothing
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R,T extends java.lang.Throwable>
RexecuteInContext(ImpersonationContext context, ImpersonationService.Executor<R,T> wrapper)Execute the wrapper code in the context of the specified user
-
-
-
Method Detail
-
executeInContext
<R,T extends java.lang.Throwable> R executeInContext(ImpersonationContext context, ImpersonationService.Executor<R,T> wrapper) throws T extends java.lang.Throwable
Execute the wrapper code in the context of the specified user- Type Parameters:
R- The type of the return valueT- The type of the exception thrown by the wrapper- Parameters:
context- The context to execute inwrapper- 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 occursT extends java.lang.Throwable
-
-