hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-hivemind Wiki] Update of "StatefulHivemindFilter" by Marcus Schulte
Date Mon, 26 Sep 2005 12:11:04 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-hivemind Wiki" for change
notification.

The following page has been changed by Marcus Schulte:
http://wiki.apache.org/jakarta-hivemind/StatefulHivemindFilter

New page:
{{{
package scm.hivemind.statefulservice;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.hivemind.Registry;
import org.apache.hivemind.servlet.HiveMindFilter;


/**
 * A servlet filter for setting up the 
 * {@link scm.hivemind.statefulservice.ClientStateStorage}
 * for services holding state across requests.
 * 
 * @author Marcus Schulte
 */
public class StatefulHivemindFilter implements Filter {

	/**
	 * 
	 */
	public StatefulHivemindFilter() {
		super();
	}
   

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		
		HttpServletRequest req = (HttpServletRequest) request;
		Registry registry = HiveMindFilter.getRegistry( req );
		ClientStateStorage stateStore = (ClientStateStorage) 
                                       registry.getService(ClientStateStorage.class);
		stateStore.provideSession( req.getSession() );
		chain.doFilter( request, response );
		
	}
	
	/* (non-Javadoc)
	 * @see javax.servlet.Filter#destroy()
	 */
	public void destroy() {
			}
	/* (non-Javadoc)
	 * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
	 */
	public void init(FilterConfig filterConfig) throws ServletException {
	}
}

}}}

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message