org.directwebremoting.jsonp
Class JsonpCallHandler

java.lang.Object
  extended by org.directwebremoting.jsonp.JsonpCallHandler
All Implemented Interfaces:
Handler

public class JsonpCallHandler
extends java.lang.Object
implements Handler

A Handler JSON/REST DWR calls.

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

Constructor Summary
JsonpCallHandler()
           
 
Method Summary
 Calls convertToCalls(javax.servlet.http.HttpServletRequest request)
          Take an HttpServletRequest and create from it a Calls object.
 java.lang.String getCallback(javax.servlet.http.HttpServletRequest request)
           
 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)
           
 void setAccessControl(AccessControl accessControl)
          Accessor for the security manager
 void setConverterManager(ConverterManager converterManager)
          Accessor for the ConverterManager that we configure
 void setJsonpEnabled(boolean jsonpEnabled)
          Are we allowing remote hosts to contact us using JSON?
 void setModuleManager(ModuleManager moduleManager)
          Accessor for the ModuleManager that we configure
 void setRemoter(Remoter remoter)
          Setter for the remoter
 void writeData(java.io.PrintWriter out, java.lang.Object data, java.lang.String callback)
          Create output for some data and write it to the given stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonpCallHandler

public JsonpCallHandler()
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

Specified by:
handle in interface Handler
Parameters:
request - The HTTP request data
response - Where we write the HTTP response data
Throws:
java.io.IOException - If the write process fails

getCallback

public java.lang.String getCallback(javax.servlet.http.HttpServletRequest request)

convertToCalls

public Calls convertToCalls(javax.servlet.http.HttpServletRequest request)
Take an HttpServletRequest and create from it a Calls object.

Parameters:
request - The input data
Returns:
A Calls object that represents the data in the request

writeData

public void writeData(java.io.PrintWriter out,
                      java.lang.Object data,
                      java.lang.String callback)
Create output for some data and write it to the given stream.


isConvertable

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

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 -

setAccessControl

public void setAccessControl(AccessControl accessControl)
Accessor for the security manager

Parameters:
accessControl - The accessControl to set.

setJsonpEnabled

public void setJsonpEnabled(boolean jsonpEnabled)
Are we allowing remote hosts to contact us using JSON?


setRemoter

public void setRemoter(Remoter remoter)
Setter for the remoter

Parameters:
remoter - The new remoter

Copyright 2008