org.directwebremoting.dwrp
Class BaseCallHandler

java.lang.Object
  extended by org.directwebremoting.dwrp.BaseDwrpHandler
      extended by org.directwebremoting.dwrp.BaseCallHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
HtmlCallHandler, PlainCallHandler

public abstract class BaseCallHandler
extends BaseDwrpHandler

A Marshaller that output plain Javascript. This marshaller can be tweaked to output Javascript in an HTML context. This class works in concert with CallScriptConduit, they should be considered closely related and it is important to understand what one does while editing the other.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
BaseCallHandler()
           
 
Method Summary
 void addScriptHandleExceptions(ScriptConduit conduit, ScriptBuffer script)
          Marshall a Script without worrying about MarshallExceptions
 void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle a URL request that has been mapped to this Handler
 boolean isConvertable(java.lang.Class<?> paramType)
           
 boolean isJsonOutput()
           
 void marshallException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception ex)
           
 Calls marshallInbound(CallBatch batch)
          Convert batch into calls.
 void marshallOutbound(Replies replies, javax.servlet.http.HttpServletResponse response)
           
 void setAccessLogLevel(java.lang.String accessLogLevel)
          When and what should we log? Options are (specified in the DWR servlet's init-params): 1) call (start of call + successful return values).
 void setConverterManager(ConverterManager converterManager)
          Accessor for the ConverterManager that we configure
 void setDebug(boolean debug)
          Set the debug status
 void setDebugScriptOutput(boolean debugScriptOutput)
          Do we debug all the scripts that we output?
 void setJsonOutput(boolean jsonOutput)
           
 void setModuleManager(ModuleManager moduleManager)
          Accessor for the ModuleManager that we configure
 void setPageNormalizer(PageNormalizer pageNormalizer)
          Accessor for the PageNormalizer.
 void setRemoter(Remoter remoter)
          Setter for the remoter
 
Methods inherited from class org.directwebremoting.dwrp.BaseDwrpHandler
setAllowGetForSafariButMakeForgeryEasier, setCrossDomainSessionSecurity
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCallHandler

public BaseCallHandler()
Method Detail

handle

public void handle(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException
Description copied from interface: Handler
Handle a URL request that has been mapped to this Handler

Parameters:
request - The HTTP request data
response - Where we write the HTTP response data
Throws:
java.io.IOException - If the write process fails

marshallInbound

public Calls marshallInbound(CallBatch batch)
Convert batch into calls.

Parameters:
batch - The data we've parsed from the request
Returns:
The function calls to make

marshallOutbound

public void marshallOutbound(Replies replies,
                             javax.servlet.http.HttpServletResponse response)
                      throws java.io.IOException
Throws:
java.io.IOException

marshallException

public void marshallException(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.Exception ex)
                       throws java.io.IOException
Throws:
java.io.IOException

addScriptHandleExceptions

public void addScriptHandleExceptions(ScriptConduit conduit,
                                      ScriptBuffer script)
                               throws java.io.IOException
Marshall a Script without worrying about MarshallExceptions

Throws:
java.io.IOException

isConvertable

public boolean isConvertable(java.lang.Class<?> paramType)

setDebug

public void setDebug(boolean debug)
Set the debug status

Parameters:
debug - The new debug setting

setRemoter

public void setRemoter(Remoter remoter)
Setter for the remoter

Parameters:
remoter - The new remoter

setDebugScriptOutput

public void setDebugScriptOutput(boolean debugScriptOutput)
Do we debug all the scripts that we output?

Parameters:
debugScriptOutput - true to debug all of the output scripts (verbose)

isJsonOutput

public boolean isJsonOutput()
Returns:
Are we outputting in JSON mode?

setJsonOutput

public void setJsonOutput(boolean jsonOutput)
Parameters:
jsonOutput - Are we outputting in JSON mode?

setAccessLogLevel

public void setAccessLogLevel(java.lang.String accessLogLevel)
When and what should we log? Options are (specified in the DWR servlet's init-params): 1) call (start of call + successful return values). 2) exception (checked) - default for debug. 3) runtimeexception (unchecked). 4) error - default for production. 5) off.


setPageNormalizer

public void setPageNormalizer(PageNormalizer pageNormalizer)
Accessor for the PageNormalizer.

Parameters:
pageNormalizer - The new PageNormalizer

setConverterManager

public void setConverterManager(ConverterManager converterManager)
Accessor for the ConverterManager that we configure

Parameters:
converterManager -

setModuleManager

public void setModuleManager(ModuleManager moduleManager)
Accessor for the ModuleManager that we configure

Parameters:
moduleManager -

Copyright 2008