rewrite-api-servlet 2.0.0.Beta3

org.ocpsoft.rewrite.servlet.event
Class BaseRewrite<IN extends ServletRequest,OUT extends ServletResponse>

java.lang.Object
  extended by org.ocpsoft.rewrite.servlet.event.BaseRewrite<IN,OUT>

public abstract class BaseRewrite<IN extends ServletRequest,OUT extends ServletResponse>
extends Object

Base implementation of InboundServletRewriteEvent

Author:
Lincoln Baxter, III

Nested Class Summary
static class BaseRewrite.ServletRewriteFlow
          Enum to represent the finite state of the Rewrite container.
 
Field Summary
protected  String dispatchResource
           
protected  Flow flow
           
 
Constructor Summary
BaseRewrite(IN request, OUT response, ServletContext servletContext)
           
 
Method Summary
 void abort()
          Abort the current ServletRequest immediately.
 void forward(String resource)
          Once Rule processing has completed, perform a RequestDispatcher.forward(ServletRequest, ServletResponse) to the given resource target.
 String getDispatchResource()
          Get the current dispatch resource.
 Flow getFlow()
          Get the current BaseRewrite.ServletRewriteFlow state.
 IN getRequest()
          Get the current ServletRequest object.
 OUT getResponse()
          Get the current ServletResponse object.
 Context getRewriteContext()
          Get the Context for the current Rewrite.
 ServletContext getServletContext()
          Get the current ServletContext object.
 void handled()
          Stop processing Rule definitions and pass control of the the current ServletRequest to the underlying application, even if a call to abort(), proceed(), forward(String), or any other life-cycle control method has previously been made.
 void include(String resource)
          Once Rule processing has completed, perform a RequestDispatcher.include(ServletRequest, ServletResponse) of the given resource target.
 void proceed()
          Continue processing Rule definitions for the current ServletRequest, even if a call to abort(), handled(), forward(String), or any other life-cycle control method has previously been made.
 void setFlow(BaseRewrite.ServletRewriteFlow flow)
          Set the current BaseRewrite.ServletRewriteFlow state.
 void setRequest(IN request)
          Set the current ServletRequest object.
 void setResponse(OUT response)
          Set the current ServletResponse object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

flow

protected Flow flow

dispatchResource

protected String dispatchResource
Constructor Detail

BaseRewrite

public BaseRewrite(IN request,
                   OUT response,
                   ServletContext servletContext)
Method Detail

abort

public void abort()
Abort the current ServletRequest immediately. No further action will be taken on, and the request will not be passed to the application.


proceed

public void proceed()
Continue processing Rule definitions for the current ServletRequest, even if a call to abort(), handled(), forward(String), or any other life-cycle control method has previously been made.


handled

public void handled()
Stop processing Rule definitions and pass control of the the current ServletRequest to the underlying application, even if a call to abort(), proceed(), forward(String), or any other life-cycle control method has previously been made.


include

public void include(String resource)
Once Rule processing has completed, perform a RequestDispatcher.include(ServletRequest, ServletResponse) of the given resource target.


forward

public void forward(String resource)
Once Rule processing has completed, perform a RequestDispatcher.forward(ServletRequest, ServletResponse) to the given resource target.


getFlow

public Flow getFlow()
Get the current BaseRewrite.ServletRewriteFlow state.


setFlow

public void setFlow(BaseRewrite.ServletRewriteFlow flow)
Set the current BaseRewrite.ServletRewriteFlow state.


getDispatchResource

public String getDispatchResource()
Get the current dispatch resource. This value is used when performing a forward(String), include(String), or redirect.


getServletContext

public ServletContext getServletContext()
Get the current ServletContext object.


getRequest

public IN getRequest()
Get the current ServletRequest object.


getResponse

public OUT getResponse()
Get the current ServletResponse object.


setRequest

public void setRequest(IN request)
Set the current ServletRequest object.


setResponse

public void setResponse(OUT response)
Set the current ServletResponse object.


toString

public String toString()
Overrides:
toString in class Object

getRewriteContext

public Context getRewriteContext()
Get the Context for the current Rewrite.


rewrite-api-servlet 2.0.0.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.