public abstract class AbstractRuntime extends Object implements Runtime
| Modifier and Type | Field and Description |
|---|---|
protected RuntimeContainer |
container
Component Dependencies
|
protected static org.apache.commons.logging.Log |
exceptionLogger |
protected static org.apache.commons.logging.Log |
logger |
protected WebScriptSession |
session |
| Constructor and Description |
|---|
AbstractRuntime(RuntimeContainer container)
Construct
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
beforeProcessError(Match match,
Throwable e)
Before processing an error exception - hook point to allow additional processing
of the exception based on the runtime.
|
protected abstract Authenticator |
createAuthenticator()
Create a Web Script Authenticator
|
protected abstract WebScriptRequest |
createRequest(Match match)
Create a Web Script Request
|
protected abstract WebScriptResponse |
createResponse()
Create a Web Script Response
|
protected abstract WebScriptSessionFactory |
createSessionFactory()
Create a Web Script Session
|
void |
executeScript()
Execute the Web Script encapsulated by this Web Script Runtime
|
protected void |
executeScript(WebScriptRequest scriptReq,
WebScriptResponse scriptRes,
Authenticator auth)
Execute script given the specified context
|
Container |
getContainer()
Gets the Web Script Container within which this Runtime is hosted
|
protected StatusTemplate |
getFormatStatusTemplate(String format)
Get format Status Template path
|
protected static WebScriptRequest |
getRealWebScriptRequest(WebScriptRequest request)
Helper to retrieve real (last) Web Script Request in a stack of wrapped Web Script requests
|
protected static WebScriptResponse |
getRealWebScriptResponse(WebScriptResponse response)
Helper to retrieve real (last) Web Script Response in a stack of wrapped Web Script responses
|
protected abstract String |
getScriptMethod()
Get the Web Script Method e.g.
|
Map<String,Object> |
getScriptParameters()
Gets script parameters
|
protected abstract String |
getScriptUrl()
Get the Web Script Url
|
WebScriptSession |
getSession()
Get the Web Script Session
|
protected StatusTemplate |
getStatusCodeTemplate(int statusCode)
Get code specific Status Template path
|
protected StatusTemplate |
getStatusTemplate()
Get Status Template path
|
Map<String,Object> |
getTemplateParameters()
Gets template parameters
|
protected void |
renderErrorResponse(Match match,
Throwable exception,
WebScriptRequest request,
WebScriptResponse response)
Renders an error message to the response based on the Throwable exception passed in.
|
void |
setURLModelFactory(URLModelFactory urlModelFactory) |
protected static final org.apache.commons.logging.Log logger
protected static final org.apache.commons.logging.Log exceptionLogger
protected RuntimeContainer container
protected WebScriptSession session
public AbstractRuntime(RuntimeContainer container)
container - web script contextpublic Container getContainer()
RuntimegetContainer in interface Runtimepublic WebScriptSession getSession()
RuntimegetSession in interface Runtimepublic void setURLModelFactory(URLModelFactory urlModelFactory)
public final void executeScript()
protected void renderErrorResponse(Match match, Throwable exception, WebScriptRequest request, WebScriptResponse response)
match - exception - request - response - protected boolean beforeProcessError(Match match, Throwable e)
match - WebScript that was processed and caused the errore - Exception that occured during webscript processingprotected void executeScript(WebScriptRequest scriptReq, WebScriptResponse scriptRes, Authenticator auth) throws IOException
scriptReq - WebScriptRequestscriptRes - WebScriptResponseauth - AuthenticatorIOExceptionprotected StatusTemplate getStatusCodeTemplate(int statusCode)
statusCode - intprotected StatusTemplate getFormatStatusTemplate(String format)
format - Stringprotected StatusTemplate getStatusTemplate()
public Map<String,Object> getScriptParameters()
RuntimegetScriptParameters in interface Runtimepublic Map<String,Object> getTemplateParameters()
RuntimegetTemplateParameters in interface Runtimeprotected abstract String getScriptMethod()
protected abstract String getScriptUrl()
protected abstract WebScriptRequest createRequest(Match match)
match - web script matching the script method and urlprotected abstract WebScriptResponse createResponse()
protected abstract Authenticator createAuthenticator()
protected abstract WebScriptSessionFactory createSessionFactory()
protected static WebScriptRequest getRealWebScriptRequest(WebScriptRequest request)
request - WebScriptRequestprotected static WebScriptResponse getRealWebScriptResponse(WebScriptResponse response)
response - WebScriptResponseCopyright © 2005–2021 Alfresco Software. All rights reserved.