|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.util.pool.RecyclableSupport
org.apache.turbine.services.rundata.DefaultTurbineRunData
DefaultTurbineRunData is the default implementation of the TurbineRunData interface, which is distributed by the Turbine RunData service, if another implementation is not defined in the default or specified RunData configuration. TurbineRunData is an extension to RunData, which is an interface to run-rime information that is passed within Turbine. This provides the threading mechanism for the entire system because multiple requests can potentially come in at the same time. Thus, there is only one RunData implementation for each request that is being serviced.
DefaultTurbineRunData implements the Recyclable interface making it possible to pool its instances for recycling.
| Field Summary | |
CookieParser |
cookies
A reference to a cookie parser. |
| Constructor Summary | |
DefaultTurbineRunData()
Constructs a run data object. |
|
| Method Summary | |
void |
addMessage(org.apache.ecs.Element msg)
Adds the ECS element to message. |
void |
addMessage(java.lang.String msg)
Adds the string to message. |
void |
declareDirectResponse()
Declares that output will be direct to the response stream, even though getOut() may never be called. |
void |
dispose()
Disposes a run data object. |
AccessControlList |
getACL()
Gets the access control list. |
java.lang.String |
getAction()
Gets the action. |
java.lang.String |
getCharSet()
Gets the charset. |
java.lang.String |
getContentType()
Gets the HTTP content type to return. |
java.lang.String |
getContextPath()
Gets the cached context path. |
CookieParser |
getCookieParser()
Gets the cookie parser without parsing the cookies. |
CookieParser |
getCookies()
Gets the cookies. |
java.util.Map |
getDebugVariables()
Gets a Map of debug variables. |
protected java.lang.String |
getDefaultCharSet()
Gets the default charset defined by a property named "locale.default.charset" or by the specified locale. |
protected static java.util.Locale |
getDefaultLocale()
Gets the default locale defined by properties named "locale.default.lang" and "locale.default.country". |
java.util.Map |
getJNDIContexts()
Gets JNDI Contexts. |
java.lang.String |
getLayout()
If the Layout has not been defined by the screen then set the layout to be "DefaultLayout". |
java.lang.String |
getLayoutTemplate()
Convenience method for a template info that returns the layout template being used. |
java.util.Locale |
getLocale()
Gets the locale. |
java.lang.String |
getMessage()
Gets the results of an action or another message to be displayed as a string. |
org.apache.ecs.StringElement |
getMessageAsHTML()
Gets the results of an action or another message to be displayed as an ECS string element. |
FormMessages |
getMessages()
Gets a FormMessages object where all the messages to the user should be stored. |
java.io.PrintWriter |
getOut()
Deprecated. no replacement planned, response writer will not be cached |
org.apache.ecs.Document |
getPage()
Deprecated. no replacement planned, ECS is no longer a requirement |
ParameterParser |
getParameterParser()
Gets the parameter parser without parsing the parameters. |
ParameterParser |
getParameters()
Gets the parameters. |
java.lang.String |
getRedirectURI()
Gets the redirect URI. |
java.lang.String |
getRemoteAddr()
Gets the IP address of the client that sent the request. |
java.lang.String |
getRemoteHost()
Gets the qualified name of the client that sent the request. |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the servlet request. |
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the servlet response. |
java.lang.String |
getScreen()
Gets the screen to execute. |
java.lang.String |
getScreenTemplate()
Convenience method for a template info that returns the name of the template being used. |
java.lang.String |
getScriptName()
Gets the cached script name. |
ServerData |
getServerData()
Gets the server data ofy the request. |
java.lang.String |
getServerName()
Gets the cached server name. |
int |
getServerPort()
Gets the cached server port. |
java.lang.String |
getServerScheme()
Gets the cached server scheme. |
javax.servlet.ServletConfig |
getServletConfig()
Gets the servlet configuration used during servlet init. |
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context used during servlet init. |
javax.servlet.http.HttpSession |
getSession()
Gets the servlet session information. |
java.lang.String |
getStackTrace()
Gets the stack trace if set. |
java.lang.Throwable |
getStackTraceException()
Gets the stack trace exception if set. |
int |
getStatusCode()
Gets the HTTP status code to return. |
SystemError[] |
getSystemErrors()
Gets an array of system errors. |
java.lang.String |
getTemplateEncoding()
Gets the character encoding to use for reading template files. |
TemplateInfo |
getTemplateInfo()
Gets the template info. |
java.lang.String |
getTitle()
Gets the title of the page. |
User |
getUser()
Gets the user. |
java.lang.String |
getUserAgent()
Get the user agent for the request. |
User |
getUserFromSession()
Attempts to get the user from the session. |
static User |
getUserFromSession(javax.servlet.http.HttpSession session)
Attempts to get the User object from the session. |
java.util.Map |
getVarDebug()
Deprecated. use getDebugVariables() instead |
boolean |
hasAction()
Whether or not an action has been defined. |
boolean |
hasMessage()
Whether or not a message has been defined. |
boolean |
hasScreen()
Whether or not a screen has been defined. |
boolean |
isOutSet()
Deprecated. no replacement planned, response writer will not be cached |
boolean |
isPageSet()
Deprecated. no replacement planned, ECS is no longer a requirement |
void |
populate()
Pulls a user object from the session and increments the access counter and sets the last access date for the object. |
void |
recycle()
Recycles a run data object. |
boolean |
removeUserFromSession()
Allows one to invalidate the user in the default session. |
static boolean |
removeUserFromSession(javax.servlet.http.HttpSession session)
Allows one to invalidate the user in a session. |
void |
save()
Saves a user object into the session. |
void |
setACL(AccessControlList acl)
Sets the access control list. |
void |
setAction(java.lang.String action)
Sets the action for the request. |
void |
setCharSet(java.lang.String charSet)
Sets the charset. |
void |
setContentType(java.lang.String contentType)
Sets the HTTP content type to return. |
protected void |
setContextPath(java.lang.String contextPath)
Sets the cached context path that is stored in the server data. |
void |
setCookieParser(CookieParser parser)
Sets the cookie parser. |
void |
setDebugVariable(java.lang.String name,
java.lang.Object value)
Sets a name/value pair in an internal Map that is accessible from the Error screen. |
void |
setJNDIContexts(java.util.Map contexts)
Sets JNDI Contexts. |
void |
setLayout(java.lang.String layout)
Set the layout for the request. |
void |
setLayoutTemplate(java.lang.String layout)
Modifies the layout template for the screen. |
void |
setLocale(java.util.Locale locale)
Sets the locale. |
void |
setMessage(org.apache.ecs.Element msg)
Sets the message for the request as an ECS element. |
void |
setMessage(java.lang.String msg)
Sets the message for the request as a string. |
void |
setMessages(FormMessages msgs)
Sets the FormMessages object for the request. |
protected void |
setOut(java.io.PrintWriter out)
Deprecated. no replacement planned, response writer will not be cached |
void |
setParameterParser(ParameterParser parser)
Sets the parameter parser. |
void |
setRedirectURI(java.lang.String ruri)
Sets the redirect uri. |
void |
setRequest(javax.servlet.http.HttpServletRequest req)
Sets the servlet request. |
void |
setResponse(javax.servlet.http.HttpServletResponse res)
Sets the servlet response. |
void |
setScreen(java.lang.String screen)
Sets the screen for the request. |
void |
setScreenTemplate(java.lang.String screen)
Sets the screen template for the request. |
protected void |
setScriptName(java.lang.String scriptName)
Sets the cached script name that is stored in the server data. |
void |
setServerData(ServerData serverData)
Sets the server data of the request. |
protected void |
setServerName(java.lang.String serverName)
Sets the cached server same that is stored in the server data. |
protected void |
setServerPort(int port)
Sets the cached server port that is stored in the server data. |
protected void |
setServerScheme(java.lang.String serverScheme)
Sets the cached server scheme that is stored in the server data. |
void |
setServletConfig(javax.servlet.ServletConfig config)
Sets the servlet configuration used during servlet init. |
void |
setSession(javax.servlet.http.HttpSession sess)
Deprecated. No replacement. This method no longer does anything. |
void |
setStackTrace(java.lang.String trace,
java.lang.Throwable exp)
Sets the stack trace. |
void |
setStatusCode(int statusCode)
Sets the HTTP status code to return. |
void |
setSystemError(SystemError err)
Adds a critical system error. |
void |
setTemplateEncoding(java.lang.String encoding)
Sets the character encoding to use for reading template files. |
void |
setTitle(java.lang.String title)
Sets the title of the page. |
void |
setUser(User user)
Sets the user. |
void |
unsetMessage()
Unsets the message for the request. |
boolean |
userExists()
Checks if a user exists in this session. |
| Methods inherited from class org.apache.turbine.util.pool.RecyclableSupport |
doDispose, isDisposed, Recyclable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.turbine.util.pool.Recyclable |
isDisposed |
| Field Detail |
public CookieParser cookies
| Constructor Detail |
public DefaultTurbineRunData()
| Method Detail |
public static User getUserFromSession(javax.servlet.http.HttpSession session)
session - An HttpSession.
public static boolean removeUserFromSession(javax.servlet.http.HttpSession session)
session - An HttpSession.
protected static java.util.Locale getDefaultLocale()
protected java.lang.String getDefaultCharSet()
public void recycle()
recycle in interface Recyclablerecycle in class RecyclableSupportpublic void dispose()
dispose in interface Recyclabledispose in class RecyclableSupportpublic ParameterParser getParameters()
getParameters in interface RunDatapublic CookieParser getCookies()
getCookies in interface RunDatapublic javax.servlet.http.HttpServletRequest getRequest()
getRequest in interface RunDatapublic javax.servlet.http.HttpServletResponse getResponse()
getResponse in interface RunDatapublic javax.servlet.http.HttpSession getSession()
getSession in interface RunDatapublic javax.servlet.ServletConfig getServletConfig()
getServletConfig in interface RunDatapublic javax.servlet.ServletContext getServletContext()
getServletContext in interface RunDatapublic AccessControlList getACL()
getACL in interface RunDatapublic void setACL(AccessControlList acl)
setACL in interface RunDataacl - an access control list.public boolean isPageSet()
isPageSet in interface RunDatapublic org.apache.ecs.Document getPage()
getPage in interface RunDatapublic boolean hasAction()
hasAction in interface RunDatapublic java.lang.String getAction()
getAction in interface RunDatapublic void setAction(java.lang.String action)
setAction in interface RunDataaction - a atring.public java.lang.String getLayout()
getLayout in interface RunDatapublic void setLayout(java.lang.String layout)
setLayout in interface RunDatalayout - a string.public java.lang.String getLayoutTemplate()
getLayoutTemplate in interface RunDatapublic void setLayoutTemplate(java.lang.String layout)
setLayoutTemplate in interface RunDatalayout - a layout template.public boolean hasScreen()
hasScreen in interface RunDatapublic java.lang.String getScreen()
getScreen in interface RunDatapublic void setScreen(java.lang.String screen)
setScreen in interface RunDatascreen - a string.public java.lang.String getScreenTemplate()
getScreenTemplate in interface RunDatapublic void setScreenTemplate(java.lang.String screen)
setScreenTemplate in interface RunDatascreen - a screen template.public java.lang.String getTemplateEncoding()
getTemplateEncoding in interface RunDatapublic void setTemplateEncoding(java.lang.String encoding)
setTemplateEncoding in interface RunDataencoding - the template encoding.public TemplateInfo getTemplateInfo()
getTemplateInfo in interface RunDatapublic boolean hasMessage()
hasMessage in interface RunDatapublic java.lang.String getMessage()
getMessage in interface RunDatapublic void setMessage(java.lang.String msg)
setMessage in interface RunDatamsg - a string.public void addMessage(java.lang.String msg)
addMessage in interface RunDatamsg - a string.public org.apache.ecs.StringElement getMessageAsHTML()
getMessageAsHTML in interface RunDatapublic void setMessage(org.apache.ecs.Element msg)
setMessage in interface RunDatamsg - an element.public void addMessage(org.apache.ecs.Element msg)
addMessage in interface RunDatamsg - an element.public void unsetMessage()
unsetMessage in interface RunDatapublic FormMessages getMessages()
getMessages in interface RunDatapublic void setMessages(FormMessages msgs)
setMessages in interface RunDatamsgs - A FormMessages.public java.lang.String getTitle()
getTitle in interface RunDatapublic void setTitle(java.lang.String title)
setTitle in interface RunDatatitle - a string.public boolean userExists()
userExists in interface RunDatapublic User getUser()
getUser in interface RunDatapublic void setUser(User user)
setUser in interface RunDatauser - a user.public User getUserFromSession()
getUserFromSession in interface RunDatapublic boolean removeUserFromSession()
removeUserFromSession in interface RunDatapublic boolean isOutSet()
isOutSet in interface RunData
public java.io.PrintWriter getOut()
throws java.io.IOException
getOut in interface RunDatajava.io.IOExceptionpublic void declareDirectResponse()
declareDirectResponse in interface RunDatapublic java.util.Locale getLocale()
getLocale in interface RunDatapublic void setLocale(java.util.Locale locale)
setLocale in interface RunDatalocale - the new locale.public java.lang.String getCharSet()
getCharSet in interface RunDatapublic void setCharSet(java.lang.String charSet)
setCharSet in interface RunDatacharSet - the name of the new charset.public java.lang.String getContentType()
getContentType in interface RunDatapublic void setContentType(java.lang.String contentType)
setContentType in interface RunDatacontentType - a string.public java.lang.String getRedirectURI()
getRedirectURI in interface RunDatapublic void setRedirectURI(java.lang.String ruri)
setRedirectURI in interface RunDataruri - a string.public int getStatusCode()
getStatusCode in interface RunDatapublic void setStatusCode(int statusCode)
setStatusCode in interface RunDatastatusCode - the status.public SystemError[] getSystemErrors()
getSystemErrors in interface RunDatapublic void setSystemError(SystemError err)
setSystemError in interface RunDataerr - a system error.public java.util.Map getJNDIContexts()
getJNDIContexts in interface RunDatapublic void setJNDIContexts(java.util.Map contexts)
setJNDIContexts in interface RunDatacontexts - a hashtable.public java.lang.String getServerScheme()
getServerScheme in interface RunDatapublic java.lang.String getServerName()
getServerName in interface RunDatapublic int getServerPort()
getServerPort in interface RunDatapublic java.lang.String getContextPath()
getContextPath in interface RunDatapublic java.lang.String getScriptName()
getScriptName in interface RunDatapublic ServerData getServerData()
getServerData in interface RunDatapublic java.lang.String getRemoteAddr()
getRemoteAddr in interface RunDatapublic java.lang.String getRemoteHost()
getRemoteHost in interface RunDatapublic java.lang.String getUserAgent()
getUserAgent in interface RunDatapublic void populate()
populate in interface RunDatapublic void save()
save in interface RunDatapublic java.lang.String getStackTrace()
getStackTrace in interface RunDatapublic java.lang.Throwable getStackTraceException()
getStackTraceException in interface RunData
public void setStackTrace(java.lang.String trace,
java.lang.Throwable exp)
setStackTrace in interface RunDatatrace - the stack trace.exp - the exception.public java.util.Map getVarDebug()
getDebugVariables() instead
getVarDebug in interface RunData
public void setDebugVariable(java.lang.String name,
java.lang.Object value)
setDebugVariable in interface RunDataname - name of the variablevalue - value of the variable.public java.util.Map getDebugVariables()
getDebugVariables in interface RunDatapublic ParameterParser getParameterParser()
getParameterParser in interface TurbineRunDatapublic void setParameterParser(ParameterParser parser)
setParameterParser in interface TurbineRunDataparser - a parameter parser.public CookieParser getCookieParser()
getCookieParser in interface TurbineRunDatapublic void setCookieParser(CookieParser parser)
setCookieParser in interface TurbineRunDataparser - a cookie parser.public void setRequest(javax.servlet.http.HttpServletRequest req)
setRequest in interface TurbineRunDatareq - a request.public void setResponse(javax.servlet.http.HttpServletResponse res)
setResponse in interface TurbineRunDatares - a response.public void setSession(javax.servlet.http.HttpSession sess)
setSession in interface TurbineRunDatasess - a session.public void setServletConfig(javax.servlet.ServletConfig config)
setServletConfig in interface TurbineRunDataconfig - a configuration.public void setServerData(ServerData serverData)
setServerData in interface TurbineRunDataserverData - server data.protected void setOut(java.io.PrintWriter out)
out - a print writer.protected void setServerScheme(java.lang.String serverScheme)
serverScheme - a string.protected void setServerName(java.lang.String serverName)
serverName - a string.protected void setServerPort(int port)
port - an int.protected void setContextPath(java.lang.String contextPath)
contextPath - a string.protected void setScriptName(java.lang.String scriptName)
scriptName - a string.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||