/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }
/** * Obtain the security context associated with the current thread and associate this context when an action is performed. This method is used by Weld to propagate the security context of the current thread to * different threads. * * <p> * By default, the consumer is using {@link #getSecurityContext()} to associate the security context. * </p> * * @return a consumer that accepts an action to be performed with the security context associated with the current thread */ default Consumer<Runnable> getSecurityContextAssociator() { final SecurityContext securityContext = getSecurityContext(); return (action) -> { try { securityContext.associate(); action.run(); } finally { securityContext.dissociate(); securityContext.close(); } }; }