org.directwebremoting.extend
Interface ContainerAbstraction

All Known Implementing Classes:
JettyContinuationContainerAbstraction, Servlet24ContainerAbstraction, Servlet30ContainerAbstraction

public interface ContainerAbstraction

We need to keep container specific logic out of BasePollHandler, and other parts of DWR. Each container will need an implementation of this interface, which will generally just return configurations of generic classes.

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

Method Summary
 Sleeper createSleeper(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RealScriptSession scriptSession, ScriptConduit conduit)
          Create a sleeper that is appropriate for the given servlet container
 java.lang.Class<? extends ServerLoadMonitor> getServerLoadMonitorImplementation()
          The setup process allows the ContainerAbstraction to select a special ServerLoadMonitor implementation
 boolean handleResumedRequest(javax.servlet.http.HttpServletRequest request)
          Some async-servlet implementations (Jetty) restart requests, when we might have already completed dealing with them.
 boolean isNativeEnvironment(javax.servlet.ServletConfig servletConfig)
          We ask ContainerAbstractions to identify if the environment given is 'theirs'.
 

Method Detail

isNativeEnvironment

boolean isNativeEnvironment(javax.servlet.ServletConfig servletConfig)
We ask ContainerAbstractions to identify if the environment given is 'theirs'. Are they fit for this environment?

Parameters:
servletConfig - Access to ServletContext etc.
Returns:
true if this implementation should be used

getServerLoadMonitorImplementation

java.lang.Class<? extends ServerLoadMonitor> getServerLoadMonitorImplementation()
The setup process allows the ContainerAbstraction to select a special ServerLoadMonitor implementation

Returns:
The ServerLoadMonitor implementation to go with this container

handleResumedRequest

boolean handleResumedRequest(javax.servlet.http.HttpServletRequest request)
Some async-servlet implementations (Jetty) restart requests, when we might have already completed dealing with them. If this method returns true then PollHandler will assume that we're done and will bail out before we even get started.

Parameters:
request - The request that we might be finished with
Returns:
true if the request is completed

createSleeper

Sleeper createSleeper(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      RealScriptSession scriptSession,
                      ScriptConduit conduit)
                      throws java.io.IOException
Create a sleeper that is appropriate for the given servlet container

Parameters:
request - The Sleeper will probably need to know about the request
response - The Sleeper will probably need to know about the response
scriptSession - The Sleeper will probably need to know about the scriptSession
conduit - The Sleeper will probably need to know about the conduit
Returns:
A method of sending threads to sleep.
Throws:
java.io.IOException

Copyright ยจ 2008