public class PolicyContextPreserver extends Object
PolicyContextPreserver
the contents of the current Policy
associated with the ComposableSecurityManager
will be stored in this instance.
The single instance is reusable to wrap as many Callable
s or Runnable
s as needed
for parallel streams or work to be passed to an Executor
or a newly
constructed Thread
.Modifier and Type | Class and Description |
---|---|
static interface |
PolicyContextPreserver.CurrentContextAccessor
Represents thread context and provides methods to preserve and restore the context value.
|
static interface |
PolicyContextPreserver.WrappedCallable<T> |
static class |
PolicyContextPreserver.WrappedException |
Constructor and Description |
---|
PolicyContextPreserver() |
Modifier and Type | Method and Description |
---|---|
static void |
registerAccessor(PolicyContextPreserver.CurrentContextAccessor accessor) |
<T> PolicyContextPreserver.WrappedCallable<T> |
wrap(Callable<T> callable) |
Runnable |
wrap(Runnable runnable) |
public static void registerAccessor(PolicyContextPreserver.CurrentContextAccessor accessor)
public <T> PolicyContextPreserver.WrappedCallable<T> wrap(Callable<T> callable)
Copyright © 2021. All rights reserved.