Returns a {@code Runnable} instance matching the given argument while additionally ensuring that it will
retain and execute under this Subject's identity. The returned object can be used with an
{@link java.util.concurrent.Executor Executor} or another thread to execute as this Subject.
<p/>
This will effectively ensure that any calls to
{@code SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()} and related functionality will continue
to function properly on any thread that executes the returned {@code Runnable} instance.
<p/>
*Note that if you need a return value to be returned as a result of the runnable's execution or if you need to
react to any Exceptions, it is highly recommended to use the
{@link #associateWith(java.util.concurrent.Callable) createCallable} method instead of this one.
@param runnable the runnable to execute as this {@code Subject}
@return a {@code Runnable} that can be run as this {@code Subject} on another thread.
@see #associateWith (java.util.concurrent.Callable)
Returns a {@code Runnable} instance matching the given argument while additionally ensuring that it will retain and execute under this Subject's identity. The returned object can be used with an {@link java.util.concurrent.Executor Executor} or another thread to execute as this Subject. <p/> This will effectively ensure that any calls to {@code SecurityUtils}.{@link SecurityUtils#getSubject() getSubject()} and related functionality will continue to function properly on any thread that executes the returned {@code Runnable} instance. <p/> *Note that if you need a return value to be returned as a result of the runnable's execution or if you need to react to any Exceptions, it is highly recommended to use the {@link #associateWith(java.util.concurrent.Callable) createCallable} method instead of this one.
@param runnable the runnable to execute as this {@code Subject} @return a {@code Runnable} that can be run as this {@code Subject} on another thread. @see #associateWith (java.util.concurrent.Callable)