Using Plug-ins

Most of the guts of DWR is pluggable so it is possible to alter the functionallity of DWR by replacing default classes. You can override the default implementations by including an <init-param> that specifies the interface to replace in the param-name and the replacement implementation in the param-value.

For example:

<servlet>
  <servlet-name>dwr-invoker</servlet-name>
  <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
  <init-param>
    <param-name>org.directwebremoting.extend.ServerLoadMonitor</param-name>
    <param-value>com.example.MyCustomServerLoadMonitor</param-value>
  </init-param>
</servlet>

There is no contract that we will leave these interfaces untouched across a major release, however we will attempt to provide easy upgrade paths.

Plug-in Points for DWR

The default implementations of these are mostly in the org.directwebremoting.impl package, the details are specified in ContainerUtil.setupDefaults().

In addition to the extension points listed above, there are some extension points which are very likely to change in future versions of DWR.