org.directwebremoting.extend
Interface Remoter

All Known Implementing Classes:
DefaultRemoter, JaxerRemoter, ParallelDefaultRemoter

public interface Remoter

The heart of DWR is a system to generate content from some requests. This interface generates scripts and executes remote calls.

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

Method Summary
 Replies execute(Calls calls)
          Execute a set of remote calls and generate set of reply data for later conversion to whatever wire protocol we are using today.
 java.lang.String generateAllDtoScripts()
          Generate JavaScript with all mapped DTO classes
 java.lang.String generateDtoScript(java.lang.String jsClassName)
          Generate JavaScript that forms a mapped DTO class
 java.lang.String generateInterfaceScript(java.lang.String scriptName, boolean includeDto, java.lang.String contextServletPath)
          Generate some Javascript that forms an interface definition
 java.lang.String getPathToDwrServlet(java.lang.String contextServletPath)
          The path to the DWR servlet is probably just equal to request.contextPath plus request.servletPath.
 

Method Detail

generateInterfaceScript

java.lang.String generateInterfaceScript(java.lang.String scriptName,
                                         boolean includeDto,
                                         java.lang.String contextServletPath)
                                         throws java.lang.SecurityException
Generate some Javascript that forms an interface definition

Parameters:
scriptName - The script to generate for
includeDto - Specifies whether mapped DTO classes should be added
contextServletPath - request.contextPath + request.servletPath.
Returns:
An interface javascript
Throws:
java.lang.SecurityException

generateDtoScript

java.lang.String generateDtoScript(java.lang.String jsClassName)
                                   throws java.lang.SecurityException
Generate JavaScript that forms a mapped DTO class

Parameters:
jsClassName - The mapped JavaScript class name
Returns:
JavaScript class definition
Throws:
java.lang.SecurityException

generateAllDtoScripts

java.lang.String generateAllDtoScripts()
                                       throws java.lang.SecurityException
Generate JavaScript with all mapped DTO classes

Returns:
JavaScript class definitions
Throws:
java.lang.SecurityException

execute

Replies execute(Calls calls)
Execute a set of remote calls and generate set of reply data for later conversion to whatever wire protocol we are using today.

Parameters:
calls - The set of calls to execute
Returns:
A set of reply data objects

getPathToDwrServlet

java.lang.String getPathToDwrServlet(java.lang.String contextServletPath)
The path to the DWR servlet is probably just equal to request.contextPath plus request.servletPath. However there are 2 ways to override this. One is to provide an overridePath setting, and the other is to specify useAbsolutePath=true, when the full URL up to the DWR servlet is used. This method simply echos back the contextServletPath unless one of those 2 settings are used in which case the modified value is returned.

Parameters:
contextServletPath - request.contextPath + request.servletPath.
Returns:
The path to the DWR servlet

Copyright 2008