net.sf.j2ep.servers
Class ClusterResponseWrapper

java.lang.Object
  extended by HttpServletResponseWrapper
      extended by net.sf.j2ep.servers.ClusterResponseWrapper

public class ClusterResponseWrapper
extends HttpServletResponseWrapper

A wrapper that will make sure sessions are rewritten so that the server can be derived from the session.

Author:
Anders Nyman

Constructor Summary
ClusterResponseWrapper(HttpServletResponse response, java.lang.String serverId)
          Basic constructor, will set the id that we should add to add the sessions to make sure that the session is tracked to a specific server.
 
Method Summary
 void addHeader(java.lang.String name, java.lang.String originalValue)
          Checks for the set-cookie header.
 void setHeader(java.lang.String name, java.lang.String originalValue)
          Checks for the set-cookie header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterResponseWrapper

public ClusterResponseWrapper(HttpServletResponse response,
                              java.lang.String serverId)
Basic constructor, will set the id that we should add to add the sessions to make sure that the session is tracked to a specific server.

Parameters:
response - The response we wrapp
serverId - The id of the server
Method Detail

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String originalValue)
Checks for the set-cookie header. This header will have to be rewritten (if it is marking a session)

See Also:
javax.servlet.http.HttpServletResponse#addHeader(java.lang.String, java.lang.String)

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String originalValue)
Checks for the set-cookie header. This header will have to be rewritten (if it is marking a session)

See Also:
javax.servlet.http.HttpServletResponse#setHeader(java.lang.String, java.lang.String)