|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.tirsen.angkor.RenderContext
The RenderContext encapsulates the current processing state of the request, the partitioning of responsibilities between Application, RenderContext and ExecuteContext is not yet fully resolved and this needs some refactoring. This is the main engine of Angkor responsible for invoking and mainting the rest of the framework, it's name may be a little inaccurate by now since it ended up being the main engine while refactoring. It will become instantiated now and then to do some work. It can actually only keep cached state since the same instance will not be used at all times (not even within one request). To get around this save its state in the request (for state only maintained within one request) or within the session (for state with a lifetime spanning several requests). To avoid name-clashes (several applications may be running within the same servlet-context) it prefixes each name with the path to the application. TODO well, it actually doesn't do this yet, but it's a good idea! It relies on the ApplicationFilter to instantiate an application accessible via the session and for call backs for the parse phase. For this reason the ApplicationFilter need to filter all pages using angkor. TODO refactoring: This class has too many responsibities. Move many of the processing attributes that doesn't directly have to do with rendering and put them as attributes into ExecuteContext, implement much of the functionality in Valves instead.
Field Summary | |
protected int |
indent
|
Constructor Summary | |
RenderContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
|
RenderContext(javax.servlet.jsp.PageContext pageContext)
|
Method Summary | |
void |
afterRequest()
|
void |
beforeRequest()
|
void |
emptyTag(java.lang.String tag)
|
java.lang.String |
encodeURL(java.lang.String url)
|
void |
endTag(java.lang.String tag)
|
void |
ensureApplicationInit(java.lang.Class applicationClass)
|
Application |
getApplication()
|
EventQueue |
getEventQueue()
|
static RenderContext |
getRenderContext()
Gets the render context of the currently running pipeline. |
javax.servlet.http.HttpServletRequest |
getRequest()
|
protected java.lang.Object |
getRequestAttribute(java.lang.String name)
|
java.lang.String |
getRequestParameter(java.lang.String name)
|
java.lang.String |
getRequestPath()
Returns an absolute uri useful for sending requests which should end up in an action. |
javax.servlet.http.HttpServletResponse |
getResponse()
|
protected java.lang.Object |
getSessionAttribute(java.lang.String attribute)
|
java.io.PrintWriter |
getWriter()
|
protected void |
indent()
|
java.util.Iterator |
iterateParsingComponents()
Returns a tread-safe iterator of the parsing components. |
java.lang.String |
nextUniqueID()
|
void |
println(java.lang.String line)
|
void |
registerParsingComponent(View view)
|
java.lang.String |
requestURL(java.lang.String url)
Constructs an url used to send requests back to the originating component. |
void |
resetParsingComponents()
|
protected void |
setRequestAttribute(java.lang.String name,
java.lang.Object value)
|
protected void |
setSessionAttribute(java.lang.String attribute,
java.lang.Object value)
|
void |
startTag(java.lang.String tag)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int indent
Constructor Detail |
public RenderContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public RenderContext(javax.servlet.jsp.PageContext pageContext)
Method Detail |
public EventQueue getEventQueue()
public Application getApplication()
public void ensureApplicationInit(java.lang.Class applicationClass) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
protected void setRequestAttribute(java.lang.String name, java.lang.Object value)
protected java.lang.Object getRequestAttribute(java.lang.String name)
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
protected void indent() throws java.io.IOException
java.io.IOException
public java.io.PrintWriter getWriter() throws java.io.IOException
java.io.IOException
public void emptyTag(java.lang.String tag) throws java.io.IOException
java.io.IOException
public void startTag(java.lang.String tag) throws java.io.IOException
java.io.IOException
public void endTag(java.lang.String tag) throws java.io.IOException
java.io.IOException
public void println(java.lang.String line) throws java.io.IOException
java.io.IOException
public java.lang.String getRequestPath()
public java.lang.String requestURL(java.lang.String url)
public java.lang.String encodeURL(java.lang.String url)
public void resetParsingComponents()
public java.util.Iterator iterateParsingComponents()
public void registerParsingComponent(View view)
protected void setSessionAttribute(java.lang.String attribute, java.lang.Object value)
protected java.lang.Object getSessionAttribute(java.lang.String attribute)
public java.lang.String nextUniqueID()
public java.lang.String getRequestParameter(java.lang.String name)
public void beforeRequest() throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public void afterRequest() throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public static RenderContext getRenderContext()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |