// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/OutOfScopeException.java
// public final class OutOfScopeException extends RuntimeException {
// 
//     public OutOfScopeException(String message) {
//         super(message);
//     }
// 
//     public OutOfScopeException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public OutOfScopeException(Throwable cause) {
//         super(cause);
//     }
// }


import com.google.common.collect.Maps;
import com.leacox.dagger.servlet.scope.OutOfScopeException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Map;
/**
 * Copyright (C) 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.leacox.dagger.servlet;



/**
 * A wrapper for requests that makes requests immutable, taking a snapshot
 * of the original request.
 *
 * @author dhanji@gmail.com (Dhanji R. Prasanna)
 */
class ContinuingHttpServletRequest extends HttpServletRequestWrapper {

    // We clear out the attributes as they are mutable and not thread-safe.
    private final Map<String, Object> attributes = Maps.newHashMap();

    public ContinuingHttpServletRequest(HttpServletRequest request) {
        super(request);
    }

    @Override
    public HttpSession getSession() {
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/scope/OutOfScopeException.java
// public final class OutOfScopeException extends RuntimeException {
// 
//     public OutOfScopeException(String message) {
//         super(message);
//     }
// 
//     public OutOfScopeException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public OutOfScopeException(Throwable cause) {
//         super(cause);
//     }
// }


// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ContinuingHttpServletRequest.java
import com.google.common.collect.Maps;
import com.leacox.dagger.servlet.scope.OutOfScopeException;
import javax.servlet.ServletInputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Map;

/**
 * Copyright (C) 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.leacox.dagger.servlet;



/**
 * A wrapper for requests that makes requests immutable, taking a snapshot
 * of the original request.
 *
 * @author dhanji@gmail.com (Dhanji R. Prasanna)
 */
class ContinuingHttpServletRequest extends HttpServletRequestWrapper {

    // We clear out the attributes as they are mutable and not thread-safe.
    private final Map<String, Object> attributes = Maps.newHashMap();

    public ContinuingHttpServletRequest(HttpServletRequest request) {
        super(request);
    }

    @Override
    public HttpSession getSession() {
        throw new OutOfScopeException("Cannot access the session in a continued request");