@Override
public Context getRewriteContext()
{
if (this.context == null)
{
Context context = (Context) request.getAttribute(RewriteLifecycleContext.LIFECYCLE_CONTEXT_KEY);
if (context == null)
{
throw new RewriteException("RewriteContext was null. Something is seriously wrong, " +
"or you are attempting to access this event outside of the Rewrite lifecycle.");
}